Commit 55bab3f54c06fcb37ca86bf92aa5ab59d8582c53
1 parent
3647a435
New organisation of the source tree
- separate tests directory - regroup modbus.h and modbus.c in the same dir - updated waf scripts - updated autotools files - bump application version to 1.9.0 - bump library number to 2.0.0
Showing
13 changed files
with
40 additions
and
36 deletions
Makefile.am
configure.ac
| ... | ... | @@ -24,11 +24,9 @@ AC_FUNC_MALLOC |
| 24 | 24 | AC_FUNC_SELECT_ARGTYPES |
| 25 | 25 | AC_CHECK_FUNCS([inet_ntoa memset select socket]) |
| 26 | 26 | |
| 27 | -AC_SUBST(modbus_pkgdeps) | |
| 28 | 27 | AC_OUTPUT([ |
| 29 | 28 | Makefile |
| 30 | -src/Makefile | |
| 31 | -include/Makefile | |
| 32 | -include/modbus/Makefile | |
| 29 | +modbus/Makefile | |
| 30 | +tests/Makefile | |
| 33 | 31 | modbus.pc |
| 34 | 32 | ]) | ... | ... |
include/Makefile.am deleted
include/modbus/Makefile.am renamed to modbus/Makefile.am
| 1 | -## Process this file with automake to produce Makefile.in | |
| 1 | +lib_LTLIBRARIES = libmodbus.la | |
| 2 | +libmodbus_la_SOURCES = modbus.c modbus.h | |
| 3 | +libmodbus_la_LDFLAGS = -version-info 2:0:0 | |
| 2 | 4 | |
| 3 | 5 | # Include files to install |
| 4 | 6 | libmodbusincludedir = $(includedir)/modbus |
| 5 | -libmodbusinclude_HEADERS = modbus.h | |
| 6 | 7 | \ No newline at end of file |
| 8 | +libmodbusinclude_HEADERS = modbus.h | |
| 9 | + | |
| 10 | +INCLUDES = -I$(top_srcdir) | |
| 11 | +CLEANFILES = *~ | ... | ... |
src/modbus.c renamed to modbus/modbus.c
include/modbus/modbus.h renamed to modbus/modbus.h
modbus/wscript
0 → 100644
src/Makefile.am deleted
| 1 | -lib_LTLIBRARIES = libmodbus.la | |
| 2 | -libmodbus_la_SOURCES = modbus.c modbus.h | |
| 3 | - | |
| 4 | -bin_PROGRAMS = test-modbus-master test-modbus-slave | |
| 5 | -test_modbus_master_SOURCES = test-modbus-master.c | |
| 6 | -test_modbus_master_LDADD = libmodbus.la | |
| 7 | - | |
| 8 | -test_modbus_slave_SOURCES = test-modbus-slave.c | |
| 9 | -test_modbus_slave_LDADD = libmodbus.la | |
| 10 | - | |
| 11 | -INCLUDES = -I$(top_srcdir)/include | |
| 12 | -CLEANFILES = *~ |
tests/Makefile.am
0 → 100644
| 1 | +noinst_PROGRAMS = \ | |
| 2 | + test-modbus-master \ | |
| 3 | + test-modbus-slave | |
| 4 | + | |
| 5 | +common_ldflags = \ | |
| 6 | + $(top_builddir)/modbus/libmodbus.la | |
| 7 | + | |
| 8 | +test_modbus_master_SOURCES = test-modbus-master.c | |
| 9 | +test_modbus_master_LDADD = $(common_ldflags) | |
| 10 | + | |
| 11 | +test_modbus_slave_SOURCES = test-modbus-slave.c | |
| 12 | +test_modbus_slave_LDADD = $(common_ldflags) | |
| 13 | + | |
| 14 | +INCLUDES = -I$(top_srcdir) | |
| 15 | +CLEANFILES = *~ | ... | ... |
src/test-modbus-master.c renamed to tests/test-modbus-master.c
src/test-modbus-slave.c renamed to tests/test-modbus-slave.c
src/wscript renamed to tests/wscript
| 1 | 1 | def build(bld): |
| 2 | - obj = bld.create_obj('cc', 'shlib') | |
| 3 | - obj.source = 'modbus.c' | |
| 4 | - obj.includes = '.' | |
| 5 | - obj.uselib = 'GLIB' | |
| 6 | - obj.target = 'modbus' | |
| 7 | - obj.vnum = '1.2.4' | |
| 8 | - | |
| 9 | 2 | obj = bld.create_obj('cc', 'program') |
| 10 | 3 | obj.source = 'test-modbus-master.c' |
| 11 | 4 | obj.includes = '.' |
| 12 | 5 | obj.uselib_local = 'modbus' |
| 13 | 6 | obj.target = 'test-modbus-master' |
| 7 | + obj.inst_var = 0 | |
| 14 | 8 | |
| 15 | 9 | obj = bld.create_obj('cc', 'program') |
| 16 | 10 | obj.source = 'test-modbus-slave.c' |
| 17 | 11 | obj.includes = '.' |
| 18 | 12 | obj.uselib_local = 'modbus' |
| 19 | 13 | obj.target = 'test-modbus-slave' |
| 14 | + obj.inst_var = 0 | ... | ... |
wscript
| ... | ... | @@ -8,9 +8,6 @@ APPNAME='libmodbus' |
| 8 | 8 | srcdir = '.' |
| 9 | 9 | blddir = 'build' |
| 10 | 10 | |
| 11 | -def init(): | |
| 12 | - print "A groovy libmodbus for Linux!" | |
| 13 | - | |
| 14 | 11 | def set_options(opt): |
| 15 | 12 | # options provided by the modules |
| 16 | 13 | opt.tool_options('compiler_cc') |
| ... | ... | @@ -51,17 +48,18 @@ def configure(conf): |
| 51 | 48 | def build(bld): |
| 52 | 49 | import misc |
| 53 | 50 | |
| 54 | - bld.add_subdirs('src') | |
| 51 | + bld.add_subdirs('modbus tests') | |
| 55 | 52 | |
| 56 | 53 | obj = bld.create_obj('subst') |
| 57 | 54 | obj.source = 'modbus.pc.in' |
| 58 | 55 | obj.target = 'modbus.pc' |
| 59 | - | |
| 60 | 56 | obj.dict = {'VERSION' : VERSION, |
| 61 | 57 | 'prefix': bld.env()['PREFIX'], |
| 62 | 58 | 'exec_prefix': bld.env()['PREFIX'], |
| 63 | - 'libdir': bld.env()['PREFIX'] + '/lib', | |
| 64 | - 'includedir': bld.env()['PREFIX'] + '/include'} | |
| 59 | + 'libdir': bld.env()['PREFIX'] + 'lib', | |
| 60 | + 'includedir': bld.env()['PREFIX'] + 'include'} | |
| 61 | + | |
| 62 | + install_files('PREFIX', 'lib/pkgconfig', 'modbus.pc') | |
| 65 | 63 | |
| 66 | 64 | def shutdown(): |
| 67 | 65 | import UnitTest | ... | ... |