]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Copied common Makefile.am stuff seen in a few Makefile.ams to a single
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 19 Feb 2009 07:14:08 +0000 (00:14 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Thu, 19 Feb 2009 07:14:08 +0000 (00:14 -0700)
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".

src/common.am [new file with mode: 0644]

diff --git a/src/common.am b/src/common.am
new file mode 100644 (file)
index 0000000..ec38e34
--- /dev/null
@@ -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