diff options
author | 2012-06-22 14:31:34 -0700 | |
---|---|---|
committer | 2012-07-03 00:38:40 -0400 | |
commit | b9cfa0a10decdbe659447a221a0634f2b78943b0 (patch) | |
tree | 47aa5b2a61934e7f85100e43515e6e889e436995 /Makefile.am | |
parent | sb_printf: expand feature set slightly and fix testing (diff) | |
download | sandbox-b9cfa0a10decdbe659447a221a0634f2b78943b0.tar.gz sandbox-b9cfa0a10decdbe659447a221a0634f2b78943b0.tar.bz2 sandbox-b9cfa0a10decdbe659447a221a0634f2b78943b0.zip |
precompile headers.h to speed up build slightly
Since all system headers are included by way of headers.h, we can
pre-compile this to speed up the build up a bit.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am index e326b23..475c8c0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,6 @@ ACLOCAL_AMFLAGS = -I m4 MAKEFLAGS = --no-print-directory +AM_CPPFLAGS = $(SANDBOX_DEFINES) SUBDIRS = \ scripts \ @@ -10,12 +11,35 @@ SUBDIRS = \ src \ tests -libsandbox: libsbutil -src: libsbutil -tests: src +SANDBOX_PCH = headers.h.gch libsandbox/headers.h.gch libsbutil/headers.h.gch +BUILT_SOURCES = $(SANDBOX_PCH) +noinst_LTLIBRARIES = libpch.la +nodist_libpch_la_SOURCES = $(SANDBOX_PCH) +GCH_CP = ( \ + src=`dirname $@`/.libs/`basename $@`.o; \ + test -e "$$src" || src=$@.o; \ + cp $$src $@ \ + ) +# This is built as PIC +$(builddir)/libsbutil/headers.h.gch: headers.h + $(AM_V_GEN)$(LTCOMPILE) -c -o $@.o $< && $(GCH_CP) +# This is built as PIC + exceptions +$(builddir)/libsandbox/headers.h.gch: headers.h + $(AM_V_GEN)$(LTCOMPILE) -c -o $@.o $< $(CFLAG_EXCEPTIONS) && $(GCH_CP) +# This is built w/out PIC +$(builddir)/headers.h.gch: headers.h + $(AM_V_GEN)$(COMPILE) -c -o $@.o $< && $(GCH_CP) + +libsbutil: libsbutil/headers.h.gch +libsandbox: libsbutil libsandbox/headers.h.gch +src: libsbutil headers.h.gch +tests: src headers.h.gch EXTRA_DIST = headers.h localdecls.h ChangeLog.0 +CLEANFILES = $(SANDBOX_PCH) +DISTCLEANFILES = $(CLEANFILES) + ChangeLog: touch ChangeLog |