From 0f8b5fd5a05c1261061a94270218b701c1298719 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Fri, 28 Jul 2017 14:40:39 +0200 Subject: [PATCH] build: non-recursive qpb & fpm Signed-off-by: David Lamparter --- Makefile.am | 7 +++++-- common.am | 25 ++++++++++++------------- configure.ac | 3 +-- fpm/.gitignore | 2 +- fpm/Makefile | 10 ++++++++++ fpm/Makefile.am | 29 ----------------------------- fpm/subdir.am | 23 +++++++++++++++++++++++ qpb/.gitignore | 2 +- qpb/Makefile | 10 ++++++++++ qpb/Makefile.am | 30 ------------------------------ qpb/subdir.am | 26 ++++++++++++++++++++++++++ 11 files changed, 89 insertions(+), 78 deletions(-) create mode 100644 fpm/Makefile delete mode 100644 fpm/Makefile.am create mode 100644 fpm/subdir.am create mode 100644 qpb/Makefile delete mode 100644 qpb/Makefile.am create mode 100644 qpb/subdir.am diff --git a/Makefile.am b/Makefile.am index 415b80d516..53693ae4da 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,6 +10,7 @@ LIBCAP = @LIBCAP@ EXTRA_DIST = BUILT_SOURCES = +CLEANFILES = examplesdir = $(exampledir) @@ -25,14 +26,16 @@ dist_examples_DATA = include lib/subdir.am include zebra/subdir.am +include qpb/subdir.am +include fpm/subdir.am -SUBDIRS = . qpb fpm @LIBRFP@ @RFPTEST@ \ +SUBDIRS = . @LIBRFP@ @RFPTEST@ \ @BGPD@ @RIPD@ @RIPNGD@ @OSPFD@ @OSPF6D@ @LDPD@ \ @ISISD@ @PIMD@ @NHRPD@ @EIGRPD@ @BABELD@ \ @WATCHFRR@ @VTYSH@ @OSPFCLIENT@ @DOC@ m4 @pkgsrcdir@ \ redhat @SOLARIS@ tests tools snapcraft -DIST_SUBDIRS = . qpb fpm bgpd ripd ripngd ospfd ospf6d ldpd \ +DIST_SUBDIRS = . bgpd ripd ripngd ospfd ospf6d ldpd \ isisd watchfrr vtysh ospfclient doc m4 pkgsrc redhat tests \ solaris pimd nhrpd eigrpd bgpd/rfp-example/librfp \ bgpd/rfp-example/rfptest tools snapcraft babeld python \ diff --git a/common.am b/common.am index 67e54d17d5..e252b74297 100644 --- a/common.am +++ b/common.am @@ -8,7 +8,7 @@ am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY)) am__v_CLIPPY_0 = @echo " CLIPPY " $@; am__v_CLIPPY_1 = -SUFFIXES = _clippy.c +SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h .c_clippy.c: $(AM_V_at)$(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/clippy $(AM_V_CLIPPY)$(top_builddir)/$(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py $< > $@.tmp @@ -34,16 +34,19 @@ Q_PROTOBUF_C_CLIENT_LDOPTS=-lprotobuf-c Q_PROTOC=protoc Q_PROTOC_C=protoc-c -Q_PROTOBUF_CFILES = $(filter %.pb-c.c,$(SOURCES)) - -Q_PROTOBUF_SRCS = $(Q_PROTOBUF_CFILES) $(Q_PROTOBUF_HFILES) - # Rules -%.pb.h: %.proto - $(Q_PROTOC) $(PROTOBUF_INCLUDES) --cpp_out=$(top_srcdir) $(top_srcdir)/$(PROTOBUF_PACKAGE)/$^ +.proto.pb.h: + $(Q_PROTOC) -I$(top_srcdir) --cpp_out=$(top_srcdir) $(top_srcdir)/$^ -%.pb-c.c %.pb-c.h: %.proto - $(Q_PROTOC_C) $(PROTOBUF_INCLUDES) --c_out=$(top_srcdir) $(top_srcdir)/$(PROTOBUF_PACKAGE)/$^ +AM_V_PROTOC_C = $(am__v_PROTOC_C_$(V)) +am__v_PROTOC_C_ = $(am__v_PROTOC_C_$(AM_DEFAULT_VERBOSITY)) +am__v_PROTOC_C_0 = @echo " PROTOC_C" $@; +am__v_PROTOC_C_1 = + +.proto.pb-c.c: + $(AM_V_PROTOC_C)$(Q_PROTOC_C) -I$(top_srcdir) --c_out=$(top_srcdir) $(top_srcdir)/$^ +.pb-c.c.pb-c.h: + @/bin/true # # Information about how to link to various libraries. @@ -53,7 +56,3 @@ Q_FRR_PB_CLIENT_LDOPTS = $(top_srcdir)/qpb/libfrr_pb.la $(Q_PROTOBUF_C_CLIENT_LD Q_FPM_PB_CLIENT_LDOPTS = $(top_srcdir)/fpm/libfrrfpm_pb.la $(Q_FRR_PB_CLIENT_LDOPTS) endif # HAVE_PROTOBUF - -Q_CLEANFILES = $(Q_PROTOBUF_SRCS) - -Q_BUILT_SRCS = $(Q_PROTOBUF_SRCS) diff --git a/configure.ac b/configure.ac index b22361d40b..1ba501ee40 100755 --- a/configure.ac +++ b/configure.ac @@ -1820,7 +1820,7 @@ AC_CACHE_VAL(ac_cv_htonl_works, ) AC_MSG_RESULT($ac_cv_htonl_works) -AC_CONFIG_FILES([Makefile qpb/Makefile ripd/Makefile +AC_CONFIG_FILES([Makefile ripd/Makefile ripngd/Makefile bgpd/Makefile ospfd/Makefile watchfrr/Makefile ospf6d/Makefile ldpd/Makefile isisd/Makefile vtysh/Makefile doc/Makefile ospfclient/Makefile tests/Makefile m4/Makefile @@ -1833,7 +1833,6 @@ AC_CONFIG_FILES([Makefile qpb/Makefile ripd/Makefile tools/Makefile pkgsrc/Makefile python/Makefile - fpm/Makefile redhat/frr.spec snapcraft/Makefile snapcraft/snapcraft.yaml diff --git a/fpm/.gitignore b/fpm/.gitignore index b133c52a42..17e90443e9 100644 --- a/fpm/.gitignore +++ b/fpm/.gitignore @@ -1,4 +1,4 @@ -Makefile +!Makefile Makefile.in *.o tags diff --git a/fpm/Makefile b/fpm/Makefile new file mode 100644 index 0000000000..1d280d176e --- /dev/null +++ b/fpm/Makefile @@ -0,0 +1,10 @@ +all: ALWAYS + @$(MAKE) -s -C .. fpm/libfrrfpm_pb.la +%: ALWAYS + @$(MAKE) -s -C .. fpm/$@ + +Makefile: + #nothing +ALWAYS: +.PHONY: ALWAYS makefiles +.SUFFIXES: diff --git a/fpm/Makefile.am b/fpm/Makefile.am deleted file mode 100644 index 1f46ac6db2..0000000000 --- a/fpm/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ -include ../common.am - -AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib $(Q_PROTOBUF_C_CLIENT_INCLUDES) - -PROTOBUF_INCLUDES=-I$(top_srcdir) -PROTOBUF_PACKAGE = fpm - -lib_LTLIBRARIES = libfrrfpm_pb.la -libfrrfpm_pb_la_LDFLAGS = -version-info 0:0:0 - -if HAVE_PROTOBUF -protobuf_srcs = - -protobuf_srcs_nodist = \ - fpm.pb-c.c -endif - -libfrrfpm_pb_la_SOURCES = \ - fpm.h \ - fpm_pb.h \ - fpm_pb.c \ - $(protobuf_srcs) - -nodist_libfrrfpm_pb_la_SOURCES = $(protobuf_srcs_nodist) - -CLEANFILES = $(Q_CLEANFILES) - -BUILT_SOURCES = $(Q_PROTOBUF_SRCS) -EXTRA_DIST = fpm.proto diff --git a/fpm/subdir.am b/fpm/subdir.am new file mode 100644 index 0000000000..f81a84222c --- /dev/null +++ b/fpm/subdir.am @@ -0,0 +1,23 @@ +if FPM +lib_LTLIBRARIES += fpm/libfrrfpm_pb.la +endif + +fpm_libfrrfpm_pb_la_LDFLAGS = -version-info 0:0:0 +fpm_libfrrfpm_pb_la_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir) -I$(top_builddir)/lib \ + $(Q_PROTOBUF_C_CLIENT_INCLUDES) +fpm_libfrrfpm_pb_la_SOURCES = \ + fpm/fpm.h \ + fpm/fpm_pb.h \ + fpm/fpm_pb.c \ + # end + +if HAVE_PROTOBUF +nodist_fpm_libfrrfpm_pb_la_SOURCES = fpm/fpm.pb-c.c +BUILT_SOURCES += fpm/fpm.pb-c.c +CLEANFILES += \ + fpm/fpm.pb-c.c \ + fpm/fpm.pb-c.h \ + # end +endif + +EXTRA_DIST += fpm/fpm.proto diff --git a/qpb/.gitignore b/qpb/.gitignore index b133c52a42..17e90443e9 100644 --- a/qpb/.gitignore +++ b/qpb/.gitignore @@ -1,4 +1,4 @@ -Makefile +!Makefile Makefile.in *.o tags diff --git a/qpb/Makefile b/qpb/Makefile new file mode 100644 index 0000000000..2237def02c --- /dev/null +++ b/qpb/Makefile @@ -0,0 +1,10 @@ +all: ALWAYS + @$(MAKE) -s -C .. fpm/libfrr_pb.la +%: ALWAYS + @$(MAKE) -s -C .. fpm/$@ + +Makefile: + #nothing +ALWAYS: +.PHONY: ALWAYS makefiles +.SUFFIXES: diff --git a/qpb/Makefile.am b/qpb/Makefile.am deleted file mode 100644 index e5951b2be9..0000000000 --- a/qpb/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -include ../common.am - -AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib $(Q_PROTOBUF_C_CLIENT_INCLUDES) - -PROTOBUF_INCLUDES=-I$(top_srcdir) -PROTOBUF_PACKAGE = qpb - -lib_LTLIBRARIES = libfrr_pb.la -libfrr_pb_la_LDFLAGS = -version-info 0:0:0 - -if HAVE_PROTOBUF -protobuf_srcs = \ - qpb_allocator.c - -protobuf_srcs_nodist = \ - qpb.pb-c.c -endif - -libfrr_pb_la_SOURCES = \ - linear_allocator.h \ - qpb.h \ - qpb.c \ - qpb_allocator.h \ - $(protobuf_srcs) - -nodist_libfrr_pb_la_SOURCES = $(protobuf_srcs_nodist) - -CLEANFILES = $(Q_CLEANFILES) -BUILT_SOURCES = $(Q_PROTOBUF_SRCS) -EXTRA_DIST = qpb.proto diff --git a/qpb/subdir.am b/qpb/subdir.am new file mode 100644 index 0000000000..71e501b9c2 --- /dev/null +++ b/qpb/subdir.am @@ -0,0 +1,26 @@ +if HAVE_PROTOBUF +lib_LTLIBRARIES += qpb/libfrr_pb.la +endif + +qpb_libfrr_pb_la_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir) -I$(top_builddir)/lib \ + $(Q_PROTOBUF_C_CLIENT_INCLUDES) +qpb_libfrr_pb_la_LDFLAGS = -version-info 0:0:0 + +qpb_libfrr_pb_la_SOURCES = \ + qpb/linear_allocator.h \ + qpb/qpb.h \ + qpb/qpb.c \ + qpb/qpb_allocator.h \ + # end + +if HAVE_PROTOBUF +qpb_libfrr_pb_la_SOURCES += qpb/qpb_allocator.c +nodist_qpb_libfrr_pb_la_SOURCES = qpb/qpb.pb-c.c +BUILT_SOURCES += qpb/qpb.pb-c.c +CLEANFILES += \ + qpb/qpb.pb-c.c \ + qpb/qpb.pb-c.h \ + # end +endif + +EXTRA_DIST += qpb/qpb.proto