From ae55f524c92aadfae2a94947002c978d80320f32 Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Tue, 30 Jul 2013 14:15:58 +0200 Subject: build: reduce Extra contents to bare minimum Improve the build system, so that configuration files are installed per tool basis. Also, introduce post_install targets, so that config files can be altered in some way, e.g. done by trafgen. Moreover, move custom targets from Extra to tool-specific Makefiles. Signed-off-by: Daniel Borkmann --- Extra | 16 ---------------- Makefile | 2 -- Template | 4 +++- astraceroute/Makefile | 2 ++ bpfc/Makefile | 5 +++++ curvetun/Makefile | 2 ++ flowtop/Makefile | 4 ++++ ifpps/Makefile | 2 ++ mausezahn/Makefile | 2 ++ netsniff-ng/Makefile | 6 ++++++ trafgen/Makefile | 8 ++++++++ 11 files changed, 34 insertions(+), 19 deletions(-) diff --git a/Extra b/Extra index 27a3c55..12d4a2a 100644 --- a/Extra +++ b/Extra @@ -2,19 +2,3 @@ curvetun: LDFLAGS += -L ${CONFIG_NACL_LIB_DIR} mausezahn: CFLAGS = $(mausezahn-eflags) - -bpfc_clean_custom: - $(Q)$(call RM,$(BUILD_DIR)/*.h $(BUILD_DIR)/*.c) - -trafgen_clean_custom: - $(Q)$(call RM,$(BUILD_DIR)/*.h $(BUILD_DIR)/*.c) - -netsniff-ng_install_custom flowtop_install_custom: - $(Q)$(foreach file,$(NCONF_FILES),$(call INST,$(file),$(ETCDIRE));) - -trafgen_install_custom: - $(Q)$(call INST,trafgen_stddef.h,$(ETCDIRE)) - $(Q)mv $(ETCDIRE)/trafgen_stddef.h $(ETCDIRE)/stddef.h - -astraceroute_install_custom: - $(Q)$(call INST,geoip.conf,$(ETCDIRE)) diff --git a/Makefile b/Makefile index 4dda0f8..1c322dd 100644 --- a/Makefile +++ b/Makefile @@ -131,8 +131,6 @@ clean_showinfo: .DEFAULT: .FORCE: -NCONF_FILES = ether.conf tcp.conf udp.conf oui.conf geoip.conf - all: build_showinfo toolkit allbutcurvetun: $(filter-out curvetun,$(TOOLS)) allbutmausezahn: $(filter-out mausezahn,$(TOOLS)) diff --git a/Template b/Template index d3b4ecc..715d2f1 100644 --- a/Template +++ b/Template @@ -7,10 +7,12 @@ define TOOL_templ $(1): $(1)_prehook $$($(1)-lex) $$($(1)-yaac) $$(patsubst %.o,$(1)/%.o,$$($(1)-objs)) $(1)_clean: $(1)_clean_custom $(Q)$$(call RM,$(1)/*.o $(1)/$(1) $(1)/*.gz) - $(1)_install: $(1)_install_custom + $(1)_do_install: $(Q)$$(call INSTX,$(1)/$(1),$$(SBINDIR)) $(Q)$(GZIP) $(1).8 > $(1)/$(1).8.gz $(Q)$$(call INSTX,$(1)/$(1).8.gz,$$(MAN8DIR)) + $(Q)$$(foreach file,$$($(1)-confs),$$(call INST,$$(file),$$(ETCDIRE));) + $(1)_install: $(1)_do_install $(1)_post_install $(1)_uninstall: $(1)_uninstall_custom $(Q)$$(call RM,$$(SBINDIR)/$(1)) $(Q)$$(call RM,$$(MAN8DIR)/$(1).8.gz) diff --git a/astraceroute/Makefile b/astraceroute/Makefile index 8c5e7fe..5574168 100644 --- a/astraceroute/Makefile +++ b/astraceroute/Makefile @@ -18,3 +18,5 @@ astraceroute-objs = xmalloc.o \ astraceroute.o astraceroute-eflags = + +astraceroute-confs = geoip.conf diff --git a/bpfc/Makefile b/bpfc/Makefile index 483980d..5c8b8c9 100644 --- a/bpfc/Makefile +++ b/bpfc/Makefile @@ -12,3 +12,8 @@ bpfc-lex = bpf_lexer.yy.o bpfc-yaac = bpf_parser.tab.o bpfc-eflags = -I.. + +bpfc-confs = + +bpfc_clean_custom: + $(Q)$(call RM,$(BUILD_DIR)/*.h $(BUILD_DIR)/*.c) diff --git a/curvetun/Makefile b/curvetun/Makefile index 93806b2..6d996b0 100644 --- a/curvetun/Makefile +++ b/curvetun/Makefile @@ -29,3 +29,5 @@ curvetun-objs = xmalloc.o \ curvetun.o curvetun-eflags = -I ${CONFIG_NACL_INC_DIR} + +curvetun-confs = diff --git a/flowtop/Makefile b/flowtop/Makefile index fa41dff..32fb4bd 100644 --- a/flowtop/Makefile +++ b/flowtop/Makefile @@ -24,3 +24,7 @@ flowtop-objs = xmalloc.o \ flowtop.o flowtop-eflags = $(shell pkg-config --cflags ncurses) + +flowtop-confs = tcp.conf \ + udp.conf \ + geoip.conf diff --git a/ifpps/Makefile b/ifpps/Makefile index 5d394bc..b7ef918 100644 --- a/ifpps/Makefile +++ b/ifpps/Makefile @@ -12,3 +12,5 @@ ifpps-objs = xmalloc.o \ ifpps.o ifpps-eflags = $(shell pkg-config --cflags ncurses) + +ifpps-confs = diff --git a/mausezahn/Makefile b/mausezahn/Makefile index 0f97c34..5aa46f5 100644 --- a/mausezahn/Makefile +++ b/mausezahn/Makefile @@ -69,3 +69,5 @@ mausezahn-eflags = -O2 -I. -I.. \ -DVERSION_STRING=\"$(VERSION_STRING)\" \ -DPREFIX_STRING=\"$(PREFIX)\" \ -DVERSION_LONG=\"$(VERSION_LONG)\" + +mausezahn-confs = diff --git a/netsniff-ng/Makefile b/netsniff-ng/Makefile index 790c7c4..8811328 100644 --- a/netsniff-ng/Makefile +++ b/netsniff-ng/Makefile @@ -76,3 +76,9 @@ endif netsniff-ng-eflags = $(shell pkg-config --cflags libnl-3.0) \ $(shell pkg-config --cflags libnl-genl-3.0) \ -DHAVE_DISSECTOR_PROTOS -DNEED_TCPDUMP_LIKE_FILTER + +netsniff-ng-confs = ether.conf \ + tcp.conf \ + udp.conf \ + oui.conf \ + geoip.conf diff --git a/trafgen/Makefile b/trafgen/Makefile index a7bf6c4..8868214 100644 --- a/trafgen/Makefile +++ b/trafgen/Makefile @@ -27,3 +27,11 @@ trafgen-yaac = trafgen_parser.tab.o trafgen-eflags = $(shell pkg-config --cflags libnl-3.0) \ $(shell pkg-config --cflags libnl-genl-3.0) \ -DHAVE_DISSECTOR_PROTOS -I.. + +trafgen-confs = trafgen_stddef.h + +trafgen_post_install: + $(Q)mv $(ETCDIRE)/trafgen_stddef.h $(ETCDIRE)/stddef.h + +trafgen_clean_custom: + $(Q)$(call RM,$(BUILD_DIR)/*.h $(BUILD_DIR)/*.c) -- cgit v1.2.3-54-g00ecf