]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Conf: Fixed makefiles
authorMaria Matejka <mq@ucw.cz>
Mon, 11 Feb 2019 14:27:47 +0000 (15:27 +0100)
committerMaria Matejka <mq@ucw.cz>
Wed, 20 Feb 2019 21:30:54 +0000 (22:30 +0100)
Makefile.in
client/Makefile
client/cmds.Y [moved from client/cmds.m4 with 100% similarity]
conf/Makefile
filter/Makefile

index 0ecd68114db680d863459d5e698c8e4e6cd1c2b9..695fa74401aa33898fd19549c8d592cfa2615508 100644 (file)
@@ -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
index fccb83463a18fdaa0cf77d5dbeb65dbe0315c906..c91a30e0d3eaaef062db418d5ff320105a3ea35c 100644 (file)
@@ -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
 
similarity index 100%
rename from client/cmds.m4
rename to client/cmds.Y
index 39628bffb76b08257a4dd87c3d119d4676666353..be823d40b6a73d4d21de4f801605f52d9b31c771 100644 (file)
@@ -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
 
index f5f5004510012a345ff3c53192c5b4eb73ce76cc..18fd813733013a0fe0e12aee19450b82a7e3e0d0 100644 (file)
@@ -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