diff options
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 |