]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Simplified the protocol hookup code in Makefiles
authorMaria Matejka <mq@ucw.cz>
Thu, 18 Aug 2022 16:32:33 +0000 (18:32 +0200)
committerMaria Matejka <mq@ucw.cz>
Thu, 18 Aug 2022 20:07:30 +0000 (22:07 +0200)
14 files changed:
Makefile.in
nest/Makefile
proto/babel/Makefile
proto/bfd/Makefile
proto/bgp/Makefile
proto/mrt/Makefile
proto/ospf/Makefile
proto/perf/Makefile
proto/pipe/Makefile
proto/radv/Makefile
proto/rip/Makefile
proto/rpki/Makefile
proto/static/Makefile
sysdep/unix/Makefile

index 0d55807b4bc995cd4c0a336d0feff62ed6850a1d..fa53487292fc16ab9d86d27b2c7fff1ba7e3276e 100644 (file)
@@ -26,6 +26,7 @@ INSTALL_DATA=@INSTALL_DATA@
 client=$(addprefix $(exedir)/,@CLIENT@)
 daemon=$(exedir)/bird
 protocols=@protocols@
+PROTO_BUILD := $(protocols) dev kif krt
 
 prefix=@prefix@
 exec_prefix=@exec_prefix@
@@ -82,9 +83,6 @@ 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
 
-# nest/Makefile declarations needed for all other modules
-proto-build-c := $(addprefix $(objdir)/nest/,proto-build.c)
-
 src-o-files = $(patsubst %.c,$(o)%.o,$(src))
 tests-target-files = $(patsubst %.c,$(o)%,$(tests_src))
 
@@ -98,13 +96,6 @@ else
   o = $(patsubst $(srcdir)%,$(objdir)%,$(s))
 endif
 
-define proto-build_in =
-PROTO_BUILD += $(1)
-$(proto-build-c): $(lastword $(MAKEFILE_LIST))
-endef
-
-proto-build = $(eval $(call proto-build_in,$(1)))
-
 define clean_in =
 clean::
        rm -f $(addprefix $(o),$(1))
index 7d451ba429144c3c971499699ad40ad874eecf03..a2e30ee2ca53138b525e5671ad89b3210b7f707b 100644 (file)
@@ -2,11 +2,10 @@ src := a-path.c a-set.c cli.c cmds.c iface.c locks.c neighbor.c password.c proto
 obj := $(src-o-files)
 $(all-daemon)
 $(cf-local)
-$(call proto-build,dev_build)
 
-$(proto-build-c): $(lastword $(MAKEFILE_LIST))
+$(objdir)/nest/proto-build.c: $(lastword $(MAKEFILE_LIST))
        $(E)echo GEN $@
-       $(Q)echo "$(patsubst %,void %(void); ,$(PROTO_BUILD)) void protos_build_gen(void) { $(patsubst %,  %(); ,$(PROTO_BUILD))}" > $@
+       $(Q)echo "$(patsubst %,void %_build(void); ,$(PROTO_BUILD)) void protos_build_gen(void) { $(patsubst %,  %_build(); ,$(PROTO_BUILD))}" > $@
 
 tests_src := a-set_test.c a-path_test.c
 tests_targets := $(tests_targets) $(tests-target-files)
index ae6aeaf24d27401843e2ca8f1cbc3473783312b8..06b58e95b9555d4e459f2456953c3b652e3ea2a0 100644 (file)
@@ -2,6 +2,5 @@ src := babel.c packets.c
 obj := $(src-o-files)
 $(all-daemon)
 $(cf-local)
-$(call proto-build,babel_build)
 
 tests_objs := $(tests_objs) $(src-o-files)
index dbdc0a098bc6c8e7975c7ea1e459329cd4e0b781..d9aecfa9f03ff51ffa260148914eac8f07cbf519 100644 (file)
@@ -2,6 +2,5 @@ src := bfd.c io.c packets.c
 obj := $(src-o-files)
 $(all-daemon)
 $(cf-local)
-$(call proto-build,bfd_build)
 
 tests_objs := $(tests_objs) $(src-o-files)
index 2a4cc99ca06116643f96800694d4831d0dccd009..f6a38678323576c646949a432d2be65ac9f1eabf 100644 (file)
@@ -2,6 +2,5 @@ src := attrs.c bgp.c packets.c
 obj := $(src-o-files)
 $(all-daemon)
 $(cf-local)
-$(call proto-build,bgp_build)
 
 tests_objs := $(tests_objs) $(src-o-files)
index 000e1c1c587aae7d8455b8a652f8e0066599ea19..8cd44ac18f0469092d7013f336320bdb86552f38 100644 (file)
@@ -2,6 +2,5 @@ src := mrt.c
 obj := $(src-o-files)
 $(all-daemon)
 $(cf-local)
-$(call proto-build,mrt_build)
 
 tests_objs := $(tests_objs) $(src-o-files)
index 85664543f96aa3d6126a6df3fc31bbcd9bc0a4b6..015f394a277a7763c11f3b9e15102d1adcb69760 100644 (file)
@@ -2,6 +2,5 @@ src := dbdes.c hello.c iface.c lsack.c lsalib.c lsreq.c lsupd.c neighbor.c ospf.
 obj := $(src-o-files)
 $(all-daemon)
 $(cf-local)
-$(call proto-build,ospf_build)
 
 tests_objs := $(tests_objs) $(src-o-files)
index 42051f439efaf45bffdb569ab492690a257c7cc2..7877fb193cf56fdae4c5ad57df5a566dd5dcd77a 100644 (file)
@@ -2,6 +2,5 @@ src := perf.c
 obj := $(src-o-files)
 $(all-daemon)
 $(cf-local)
-$(call proto-build,perf_build)
 
 tests_objs := $(tests_objs) $(src-o-files)
index ba66027f675cb6a86e0bbdef97708f8703c62269..0d68db4c48d3cea6e54ee13792af83699ae2a809 100644 (file)
@@ -2,6 +2,5 @@ src := pipe.c
 obj := $(src-o-files)
 $(all-daemon)
 $(cf-local)
-$(call proto-build,pipe_build)
 
 tests_objs := $(tests_objs) $(src-o-files)
index 4780bee3b931643ae714cf1f718c76228e9e8ed0..5c56fbf35b66b0bf3387f5c4f3f6743fe57fec7d 100644 (file)
@@ -2,6 +2,5 @@ src := packets.c radv.c
 obj := $(src-o-files)
 $(all-daemon)
 $(cf-local)
-$(call proto-build,radv_build)
 
 tests_objs := $(tests_objs) $(src-o-files)
index b9ff62d68283e4f96684ee3d94384423a0df43f2..f4a6fa7223f1093020598c4fde67ae08d5c77d56 100644 (file)
@@ -2,6 +2,5 @@ src := packets.c rip.c
 obj := $(src-o-files)
 $(all-daemon)
 $(cf-local)
-$(call proto-build,rip_build)
 
 tests_objs := $(tests_objs) $(src-o-files)
index 8e3a2761d8ede525ef78d23170fad021a4ecc8aa..0f60b2a09c00c420de126b2109e2c6fcd8e10708 100644 (file)
@@ -2,6 +2,5 @@ src := rpki.c packets.c tcp_transport.c ssh_transport.c transport.c
 obj := $(src-o-files)
 $(all-daemon)
 $(cf-local)
-$(call proto-build,rpki_build)
 
 tests_objs := $(tests_objs) $(src-o-files)
index 26aed31fe8b8e2cea2a10c1bd06766f4ba6c03aa..de6e819ba898c4acd715f36372834ab9e4f5f635 100644 (file)
@@ -2,6 +2,5 @@ src := static.c
 obj := $(src-o-files)
 $(all-daemon)
 $(cf-local)
-$(call proto-build,static_build)
 
 tests_objs := $(tests_objs) $(src-o-files)
index 51ab98a96efd3cb8ccd9ca2285e5a00f925c9d80..d0d36b5f7cdbe404c6a64a35220a3345ac504ab3 100644 (file)
@@ -2,8 +2,6 @@ src := alloc.c io.c krt.c log.c main.c random.c
 obj := $(src-o-files)
 $(all-daemon)
 $(cf-local)
-$(call proto-build,kif_build)
-$(call proto-build,krt_build)
 $(conf-y-targets): $(s)krt.Y
 
 src := $(filter-out main.c, $(src))