@@ -1,12 +1,11 @@
+SUBDIRS = include libipulog src input filter output
-ACLOCAL_AMFLAGS = -I m4
+ACLOCAL_AMFLAGS = -I m4
dist_man_MANS = ulogd.8
EXTRA_DIST = ulogd.conf.in doc
-SUBDIRS = include libipulog src input filter output
-
noinst_DATA = ulogd.conf
edit = sed \
@@ -17,4 +16,3 @@ ulogd.conf: Makefile $(srcdir)/ulogd.conf.in
dist-hook:
rm -f ulogd.conf
-
@@ -1,2 +1 @@
-
noinst_HEADERS = libipulog.h
@@ -1,2 +1 @@
-
noinst_HEADERS = conffile.h db.h ipfix_protocol.h linuxlist.h ulogd.h printpkt.h printflow.h common.h linux_rbtree.h timer.h slist.h hash.h jhash.h addr.h
@@ -1,2 +1,9 @@
+if BUILD_NFCT
+ OPT_SUBDIR_FLOW = flow
+endif
-SUBDIRS = packet flow sum
+if BUILD_NFACCT
+ OPT_SUBDIR_SUM = sum
+endif
+
+SUBDIRS = packet $(OPT_SUBDIR_FLOW) $(OPT_SUBDIR_SUM)
@@ -2,12 +2,10 @@ include $(top_srcdir)/Make_global.am
AM_CPPFLAGS += ${LIBNETFILTER_CONNTRACK_CFLAGS}
-if BUILD_NFCT
pkglib_LTLIBRARIES = ulogd_inpflow_NFCT.la # ulogd_inpflow_IPFIX.la
ulogd_inpflow_NFCT_la_SOURCES = ulogd_inpflow_NFCT.c
ulogd_inpflow_NFCT_la_LDFLAGS = -avoid-version -module $(LIBNETFILTER_CONNTRACK_LIBS)
-endif
#ulogd_inpflow_IPFIX_la_SOURCES = ulogd_inpflow_IPFIX.c
#ulogd_inpflow_IPFIX_la_LDFLAGS = -avoid-version -module
@@ -2,9 +2,8 @@ include $(top_srcdir)/Make_global.am
AM_CPPFLAGS += $(LIBNETFILTER_ACCT_CFLAGS) $(LIBMNL_CFLAGS)
-if BUILD_NFACCT
pkglib_LTLIBRARIES = ulogd_inpflow_NFACCT.la
+
ulogd_inpflow_NFACCT_la_SOURCES = ulogd_inpflow_NFACCT.c
ulogd_inpflow_NFACCT_la_LDFLAGS = -avoid-version -module
ulogd_inpflow_NFACCT_la_LIBADD = $(LIBMNL_LIBS) $(LIBNETFILTER_ACCT_LIBS)
-endif
@@ -1,11 +1,36 @@
+if HAVE_PCAP
+ OPT_SUBDIR_PCAP = pcap
+endif
+
+if HAVE_MYSQL
+ OPT_SUBDIR_MYSQL = mysql
+endif
+
+if HAVE_PGSQL
+ OPT_SUBDIR_PGSQL = pgsql
+endif
+
+if HAVE_SQLITE3
+ OPT_SUBDIR_SQLITE3 = sqlite3
+endif
+
+if HAVE_DBI
+ OPT_SUBDIR_DBI = dbi
+endif
+
+SUBDIRS = $(OPT_SUBDIR_PCAP) \
+ $(OPT_SUBDIR_MYSQL) \
+ $(OPT_SUBDIR_PGSQL) \
+ $(OPT_SUBDIR_SQLITE3) \
+ $(OPT_SUBDIR_DBI) \
+ ipfix
+
include $(top_srcdir)/Make_global.am
AM_CPPFLAGS += ${LIBNETFILTER_ACCT_CFLAGS} \
${LIBNETFILTER_CONNTRACK_CFLAGS} \
${LIBNETFILTER_LOG_CFLAGS}
-SUBDIRS= pcap mysql pgsql sqlite3 dbi ipfix
-
pkglib_LTLIBRARIES = ulogd_output_LOGEMU.la ulogd_output_SYSLOG.la \
ulogd_output_OPRINT.la ulogd_output_GPRINT.la \
ulogd_output_NACCT.la ulogd_output_XML.la \
@@ -2,12 +2,8 @@ include $(top_srcdir)/Make_global.am
AM_CPPFLAGS += $(DBI_INC)
-if HAVE_DBI
-
pkglib_LTLIBRARIES = ulogd_output_DBI.la
ulogd_output_DBI_la_SOURCES = ulogd_output_DBI.c ../../util/db.c
ulogd_output_DBI_la_LIBADD = ${DBI_LIB}
ulogd_output_DBI_la_LDFLAGS = -avoid-version -module
-
-endif
@@ -2,12 +2,8 @@ include $(top_srcdir)/Make_global.am
AM_CPPFLAGS += $(MYSQL_INC)
-if HAVE_MYSQL
-
pkglib_LTLIBRARIES = ulogd_output_MYSQL.la
ulogd_output_MYSQL_la_SOURCES = ulogd_output_MYSQL.c ../../util/db.c
ulogd_output_MYSQL_la_LIBADD = ${MYSQL_LIB}
ulogd_output_MYSQL_la_LDFLAGS = -avoid-version -module
-
-endif
@@ -1,11 +1,7 @@
include $(top_srcdir)/Make_global.am
-if HAVE_PCAP
-
pkglib_LTLIBRARIES = ulogd_output_PCAP.la
ulogd_output_PCAP_la_SOURCES = ulogd_output_PCAP.c
ulogd_output_PCAP_la_LIBADD = ${libpcap_LIBS}
ulogd_output_PCAP_la_LDFLAGS = -avoid-version -module
-
-endif
@@ -2,12 +2,8 @@ include $(top_srcdir)/Make_global.am
AM_CPPFLAGS += -I$(PQINCPATH)
-if HAVE_PGSQL
-
pkglib_LTLIBRARIES = ulogd_output_PGSQL.la
ulogd_output_PGSQL_la_SOURCES = ulogd_output_PGSQL.c ../../util/db.c
ulogd_output_PGSQL_la_LIBADD = ${PQLIBS}
ulogd_output_PGSQL_la_LDFLAGS = -avoid-version -module
-
-endif
@@ -2,12 +2,8 @@ include $(top_srcdir)/Make_global.am
AM_CPPFLAGS += ${libsqlite3_CFLAGS}
-if HAVE_SQLITE3
-
pkglib_LTLIBRARIES = ulogd_output_SQLITE3.la
ulogd_output_SQLITE3_la_SOURCES = ulogd_output_SQLITE3.c ../../util/db.c
ulogd_output_SQLITE3_la_LIBADD = ${libsqlite3_LIBS}
ulogd_output_SQLITE3_la_LDFLAGS = -avoid-version -module
-
-endif
Currently, make enters all sub-directories containing source-code, even if they only contain optional targets which are not configured to be built. Instead, change the Makefiles so that the sub-directories are optional, rather than the targets. Group sub-directory definitions consistently at the top of the Makefiles that contain them. Trim a few leading and trailing blank lines. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> --- Makefile.am | 6 ++---- include/libipulog/Makefile.am | 1 - include/ulogd/Makefile.am | 1 - input/Makefile.am | 9 ++++++++- input/flow/Makefile.am | 2 -- input/sum/Makefile.am | 3 +-- output/Makefile.am | 29 +++++++++++++++++++++++++++-- output/dbi/Makefile.am | 4 ---- output/mysql/Makefile.am | 4 ---- output/pcap/Makefile.am | 4 ---- output/pgsql/Makefile.am | 4 ---- output/sqlite3/Makefile.am | 4 ---- 12 files changed, 38 insertions(+), 33 deletions(-)