From: <sg...@us...> - 2003-11-20 12:51:44
|
Update of /cvsroot/libfunutil/libfunutil/toc/make In directory sc8-pr-cvs1:/tmp/cvs-serv449 Modified Files: PCH.make Log Message: doh. had wrong naming convention for pch files. RTFM, man. Index: PCH.make =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc/make/PCH.make,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- PCH.make 20 Nov 2003 12:32:10 -0000 1.1 +++ PCH.make 20 Nov 2003 12:51:02 -0000 1.2 @@ -1,23 +1,25 @@ #!/do/not/make ############################################################ -# EXPERIMENTAL .pch support (20.11.2003) +# EXPERIMENTAL .gch support (20.11.2003) # # Clients must define: # # PRECOMPILED_HEADERS_CXX = list of C++ headers # PRECOMPILED_HEADERS_C = list of C headers # -# Running the PCH target will create *.pch for each *.h +# Running the PCH target will create *.gch for each *.h + +PCH_SUFFIX ?= .gch COMPILE_COMMAND_CXX_PCH = $(CXX) $(CXXFLAGS) \ - $(CPPFLAGS) -xc++ $(TARGET_ARCH) -c -o $(1) $(patsubst %.pch,%.h,$(1)) + $(CPPFLAGS) -xc++ $(TARGET_ARCH) -c -o $(1) $(patsubst %$(PCH_SUFFIX),%,$(1)) COMPILE_COMMAND_C_PCH = $(CC) $(CFLAGS) \ - $(CPPFLAGS) -xc $(TARGET_ARCH) -c -o $(1) $(patsubst %.pch,%.h,$(1)) + $(CPPFLAGS) -xc $(TARGET_ARCH) -c -o $(1) $(patsubst %$(PCH_SUFFIX),%,$(1)) -%.pch: %.h -PCH_CXX = $(patsubst %.h,%.pch,$(PRECOMPILED_HEADERS_CXX)) +PCH_CXX = $(addsuffix $(PCH_SUFFIX),$(PRECOMPILED_HEADERS_CXX)) + $(PCH_CXX): ifeq (1,$(configure_build_quietly)) @echo "Precompiling $@..."; \ @@ -26,7 +28,7 @@ $(call COMPILE_COMMAND_CXX_PCH,$@) endif -PCH_C = $(patsubst %.h,%.pch,$(PRECOMPILED_HEADERS_C)) +PCH_C = $(patsubst %.h,%$(PCH_SUFFIX),$(PRECOMPILED_HEADERS_C)) $(PCH_C): ifeq (1,$(configure_build_quietly)) @echo "Precompiling $<..."; \ @@ -35,5 +37,15 @@ $(call COMPILE_COMMAND_C_PCH,$@) endif +PCH_MAKEFILE = $(toc_makesdir)/PCH.make +PCH_RULES = .toc.PCH.make +$(PCH_RULES): $(PCH_MAKEFILE) Makefile + @echo "Creating precomiled headers rules ($@)..." + @echo '' > $@ + @for x in $(PCH_C) $(PCH_CXX); do \ + foo=$$x; foo=$${foo%%$(PCH_SUFFIX)}; \ + echo "$$x: $$foo" >> $@; \ + done + CLEAN_FILES += $(PCH_CXX) $(PCH_C) -PCH: $(PCH_CXX) $(PCH_C) +PCH: $(PCH_RULES) $(PCH_CXX) $(PCH_C) |