From 70f6914469f40ee063b190e40ca82c8150dfba88 Mon Sep 17 00:00:00 2001 From: darkcoven Date: Sat, 28 Sep 2013 00:22:06 +0200 Subject: [PATCH] Move cli code to src subdir Shared build works --- .gitignore | 1 + Makefile.am | 20 +++++++++++--------- cli/Makefile.am | 10 +--------- cli/man/Makefile.am | 3 +++ cli/src/Makefile.am | 10 ++++++++++ cli/{ => src}/admin.c | 0 cli/{ => src}/com_bitrate.c | 0 cli/{ => src}/com_cabletest.c | 0 cli/{ => src}/com_defaults.c | 0 cli/{ => src}/com_firmware.c | 0 cli/{ => src}/com_help.c | 0 cli/{ => src}/com_igmp.c | 0 cli/{ => src}/com_list.c | 0 cli/{ => src}/com_login.c | 0 cli/{ => src}/com_mirror.c | 0 cli/{ => src}/com_name.c | 0 cli/{ => src}/com_netconf.c | 0 cli/{ => src}/com_password.c | 0 cli/{ => src}/com_ports.c | 0 cli/{ => src}/com_qos.c | 0 cli/{ => src}/com_quit.c | 0 cli/{ => src}/com_restart.c | 0 cli/{ => src}/com_scan.c | 0 cli/{ => src}/com_stormfilter.c | 0 cli/{ => src}/com_tree.c | 0 cli/{ => src}/com_vlan.c | 0 cli/{ => src}/commands.c | 0 cli/{ => src}/commands.h | 0 cli/{ => src}/common.c | 0 cli/{ => src}/common.h | 0 configure.ac | 9 +++++++++ lib/src/Makefile.am | 4 ++-- raw/Makefile.am | 2 +- raw/include/Makefile.am | 3 +++ raw/src/Makefile.am | 2 +- 35 files changed, 42 insertions(+), 22 deletions(-) create mode 100644 cli/man/Makefile.am create mode 100644 cli/src/Makefile.am rename cli/{ => src}/admin.c (100%) rename cli/{ => src}/com_bitrate.c (100%) rename cli/{ => src}/com_cabletest.c (100%) rename cli/{ => src}/com_defaults.c (100%) rename cli/{ => src}/com_firmware.c (100%) rename cli/{ => src}/com_help.c (100%) rename cli/{ => src}/com_igmp.c (100%) rename cli/{ => src}/com_list.c (100%) rename cli/{ => src}/com_login.c (100%) rename cli/{ => src}/com_mirror.c (100%) rename cli/{ => src}/com_name.c (100%) rename cli/{ => src}/com_netconf.c (100%) rename cli/{ => src}/com_password.c (100%) rename cli/{ => src}/com_ports.c (100%) rename cli/{ => src}/com_qos.c (100%) rename cli/{ => src}/com_quit.c (100%) rename cli/{ => src}/com_restart.c (100%) rename cli/{ => src}/com_scan.c (100%) rename cli/{ => src}/com_stormfilter.c (100%) rename cli/{ => src}/com_tree.c (100%) rename cli/{ => src}/com_vlan.c (100%) rename cli/{ => src}/commands.c (100%) rename cli/{ => src}/commands.h (100%) rename cli/{ => src}/common.c (100%) rename cli/{ => src}/common.h (100%) create mode 100644 raw/include/Makefile.am diff --git a/.gitignore b/.gitignore index 603185b..0ad50c4 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ compile install-sh ltmain.sh missing +depcomp build-aux/ libtool stamp-h1 diff --git a/Makefile.am b/Makefile.am index 8519d09..939d0ff 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,15 +1,17 @@ +ACLOCAL_AMFLAGS = -I . + SUBDIRS = raw lib cli -if ENABLE_SPY -SUBDIRS += dump -endif +#if ENABLE_SPY +#SUBDIRS += dump +#endif -if ENABLE_DEBUG -CFLAGS += -g -else -CFLAGS += -fomit-frame-pointer -LDFLAGS+= -s -endif +#if ENABLE_DEBUG +#CFLAGS += -g +#else +#CFLAGS += -fomit-frame-pointer +#LDFLAGS+= -s +#endif diff --git a/cli/Makefile.am b/cli/Makefile.am index 66d771d..1c0c975 100644 --- a/cli/Makefile.am +++ b/cli/Makefile.am @@ -1,11 +1,3 @@ -bin_PROGRAMS = admin - -admin_SOURCES = admin.c com_bitrate.c com_cabletest.c com_defaults.c com_firmware.c \ - com_help.c com_igmp.c com_list.c com_login.c commands.c com_mirror.c \ - common.c com_name.c com_netconf.c com_password.c com_ports.c com_qos.c \ - com_quit.c com_restart.c com_scan.c com_stormfilter.c com_tree.c com_vlan.c -admin_CFLAGS = -I../lib/include/ -admin_LDADD = libngadmin.la - +SUBDIRS = man src diff --git a/cli/man/Makefile.am b/cli/man/Makefile.am new file mode 100644 index 0000000..cea1b3d --- /dev/null +++ b/cli/man/Makefile.am @@ -0,0 +1,3 @@ + +man_MANS = ngadmin.1 + diff --git a/cli/src/Makefile.am b/cli/src/Makefile.am new file mode 100644 index 0000000..9cb55f9 --- /dev/null +++ b/cli/src/Makefile.am @@ -0,0 +1,10 @@ + +bin_PROGRAMS = admin + +admin_SOURCES = admin.c com_bitrate.c com_cabletest.c com_defaults.c com_firmware.c \ + com_help.c com_igmp.c com_list.c com_login.c commands.c com_mirror.c \ + common.c com_name.c com_netconf.c com_password.c com_ports.c com_qos.c \ + com_quit.c com_restart.c com_scan.c com_stormfilter.c com_tree.c com_vlan.c +admin_CPPFLAGS = -I$(top_srcdir)/lib/include/ +admin_LDADD = $(top_builddir)/lib/src/libngadmin.la + diff --git a/cli/admin.c b/cli/src/admin.c similarity index 100% rename from cli/admin.c rename to cli/src/admin.c diff --git a/cli/com_bitrate.c b/cli/src/com_bitrate.c similarity index 100% rename from cli/com_bitrate.c rename to cli/src/com_bitrate.c diff --git a/cli/com_cabletest.c b/cli/src/com_cabletest.c similarity index 100% rename from cli/com_cabletest.c rename to cli/src/com_cabletest.c diff --git a/cli/com_defaults.c b/cli/src/com_defaults.c similarity index 100% rename from cli/com_defaults.c rename to cli/src/com_defaults.c diff --git a/cli/com_firmware.c b/cli/src/com_firmware.c similarity index 100% rename from cli/com_firmware.c rename to cli/src/com_firmware.c diff --git a/cli/com_help.c b/cli/src/com_help.c similarity index 100% rename from cli/com_help.c rename to cli/src/com_help.c diff --git a/cli/com_igmp.c b/cli/src/com_igmp.c similarity index 100% rename from cli/com_igmp.c rename to cli/src/com_igmp.c diff --git a/cli/com_list.c b/cli/src/com_list.c similarity index 100% rename from cli/com_list.c rename to cli/src/com_list.c diff --git a/cli/com_login.c b/cli/src/com_login.c similarity index 100% rename from cli/com_login.c rename to cli/src/com_login.c diff --git a/cli/com_mirror.c b/cli/src/com_mirror.c similarity index 100% rename from cli/com_mirror.c rename to cli/src/com_mirror.c diff --git a/cli/com_name.c b/cli/src/com_name.c similarity index 100% rename from cli/com_name.c rename to cli/src/com_name.c diff --git a/cli/com_netconf.c b/cli/src/com_netconf.c similarity index 100% rename from cli/com_netconf.c rename to cli/src/com_netconf.c diff --git a/cli/com_password.c b/cli/src/com_password.c similarity index 100% rename from cli/com_password.c rename to cli/src/com_password.c diff --git a/cli/com_ports.c b/cli/src/com_ports.c similarity index 100% rename from cli/com_ports.c rename to cli/src/com_ports.c diff --git a/cli/com_qos.c b/cli/src/com_qos.c similarity index 100% rename from cli/com_qos.c rename to cli/src/com_qos.c diff --git a/cli/com_quit.c b/cli/src/com_quit.c similarity index 100% rename from cli/com_quit.c rename to cli/src/com_quit.c diff --git a/cli/com_restart.c b/cli/src/com_restart.c similarity index 100% rename from cli/com_restart.c rename to cli/src/com_restart.c diff --git a/cli/com_scan.c b/cli/src/com_scan.c similarity index 100% rename from cli/com_scan.c rename to cli/src/com_scan.c diff --git a/cli/com_stormfilter.c b/cli/src/com_stormfilter.c similarity index 100% rename from cli/com_stormfilter.c rename to cli/src/com_stormfilter.c diff --git a/cli/com_tree.c b/cli/src/com_tree.c similarity index 100% rename from cli/com_tree.c rename to cli/src/com_tree.c diff --git a/cli/com_vlan.c b/cli/src/com_vlan.c similarity index 100% rename from cli/com_vlan.c rename to cli/src/com_vlan.c diff --git a/cli/commands.c b/cli/src/commands.c similarity index 100% rename from cli/commands.c rename to cli/src/commands.c diff --git a/cli/commands.h b/cli/src/commands.h similarity index 100% rename from cli/commands.h rename to cli/src/commands.h diff --git a/cli/common.c b/cli/src/common.c similarity index 100% rename from cli/common.c rename to cli/src/common.c diff --git a/cli/common.h b/cli/src/common.h similarity index 100% rename from cli/common.h rename to cli/src/common.h diff --git a/configure.ac b/configure.ac index 0e759eb..d063ae5 100644 --- a/configure.ac +++ b/configure.ac @@ -1,15 +1,21 @@ AC_PREREQ([2.68]) AC_INIT([ngadmin], [0.1], [admin@darkcoven.tk]) +AC_CONFIG_MACRO_DIR([.]) AC_CONFIG_SRCDIR([raw/src/attr.c]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE +LT_PREREQ([2.4]) +LT_INIT + # Checks for programs AC_PROG_CC +AM_PROG_CC_C_O # Checks for libraries +AC_CHECK_LIB([readline], [readline]) # Checks for header files AC_CHECK_HEADERS([arpa/inet.h stdlib.h string.h sys/ioctl.h termios.h unistd.h]) @@ -27,11 +33,14 @@ AC_CHECK_FUNCS([inet_ntoa memchr memset select socket strcasecmp strdup strtol s AC_CONFIG_FILES([ Makefile raw/Makefile + raw/include/Makefile raw/src/Makefile lib/Makefile lib/include/Makefile lib/src/Makefile cli/Makefile + cli/man/Makefile + cli/src/Makefile ]) AC_OUTPUT diff --git a/lib/src/Makefile.am b/lib/src/Makefile.am index c2a1d50..bc789c4 100644 --- a/lib/src/Makefile.am +++ b/lib/src/Makefile.am @@ -3,7 +3,7 @@ lib_LTLIBRARIES = libngadmin.la libngadmin_la_SOURCES = network.c bitrate.c firmware.c libconf.c mirror.c misc.c \ netconf.c ports.c qos.c session.c vlan.c -libngadmin_la_CPPFLAGS = -DBUILD_LIB -I../include/ -I../../raw/include/ +libngadmin_la_CPPFLAGS = -DBUILD_LIB -I$(top_srcdir)/raw/include/ -I$(top_srcdir)/lib/include/ libngadmin_la_CFLAGS = -fno-strict-aliasing -libngadmin_la_LIBADD = ../../raw/src/librawnsdp.la +libngadmin_la_LIBADD = $(top_builddir)/raw/src/librawnsdp.la diff --git a/raw/Makefile.am b/raw/Makefile.am index 6b75694..acfa633 100644 --- a/raw/Makefile.am +++ b/raw/Makefile.am @@ -1,3 +1,3 @@ -SUBDIRS = src +SUBDIRS = include src diff --git a/raw/include/Makefile.am b/raw/include/Makefile.am new file mode 100644 index 0000000..2183ae6 --- /dev/null +++ b/raw/include/Makefile.am @@ -0,0 +1,3 @@ + +noinst_HEADERS = attr.h list.h protocol.h + diff --git a/raw/src/Makefile.am b/raw/src/Makefile.am index 562d502..bf354b0 100644 --- a/raw/src/Makefile.am +++ b/raw/src/Makefile.am @@ -2,6 +2,6 @@ noinst_LTLIBRARIES = librawnsdp.la librawnsdp_la_SOURCES = attr.c list.c protocol.c -librawnsdp_la_CPPFLAGS = -I../include/ -I../../lib/include/ +librawnsdp_la_CPPFLAGS = -I$(top_srcdir)/raw/include/ -I$(top_srcdir)/lib/include/ librawnsdp_la_CFLAGS = -fno-strict-aliasing -- 2.39.5