summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2019-02-11 15:27:47 +0100
committerMaria Matejka <mq@ucw.cz>2019-02-20 22:30:54 +0100
commit75206f266f8534367b88401be463953b7d5dc770 (patch)
tree73457aa0cccbf0431728472ef1816de09ec74b78
parent4f082dfa892e95f86ca8137410992a248110b6ef (diff)
Conf: Fixed makefiles
-rw-r--r--Makefile.in3
-rw-r--r--client/Makefile1
-rw-r--r--client/cmds.Y (renamed from client/cmds.m4)0
-rw-r--r--conf/Makefile10
-rw-r--r--filter/Makefile2
5 files changed, 11 insertions, 5 deletions
diff --git a/Makefile.in b/Makefile.in
index 0ecd6811..695fa744 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -76,6 +76,8 @@ $(daemon): LIBS += $(DAEMON_LIBS)
# Include directories
dirs := client conf doc filter lib nest test $(addprefix proto/,$(protocols)) @sysdep_dirs@
+# conf/Makefile declarations needed for all other modules
+conf-lex-targets := $(addprefix $(objdir)/conf/,cf-lex.o)
conf-y-targets := $(addprefix $(objdir)/conf/,cf-parse.y keywords.h commands.h)
cf-local = $(conf-y-targets): $(s)config.Y
@@ -99,6 +101,7 @@ endef
clean = $(eval $(call clean_in,$(1)))
+# Include main Makefiles of the directories
include $(addsuffix /Makefile,$(addprefix $(srcdir)/,$(dirs)))
# Generic rules
diff --git a/client/Makefile b/client/Makefile
index fccb8346..c91a30e0 100644
--- a/client/Makefile
+++ b/client/Makefile
@@ -2,6 +2,7 @@ src := commands.c util.c client.c
obj := $(src-o-files)
$(all-client)
+$(conf-y-targets): $(s)cmds.Y
$(o)commands.o: $(objdir)/conf/commands.h
diff --git a/client/cmds.m4 b/client/cmds.Y
index 1cbb4f92..1cbb4f92 100644
--- a/client/cmds.m4
+++ b/client/cmds.Y
diff --git a/conf/Makefile b/conf/Makefile
index 39628bff..be823d40 100644
--- a/conf/Makefile
+++ b/conf/Makefile
@@ -10,12 +10,12 @@ BISON_DEBUG=-t
#FLEX_DEBUG=-d
endif
-$(conf-y-targets): $(s)confbase.Y $(s)flowspec.Y
- $(M4) $(M4FLAGS) -P $| $^ >$@
+$(o)cf-parse.y: $(s)gen_parser.m4
+$(o)keywords.h: $(s)gen_keywords.m4
+$(o)commands.h: $(s)gen_commands.m4
-$(o)cf-parse.y: | $(s)gen_parser.m4
-$(o)keywords.h: | $(s)gen_keywords.m4
-$(o)commands.h: | $(s)gen_commands.m4 $(srcdir)/client/cmds.m4
+$(conf-y-targets): $(s)confbase.Y $(s)flowspec.Y
+ $(M4) $(M4FLAGS) -P $(if $(word 2,$(filter %.m4,$^)),$(error "Too many M4 scripts for one target"),$(filter %.m4,$^)) $(filter %.Y,$^) >$@
$(o)cf-parse.tab.h: $(o)cf-parse.tab.c
diff --git a/filter/Makefile b/filter/Makefile
index f5f50045..18fd8137 100644
--- a/filter/Makefile
+++ b/filter/Makefile
@@ -3,6 +3,8 @@ obj := $(src-o-files)
$(all-daemon)
$(cf-local)
+$(conf-y-targets) $(conf-lex-targets): $(o)f-inst-decl.h
+
M4FLAGS_FILTERS=$(filter-out -s,$(M4FLAGS))
$(o)f-inst-postfixify.c: $(s)postfixify.m4 $(s)f-inst.c $(objdir)/.dir-stamp