From: Alex Rousskov Date: Thu, 19 Feb 2009 07:14:08 +0000 (-0700) Subject: Copied common Makefile.am stuff seen in a few Makefile.ams to a single X-Git-Tag: SQUID_3_2_0_1~1183^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4fcc4dab4c73ebeb735db2b4dac3f4e04f8310ab;p=thirdparty%2Fsquid.git Copied common Makefile.am stuff seen in a few Makefile.ams to a single Makefile "header". This avoids evil code duplication. This file should be included by most Makefile.ams inside src/. Needs more work as some of the copied code is questionable and more code can probably be extracted here. See XXXs. TODO: The .h dependency test script part seems pretty universal, but if many subdirs need to customize it, we may want to put it into a separate Makefile "header". --- diff --git a/src/common.am b/src/common.am new file mode 100644 index 0000000000..ec38e346e9 --- /dev/null +++ b/src/common.am @@ -0,0 +1,37 @@ +# Settings common to many Squid Makefiles + +# This file should be included first in all src/subdir/Makefile.am +# so it must not contain stuff specific to or bad for some subdirectories. + +# TODO: make this set by configure? +AM_CFLAGS = @SQUID_CFLAGS@ +AM_CXXFLAGS = @SQUID_CXXFLAGS@ +DEFS = @DEFS@ + +# so that others can always use += for this variable +CLEANFILES = + +INCLUDES = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src \ + -I$(top_builddir)/lib \ + @SQUID_CPPUNIT_INC@ + +# make all compiled sources depend on generated files +# XXX: Do we really need this? Does auto-dependency tracking work? +# XXX: And should not autoconf be in $(top_builddir)? +$(OBJS): $(top_srcdir)/include/version.h $(top_srcdir)/include/autoconf.h + +check_PROGRAMS = testHeaders +TESTS = $(check_PROGRAMS) + +## Special Universal .h dependency test script +## aborts build process on errors +testHeaders: $(srcdir)/*.h + $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" "$(srcdir)/" || exit 1 + +## No such file... +testHeaders.c: + touch testHeaders.c +CLEANFILES += testHeaders.c