Refactor of Makefile.am files to fix issues caused by referencing source files in other directories - which broke make dist and make distclean targets.

This commit is contained in:
Damien Stuart
2015-02-17 14:37:20 -05:00
parent 987455b902
commit e4fae829bc
13 changed files with 124 additions and 97 deletions
+1 -1
View File
@@ -13,8 +13,8 @@ if WANT_C_UNIT_TESTS
endif
SUBDIRS = \
lib \
common \
lib \
$(CLIENT_DIR) \
$(SERVER_DIR) \
$(C_UNIT_TESTS_DIR) \
+12 -2
View File
@@ -1,17 +1,27 @@
bin_PROGRAMS = fwknop
fwknop_SOURCES = fwknop.c fwknop.h config_init.c config_init.h \
BASE_SOURCE_FILES = fwknop.h config_init.c config_init.h \
fwknop_common.h spa_comm.c spa_comm.h utils.c utils.h \
http_resolve_host.c getpasswd.c getpasswd.h cmd_opts.h \
log_msg.c log_msg.h
fwknop_SOURCES = fwknop.c $(BASE_SOURCE_FILES)
if WANT_C_UNIT_TESTS
noinst_PROGRAMS = fwknop_utests
fwknop_utests_SOURCES = fwknop_utests.c $(BASE_SOURCE_FILES)
fwknop_utests_CPPFLAGS = -I $(top_builddir)/lib -I $(top_builddir)/common $(GPGME_CFLAGS)
fwknop_utests_LDADD = $(top_builddir)/lib/libfko.la $(top_builddir)/common/libfko_util.a
fwknop_utests_LDFLAGS = -lcunit $(GPGME_LIBS)
endif
fwknop_CPPFLAGS = -I $(top_srcdir)/lib -I $(top_srcdir)/common
fwknop_LDADD = $(top_builddir)/lib/libfko.la $(top_builddir)/common/libfko_util.a
dist_man_MANS = fwknop.8
EXTRA_DIST = fwknop.8.in
EXTRA_DIST = fwknop.8.in fwknop_utests.c
fwknop.8: $(top_srcdir)/client/fwknop.8.in
$(SED) \
+2 -4
View File
@@ -2,9 +2,7 @@ AUTOMAKE_OPTIONS = subdir-objects
noinst_LIBRARIES = libfko_util.a
libfko_util_source_files = \
../lib/strlcpy.c ../lib/strlcat.c ../lib/fko_util.c \
../lib/fko_util.h
libfko_util_source_files = strlcpy.c strlcat.c fko_util.c fko_util.h
if WANT_C_UNIT_TESTS
libfko_util_source_files += cunit_common.c cunit_common.h
@@ -12,6 +10,6 @@ endif
libfko_util_a_SOURCES = $(libfko_util_source_files)
AM_CPPFLAGS = $(GPGME_CFLAGS) -I $(top_srcdir)/common
AM_CPPFLAGS = $(GPGME_CFLAGS) -I $(top_srcdir)/common -I $(top_srcdir)/lib
EXTRA_DIST = common.h netinet_common.h cunit_common.h cunit_common.c
View File
View File
+6 -2
View File
@@ -8,11 +8,15 @@ libfko_source_files = \
fko.h fko_limits.h fko_timestamp.c fko_hmac.c hmac.c hmac.h \
fko_user.c fko_user.h md5.c md5.h rijndael.c rijndael.h sha1.c \
sha1.h sha2.c sha2.h fko_context.h fko_state.h \
gpgme_funcs.c gpgme_funcs.h strlcpy.c strlcat.c fko_util.c fko_util.h
gpgme_funcs.c gpgme_funcs.h
if WANT_C_UNIT_TESTS
libfko_la_LIBADD = $(top_builddir)/common/cunit_common.o
libfko_la_LIBADD = $(top_builddir)/common/cunit_common.o
noinst_PROGRAMS = fko_utests
fko_utests_SOURCES = fko_utests.c
fko_utests_CPPFLAGS = -I ../lib -I ../common $(GPGME_CFLAGS)
fko_utests_LDFLAGS = -lcunit $(GPGME_LIBS)
endif
libfko_la_SOURCES = $(libfko_source_files)
+29 -14
View File
@@ -1,21 +1,36 @@
sbin_PROGRAMS = fwknopd
sbin_PROGRAMS = fwknopd
fwknopd_SOURCES = fwknopd.c fwknopd.h config_init.c config_init.h \
fwknopd_common.h incoming_spa.c incoming_spa.h \
pcap_capture.c pcap_capture.h process_packet.c \
process_packet.h log_msg.c log_msg.h utils.c utils.h \
sig_handler.c sig_handler.h replay_cache.c replay_cache.h \
access.c access.h fwknopd_errors.c fwknopd_errors.h \
tcp_server.c tcp_server.h udp_server.c udp_server.h \
fw_util.c fw_util.h fw_util_ipf.c fw_util_ipf.h \
fw_util_firewalld.c fw_util_firewalld.h \
fw_util_iptables.c fw_util_iptables.h \
fw_util_ipfw.c fw_util_ipfw.h \
fw_util_pf.c fw_util_pf.h cmd_opts.h \
extcmd.c extcmd.h
BASE_SOURCE_FILES = fwknopd.h config_init.c config_init.h \
fwknopd_common.h incoming_spa.c incoming_spa.h \
pcap_capture.c pcap_capture.h process_packet.c \
process_packet.h log_msg.c log_msg.h utils.c utils.h \
sig_handler.c sig_handler.h replay_cache.c replay_cache.h \
access.c access.h fwknopd_errors.c fwknopd_errors.h \
tcp_server.c tcp_server.h udp_server.c udp_server.h \
fw_util.c fw_util.h fw_util_ipf.c fw_util_ipf.h \
fw_util_firewalld.c fw_util_firewalld.h \
fw_util_iptables.c fw_util_iptables.h \
fw_util_ipfw.c fw_util_ipfw.h \
fw_util_pf.c fw_util_pf.h cmd_opts.h \
extcmd.c extcmd.h
fwknopd_SOURCES = fwknopd.c $(BASE_SOURCE_FILES)
fwknopd_LDADD = $(top_builddir)/lib/libfko.la $(top_builddir)/common/libfko_util.a
if WANT_C_UNIT_TESTS
noinst_PROGRAMS = fwknopd_utests
fwknopd_utests_SOURCES = fwknopd_utests.c $(BASE_SOURCE_FILES)
fwknopd_utests_CPPFLAGS = -I $(top_builddir)/lib -I $(top_builddir)/common $(GPGME_CFLAGS) -DSYSCONFDIR=\"$(sysconfdir)\" -DSYSRUNDIR=\"$(localstatedir)\"
fwknopd_utests_LDADD = $(top_builddir)/lib/libfko.la $(top_builddir)/common/libfko_util.a
fwknopd_utests_LDFLAGS = -lcunit $(GPGME_LIBS)
if !UDP_SERVER
fwknopd_utests_LDFLAGS += -lpcap
endif
endif
if !UDP_SERVER
fwknopd_LDADD += -lpcap
endif
+74 -74
View File
@@ -1,74 +1,74 @@
bin_PROGRAMS = fwknop_utests fwknopd_utests fko_utests
fwknop_utests_SOURCES = fwknop_utests.c \
../../client/config_init.c \
../../client/spa_comm.c \
../../client/utils.c \
../../client/http_resolve_host.c \
../../client/getpasswd.c \
../../client/log_msg.c
fwknop_utests_CPPFLAGS = -I ../../lib -I ../../common -I ../../client
fwknop_utests_LDADD = ../../lib/libfko.la ../../common/libfko_util.a
fwknop_utests_LDFLAGS = -lcunit
fwknopd_utests_SOURCES = fwknopd_utests.c \
../../server/config_init.c \
../../server/incoming_spa.c \
../../server/pcap_capture.c \
../../server/process_packet.c \
../../server/log_msg.c \
../../server/utils.c \
../../server/sig_handler.c \
../../server/replay_cache.c \
../../server/access.c\
../../server/fwknopd_errors.c \
../../server/tcp_server.c \
../../server/extcmd.c \
../../server/fw_util.c \
../../server/fw_util_ipf.c \
../../server/fw_util_ipfw.c \
../../server/fw_util_pf.c \
../../server/fw_util_iptables.c \
../../server/fw_util_firewalld.c
fwknopd_utests_CPPFLAGS = -I ../../lib -I ../../common -I ../../server -DSYSCONFDIR=\"$(sysconfdir)\" -DSYSRUNDIR=\"$(localstatedir)\"
fwknopd_utests_LDADD = $(top_builddir)/lib/libfko.la $(top_builddir)/common/libfko_util.a
fwknopd_utests_LDFLAGS = -lcunit -lpcap
fko_utests_SOURCES = fko_utests.c \
../../lib/base64.c \
../../lib/cipher_funcs.c \
../../lib/digest.c \
../../lib/fko_client_timeout.c \
../../lib/fko_digest.c \
../../lib/fko_encode.c \
../../lib/fko_decode.c \
../../lib/fko_encryption.c \
../../lib/fko_error.c \
../../lib/fko_funcs.c \
../../lib/fko_message.c \
../../lib/fko_nat_access.c \
../../lib/fko_rand_value.c \
../../lib/fko_server_auth.c \
../../lib/fko_timestamp.c \
../../lib/fko_hmac.c \
../../lib/hmac.c \
../../lib/fko_user.c \
../../lib/md5.c \
../../lib/rijndael.c \
../../lib/sha1.c \
../../lib/sha2.c \
../../lib/strlcpy.c \
../../lib/strlcat.c \
../../lib/fko_util.c \
../../lib/gpgme_funcs.c \
../../common/cunit_common.c
fko_utests_CPPFLAGS = -I ../../lib -I ../../common $(GPGME_CFLAGS)
fko_utests_LDFLAGS = -lcunit $(GPGME_LIBS)
#bin_PROGRAMS = fwknop_utests fwknopd_utests fko_utests
#
#fwknop_utests_SOURCES = fwknop_utests.c \
# ../../client/config_init.c \
# ../../client/spa_comm.c \
# ../../client/utils.c \
# ../../client/http_resolve_host.c \
# ../../client/getpasswd.c \
# ../../client/log_msg.c
#
#fwknop_utests_CPPFLAGS = -I ../../lib -I ../../common -I ../../client
#
#fwknop_utests_LDADD = ../../lib/libfko.la ../../common/libfko_util.a
#
#fwknop_utests_LDFLAGS = -lcunit
#
#fwknopd_utests_SOURCES = fwknopd_utests.c \
# ../../server/config_init.c \
# ../../server/incoming_spa.c \
# ../../server/pcap_capture.c \
# ../../server/process_packet.c \
# ../../server/log_msg.c \
# ../../server/utils.c \
# ../../server/sig_handler.c \
# ../../server/replay_cache.c \
# ../../server/access.c\
# ../../server/fwknopd_errors.c \
# ../../server/tcp_server.c \
# ../../server/extcmd.c \
# ../../server/fw_util.c \
# ../../server/fw_util_ipf.c \
# ../../server/fw_util_ipfw.c \
# ../../server/fw_util_pf.c \
# ../../server/fw_util_iptables.c \
# ../../server/fw_util_firewalld.c
#
#fwknopd_utests_CPPFLAGS = -I ../../lib -I ../../common -I ../../server -DSYSCONFDIR=\"$(sysconfdir)\" -DSYSRUNDIR=\"$(localstatedir)\"
#
#fwknopd_utests_LDADD = $(top_builddir)/lib/libfko.la $(top_builddir)/common/libfko_util.a
#
#fwknopd_utests_LDFLAGS = -lcunit -lpcap
#
#fko_utests_SOURCES = fko_utests.c \
# ../../lib/base64.c \
# ../../lib/cipher_funcs.c \
# ../../lib/digest.c \
# ../../lib/fko_client_timeout.c \
# ../../lib/fko_digest.c \
# ../../lib/fko_encode.c \
# ../../lib/fko_decode.c \
# ../../lib/fko_encryption.c \
# ../../lib/fko_error.c \
# ../../lib/fko_funcs.c \
# ../../lib/fko_message.c \
# ../../lib/fko_nat_access.c \
# ../../lib/fko_rand_value.c \
# ../../lib/fko_server_auth.c \
# ../../lib/fko_timestamp.c \
# ../../lib/fko_hmac.c \
# ../../lib/hmac.c \
# ../../lib/fko_user.c \
# ../../lib/md5.c \
# ../../lib/rijndael.c \
# ../../lib/sha1.c \
# ../../lib/sha2.c \
# ../../lib/strlcpy.c \
# ../../lib/strlcat.c \
# ../../lib/fko_util.c \
# ../../lib/gpgme_funcs.c \
# ../../common/cunit_common.c
#
#fko_utests_CPPFLAGS = -I ../../lib -I ../../common $(GPGME_CFLAGS)
#
#fko_utests_LDFLAGS = -lcunit $(GPGME_LIBS)