From aad24c5ba61c7219bad009d849ad84e7f057813f Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sat, 18 Aug 2018 05:34:59 +0200 Subject: [PATCH] build: remove common.am Fold things into where they make sense. Signed-off-by: David Lamparter --- Makefile.am | 13 +++++---- common.am | 61 ------------------------------------------- doc/developer/cli.rst | 2 -- lib/subdir.am | 20 ++++++++++++++ qpb/subdir.am | 36 +++++++++++++++++++++++++ 5 files changed, 64 insertions(+), 68 deletions(-) delete mode 100644 common.am diff --git a/Makefile.am b/Makefile.am index 67c3540e11..fc1beaeeae 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,10 +1,15 @@ ## Process this file with automake to produce Makefile.in. AUTOMAKE_OPTIONS = subdir-objects 1.12 -include common.am +ACLOCAL_AMFLAGS = -I m4 -AM_CPPFLAGS += -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/lib \ - -I$(top_builddir) -I$(top_builddir)/include -I$(top_builddir)/lib +AM_CFLAGS = \ + @ASAN_FLAGS@ @TSAN_FLAGS@ @MSAN_FLAGS@ \ + $(WERROR) +AM_CPPFLAGS = \ + @ASAN_FLAGS@ @TSAN_FLAGS@ @MSAN_FLAGS@ \ + -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/lib \ + -I$(top_builddir) -I$(top_builddir)/include -I$(top_builddir)/lib DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" -DCONFDATE=$(CONFDATE) LIBCAP = @LIBCAP@ @@ -195,8 +200,6 @@ EXTRA_DIST += \ zebra/Makefile \ # end -ACLOCAL_AMFLAGS = -I m4 - noinst_HEADERS += defaults.h indent: diff --git a/common.am b/common.am deleted file mode 100644 index 9c0c547811..0000000000 --- a/common.am +++ /dev/null @@ -1,61 +0,0 @@ -# -# Automake fragment intended to be shared by Makefile.am files in the -# tree. When used, should be included at the very top of the file. -# -AM_CPPFLAGS = @ASAN_FLAGS@ @TSAN_FLAGS@ @MSAN_FLAGS@ -AM_CFLAGS = @ASAN_FLAGS@ @TSAN_FLAGS@ @MSAN_FLAGS@ $(WERROR) - -AM_V_CLIPPY = $(am__v_CLIPPY_$(V)) -am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY)) -am__v_CLIPPY_0 = @echo " CLIPPY " $@; -am__v_CLIPPY_1 = - -CLIPPY_DEPS = $(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py - -SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h -.c_clippy.c: - @{ test -x $(top_builddir)/$(HOSTTOOLS)lib/clippy || $(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/clippy; } - $(AM_V_CLIPPY) $(top_builddir)/$(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py -o $@ $< - -## automake's "ylwrap" is a great piece of GNU software... not. -.l.c: - $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $< -.y.c: - $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $< - - -if HAVE_PROTOBUF - -# Uncomment to use an non-system version of libprotobuf-c. -# -# Q_PROTOBUF_C_CLIENT_INCLUDES = -I$(top_srcdir)/third-party/protobuf-c/src -# Q_PROTOBUF_C_CLIENT_LDOPTS = $(top_builddir)/third-party/protobuf-c/src/libprotobuf-c.la - -Q_PROTOBUF_C_CLIENT_INCLUDES= -Q_PROTOBUF_C_CLIENT_LDOPTS=-lprotobuf-c - -Q_PROTOC=protoc -Q_PROTOC_C=protoc-c - -# Rules -.proto.pb.h: - $(Q_PROTOC) -I$(top_srcdir) --cpp_out=$(top_srcdir) $(top_srcdir)/$^ - -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. -# -Q_FRR_PB_CLIENT_LDOPTS = $(top_srcdir)/qpb/libfrr_pb.la $(Q_PROTOBUF_C_CLIENT_LDOPTS) - -Q_FPM_PB_CLIENT_LDOPTS = $(top_srcdir)/fpm/libfrrfpm_pb.la $(Q_FRR_PB_CLIENT_LDOPTS) - -endif # HAVE_PROTOBUF diff --git a/doc/developer/cli.rst b/doc/developer/cli.rst index 20391c47bc..c0716a5c93 100644 --- a/doc/developer/cli.rst +++ b/doc/developer/cli.rst @@ -450,8 +450,6 @@ is no ordering requirement) .. code-block:: make - include ../common.am - # ... # if linked into a LTLIBRARY (.la/.so): diff --git a/lib/subdir.am b/lib/subdir.am index d3bd441a80..ef0cefe7a5 100644 --- a/lib/subdir.am +++ b/lib/subdir.am @@ -253,6 +253,26 @@ lib_clippy_SOURCES = \ lib/vector.c \ # end +# (global) clippy rules for all directories + +AM_V_CLIPPY = $(am__v_CLIPPY_$(V)) +am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY)) +am__v_CLIPPY_0 = @echo " CLIPPY " $@; +am__v_CLIPPY_1 = + +CLIPPY_DEPS = $(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py + +SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h +.c_clippy.c: + @{ test -x $(top_builddir)/$(HOSTTOOLS)lib/clippy || \ + $(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/clippy; } + $(AM_V_CLIPPY) $(top_builddir)/$(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py -o $@ $< + +## automake's "ylwrap" is a great piece of GNU software... not. +.l.c: + $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $< +.y.c: + $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $< # # generated sources & extra foo diff --git a/qpb/subdir.am b/qpb/subdir.am index 3c006fd221..0ed50c01be 100644 --- a/qpb/subdir.am +++ b/qpb/subdir.am @@ -23,3 +23,39 @@ CLEANFILES += \ endif EXTRA_DIST += qpb/qpb.proto + +if HAVE_PROTOBUF + +# Uncomment to use an non-system version of libprotobuf-c. +# +# Q_PROTOBUF_C_CLIENT_INCLUDES = -I$(top_srcdir)/third-party/protobuf-c/src +# Q_PROTOBUF_C_CLIENT_LDOPTS = $(top_builddir)/third-party/protobuf-c/src/libprotobuf-c.la + +Q_PROTOBUF_C_CLIENT_INCLUDES= +Q_PROTOBUF_C_CLIENT_LDOPTS=-lprotobuf-c + +Q_PROTOC=protoc +Q_PROTOC_C=protoc-c + +# Rules +.proto.pb.h: + $(Q_PROTOC) -I$(top_srcdir) --cpp_out=$(top_srcdir) $(top_srcdir)/$^ + +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. +# +Q_FRR_PB_CLIENT_LDOPTS = $(top_srcdir)/qpb/libfrr_pb.la $(Q_PROTOBUF_C_CLIENT_LDOPTS) + +Q_FPM_PB_CLIENT_LDOPTS = $(top_srcdir)/fpm/libfrrfpm_pb.la $(Q_FRR_PB_CLIENT_LDOPTS) + +endif # HAVE_PROTOBUF -- 2.39.5