1# RCSIDENT("$SiLK: Makefile.am a0de5ee69dff 2015-02-18 21:42:47Z mthomas $"); 2 3# Installed Targets 4 5bin_PROGRAMS = rwscan 6if HAVE_PERL_DBI 7have_dbi = rwscanquery 8else 9missing_dbi = rwscanquery 10endif 11bin_SCRIPTS = $(have_dbi) 12noinst_SCRIPTS = $(missing_dbi) 13 14EXTRA_DIST = rwscan.pod rwscanquery.in 15if HAVE_POD2MAN 16if HAVE_PODSELECT 17if HAVE_PERL_DBI 18# Perl files have POD embedded in the file which podselect extracts 19src2pod2man = rwscanquery.1 20endif 21endif 22man1_MANS = rwscan.1 $(src2pod2man) 23endif 24 25EXTRA_DIST += doc/db-mysql.sql doc/db-oracle.sql doc/db-postgres.sql 26 27 28# Build Rules 29 30AM_CPPFLAGS = $(SK_SRC_INCLUDES) $(SK_CPPFLAGS) 31AM_CFLAGS = $(WARN_CFLAGS) $(SK_CFLAGS) 32AM_LDFLAGS = $(SK_LDFLAGS) $(STATIC_APPLICATIONS) 33LDADD = ../libsilk/libsilk.la $(PTHREAD_LDFLAGS) 34 35rwscan_SOURCES = rwscan.c rwscan.h rwscan_db.c rwscan_db.h \ 36 rwscan_icmp.c rwscan_tcp.c rwscan_udp.c rwscan_utils.c \ 37 rwscan_workqueue.c rwscan_workqueue.h 38 39make_rwscanquery_edit = sed \ 40 -e 's|@PERL[@]|$(PERL)|g' \ 41 -e 's|@PACKAGE_STRING[@]|$(PACKAGE_STRING)|g' \ 42 -e 's|@PACKAGE_BUGREPORT[@]|$(PACKAGE_BUGREPORT)|g' \ 43 -e 's|@SILK_VERSION_INTEGER[@]|$(SILK_VERSION_INTEGER)|g' \ 44 -e 's|@rwfilter[@]|'$${my_rwfilter}'|g' \ 45 -e 's|@rwset[@]|'$${my_rwset}'|g' \ 46 -e 's|@rwsetbuild[@]|'$${my_rwsetbuild}'|g' \ 47 -e 's|@rwsetcat[@]|'$${my_rwsetcat}'|g' 48 49MAKE_RWSCANQUERY = $(AM_V_GEN) \ 50 rm -f $@ $@.tmp ; \ 51 srcdir='' ; \ 52 test -f ./$@.in || srcdir=$(srcdir)/ ; \ 53 my_rwfilter=`echo rwfilter | sed -e '$(transform)'` ; \ 54 my_rwset=`echo rwset | sed -e '$(transform)'` ; \ 55 my_rwsetbuild=`echo rwsetbuild | sed -e '$(transform)'` ; \ 56 my_rwsetcat=`echo rwsetcat | sed -e '$(transform)'` ; \ 57 $(make_rwscanquery_edit) "$${srcdir}$@.in" >$@.tmp && \ 58 chmod +x $@.tmp && \ 59 mv $@.tmp $@ 60 61rwscanquery: Makefile rwscanquery.in 62 $(MAKE_RWSCANQUERY) 63 64rwscanquery.pod : rwscanquery.in 65 $(AM_V_GEN)$(PODSELECT) $? > $@ 66 67MOSTLYCLEANFILES = rwscanquery.pod rwscanquery.tmp 68CLEANFILES = rwscanquery 69 70# Global Rules 71include $(top_srcdir)/build.mk 72include $(top_srcdir)/lib-deps.mk 73 74 75# Tests 76 77# Required files; variables defined in ../../build.mk 78check_DATA = $(SILK_TESTSDIR) $(SILK_TESTDATA) $(SILK_TESTSCAN) 79 80EXTRA_DIST += $(TESTS) 81 82TESTS = \ 83 tests/rwscan-help.pl \ 84 tests/rwscan-version.pl \ 85 tests/rwscan-lone-command.pl \ 86 tests/rwscan-null-input-blr.pl \ 87 tests/rwscan-missing-set-arg.pl \ 88 tests/rwscan-empty-input.pl \ 89 tests/rwscan-empty-input-blr.pl \ 90 tests/rwscan-hybrid.pl \ 91 tests/rwscan-trw-only.pl \ 92 tests/rwscan-blr-only.pl \ 93 tests/rwscanquery-help.pl \ 94 tests/rwscanquery-version.pl 95 96# above tests are automatically generated; 97# those below are written by hand 98TESTS += \ 99 tests/rwscanquery-sqlite.pl 100