]> err.no Git - sope/commitdiff
more work on PCH
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Fri, 26 Aug 2005 16:32:04 +0000 (16:32 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Fri, 26 Aug 2005 16:32:04 +0000 (16:32 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1083 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

12 files changed:
gnustep-make/ChangeLog
gnustep-make/GNUmakefile.in
gnustep-make/Instance/Shared/headers.make
gnustep-make/Instance/Shared/pch.make [new file with mode: 0644]
gnustep-make/Instance/bundle.make
gnustep-make/Instance/library.make
gnustep-make/Instance/subproject.make
gnustep-make/Instance/tool.make
gnustep-make/Master/bundle.make
gnustep-make/Master/subproject.make
gnustep-make/Master/tool.make
gnustep-make/rules.make

index 080662698c8c382e01179abb3ff4c4b25a368458..5f350c14bd4f3ec03eb88bdc16f2ead0c2a7d435 100644 (file)
@@ -1,3 +1,15 @@
+2005-08-26  Helge Hess  <helge.hess@opengroupware.org>
+
+       * Master/*.make: delete derived sources directory during clean in
+         relevant project files
+
+       * Instance/*.make: include pch.make in relevant project files
+
+       * GNUmakefile.in: properly install pch.make
+
+       * Instance/Shared/headers.make: moved PCH stuff to an own Shared file
+         (pch.make)
+
 2005-08-26  Helge Hess  <helge.hess@skyrix.com>
 
        * configure.ac/config.make.in: enable PRECOMPILED_HEADERS if gcc
index 211351a334365b4202fd4131b95e67de38034925..d75305a1519a3eb07612e8904b4d62db881cbde9 100644 (file)
@@ -98,7 +98,7 @@ INSTANCE_MAKE_FILES = \
         test-library.make test-tool.make tool.make
 
 INSTANCE_SHARED_MAKE_FILES = bundle.make headers.make java.make \
-                             stamp-string.make strings.make
+                             stamp-string.make strings.make pch.make
 
 INSTANCE_DOC_MAKE_FILES = autogsdoc.make gsdoc.make install_files.make \
                           javadoc.make latex.make texi.make
index d5b32dc219992d64d1a3a73a41add2392711f41e..aee8f05c35fd6ddd0538d8531d0687fa974c4f0f 100644 (file)
@@ -78,47 +78,6 @@ shared-instance-headers-all:
 
 else # we have some HEADER_FILES
 
-
-#
-# PCH file
-#
-
-ifeq ($(PRECOMPILED_HEADERS),yes)
-ifneq ($($(GNUSTEP_INSTANCE)_PCH_FILE),)
-# has PCH support and PCH file
-
-$(GNUSTEP_INSTANCE)_GCH_FILE=$(patsubst %.h,%$(GCH_SUFFIX),$($(GNUSTEP_INSTANCE)_PCH_FILE))
-
-$(DERIVED_SOURCES_DIR)/$($(GNUSTEP_INSTANCE)_GCH_FILE) :: \
-       $(addprefix $(HEADER_FILES_DIR)/,$(HEADER_FILES))
-
-PCH_INCLUDE_FLAG=-include $(DERIVED_SOURCES_DIR)/$($(GNUSTEP_INSTANCE)_PCH_FILE)
-
-shared-instance-headers-all: \
-       $(DERIVED_SOURCES_DIR)/$($(GNUSTEP_INSTANCE)_GCH_FILE)
-
-shared-instance-headers-clean:
-       $(RM) $(DERIVED_SOURCES_DIR)/$($(GNUSTEP_INSTANCE)_GCH_FILE)
-
-else # no PCH file defined
-
-shared-instance-headers-all:
-       @(echo "no PCH file: $(GNUSTEP_INSTANCE)_PCH_FILE" )
-
-shared-instance-headers-clean:
-
-endif
-
-else # no PCH in compiler
-
-shared-instance-headers-all:
-       @(echo "no PCH support in compiler .." )
-
-shared-instance-headers-clean:
-
-endif # no PCH in compiler
-
-
 #
 # We provide two different algorithms of installing headers.
 #
diff --git a/gnustep-make/Instance/Shared/pch.make b/gnustep-make/Instance/Shared/pch.make
new file mode 100644 (file)
index 0000000..ba37529
--- /dev/null
@@ -0,0 +1,74 @@
+#
+#   Shared/headers.make
+#
+#   Makefile fragment with rules to install header files
+#
+#   Copyright (C) 2002 Free Software Foundation, Inc.
+#
+#   Author:  Nicola Pero <nicola@brainstorm.co.uk> 
+#
+#   This file is part of the GNUstep Makefile Package.
+#
+#   This library is free software; you can redistribute it and/or
+#   modify it under the terms of the GNU General Public License
+#   as published by the Free Software Foundation; either version 2
+#   of the License, or (at your option) any later version.
+#   
+#   You should have received a copy of the GNU General Public
+#   License along with this library; see the file COPYING.LIB.
+#   If not, write to the Free Software Foundation,
+#   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+#
+# input variables:
+#
+#  TODO: document
+#
+
+#
+# public targets:
+# 
+#  shared-instance-pch-all
+#  shared-instance-pch-clean
+#
+
+ifeq ($(PRECOMPILED_HEADERS),yes)
+
+ifneq ($($(GNUSTEP_INSTANCE)_PCH_FILE),)
+
+# has PCH support and PCH file
+
+# we need to use notdir() because sometimes subprojects refer to a header
+# in the directory above (eg: MySubproject_PCH_FILE=../common.h)
+# BUT: if I add 'notdir()' the .h=>.gch in rules.make doesn't work anymore?
+$(GNUSTEP_INSTANCE)_GCH_FILE=\
+  $(patsubst %.h,%$(GCH_SUFFIX),$($(GNUSTEP_INSTANCE)_PCH_FILE))
+
+ifneq ($($(GNUSTEP_INSTANCE)_PCH_AUTOINCLUDE),no)
+PCH_INCLUDE_FLAG=\
+  -include $(DERIVED_SOURCES_DIR)/$(notdir $($(GNUSTEP_INSTANCE)_PCH_FILE))
+endif
+
+shared-instance-pch-all: \
+       $(DERIVED_SOURCES_DIR)/$($(GNUSTEP_INSTANCE)_GCH_FILE)
+
+shared-instance-pch-clean:
+       $(RM) $(DERIVED_SOURCES_DIR)/$($(GNUSTEP_INSTANCE)_GCH_FILE)
+
+else # no PCH file defined
+
+shared-instance-pch-all:
+       @(echo "No PCH file declared: $(GNUSTEP_INSTANCE)_PCH_FILE" )
+
+shared-instance-pch-clean:
+
+endif
+
+else # no PCH in compiler
+
+shared-instance-pch-all:
+       @(echo "No PCH support in compiler." )
+
+shared-instance-pch-clean:
+
+endif # no PCH in compiler
index 766e3bd5c45ff1c3e053650884275148a0564de8..4b0b3e3585460fd8fb4646e874008fdb28d530ac 100644 (file)
@@ -26,6 +26,7 @@ include $(GNUSTEP_MAKEFILES)/rules.make
 endif
 
 include $(GNUSTEP_MAKEFILES)/Instance/Shared/headers.make
+include $(GNUSTEP_MAKEFILES)/Instance/Shared/pch.make
 
 # The name of the bundle is in the BUNDLE_NAME variable.
 # The list of bundle resource file are in xxx_RESOURCE_FILES
@@ -104,7 +105,9 @@ endif # OBJ_FILES_TO_LINK
 # apple.
 #
 
-internal-bundle-all_:: $(GNUSTEP_OBJ_DIR) build-bundle
+internal-bundle-all_:: $(GNUSTEP_OBJ_DIR) \
+                      shared-instance-pch-all \
+                      build-bundle
 
 BUNDLE_DIR_NAME = $(GNUSTEP_INSTANCE:=$(BUNDLE_EXTENSION))
 BUNDLE_DIR = $(GNUSTEP_BUILD_DIR)/$(BUNDLE_DIR_NAME)
index 194e0054f785aeef827997fccd94c31edde599cf..e26d7a2b10adb7151e157026d0404942badd6802 100644 (file)
@@ -26,6 +26,7 @@ include $(GNUSTEP_MAKEFILES)/rules.make
 endif
 
 include $(GNUSTEP_MAKEFILES)/Instance/Shared/headers.make
+include $(GNUSTEP_MAKEFILES)/Instance/Shared/pch.make
 
 #
 # The name of the library (including the 'lib' prefix) is 
@@ -306,7 +307,7 @@ $(GNUSTEP_OBJ_DIR)/$(DLL_NAME): $(OBJ_FILES_TO_LINK) \
 else # following code for anything but OLD_DLL_SUPPORT
 
 internal-library-all_:: $(GNUSTEP_OBJ_DIR) \
-                       shared-instance-headers-all \
+                       shared-instance-pch-all \
                         $(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_FILE)
 
 $(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_FILE): $(OBJ_FILES_TO_LINK)
index 0e8abc663ffc88d9d8cf9fbaaa6eb2e0f9c31fa8..b249333c76a6547e57a0cf58842fdc429f9ab6c9 100644 (file)
@@ -32,6 +32,7 @@ endif
 # Compilation targets
 #
 internal-subproject-all_:: $(GNUSTEP_OBJ_DIR) \
+                          shared-instance-pch-all \
                            $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT)
 
 ifeq ($(BUILD_DLL),yes)
@@ -105,6 +106,7 @@ else
 #
 
 include $(GNUSTEP_MAKEFILES)/Instance/Shared/headers.make
+include $(GNUSTEP_MAKEFILES)/Instance/Shared/pch.make
 
 internal-subproject-install_:: shared-instance-headers-install
 
index 622fa65162b566b0627b8f2df6a6f8ab1edc15ff..bd9cd4c4378d310896316a702f46d887b20e86d6 100644 (file)
@@ -30,6 +30,8 @@ ifeq ($(RULES_MAKE_LOADED),)
 include $(GNUSTEP_MAKEFILES)/rules.make
 endif
 
+include $(GNUSTEP_MAKEFILES)/Instance/Shared/pch.make
+
 .PHONY: internal-tool-all_       \
         internal-tool-install_   \
         internal-tool-uninstall_ \
@@ -69,6 +71,7 @@ ALL_TOOL_LIBS =                                                               \
 # Compilation targets
 #
 internal-tool-all_:: $(GNUSTEP_OBJ_DIR) \
+                    shared-instance-pch-all \
                      $(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT)
 
 $(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT): $(OBJ_FILES_TO_LINK)
index d75bb2f5f09fc5e8e1910f33f2819c1decbf515d..4375a8088cb886273c13d5988fd8a90efc7b71bc 100644 (file)
@@ -40,6 +40,7 @@ internal-clean::
        (cd $(GNUSTEP_BUILD_DIR); \
        rm -rf $(GNUSTEP_OBJ_DIR_NAME) $(_PSWRAP_C_FILES) $(_PSWRAP_H_FILES) \
               $(addsuffix $(BUNDLE_EXTENSION),$(BUNDLE_NAME)))
+       rm -rf $(DERIVED_SOURCES_DIR)
 
 internal-distclean::
        (cd $(GNUSTEP_BUILD_DIR); \
index 0e10886e4a1d41ee892461e12eb46c965251b491..a3675eca933a56abcec9c3da29671c44a394a2e3 100644 (file)
@@ -54,6 +54,7 @@ _PSWRAP_H_FILES = $($(SUBPROJECT_NAME)_PSWRAP_FILES:.psw=.h)
 internal-clean::
        (cd $(GNUSTEP_BUILD_DIR); \
        rm -rf $(GNUSTEP_OBJ_DIR_NAME) $(_PSWRAP_C_FILES) $(_PSWRAP_H_FILES))
+       rm -rf $(DERIVED_SOURCES_DIR)
 
 internal-distclean::
        (cd $(GNUSTEP_BUILD_DIR); \
index 1deda758cc0653ad48d45270136fe681646efa73..d8186e8a3f833cf8e73427c928cdfc55a0c7406e 100644 (file)
@@ -34,6 +34,7 @@ internal-uninstall:: $(TOOL_NAME:=.uninstall.tool.variables)
 
 internal-clean::
        rm -rf $(GNUSTEP_OBJ_DIR)
+       rm -rf $(DERIVED_SOURCES_DIR)
 
 internal-distclean::
        (cd $(GNUSTEP_BUILD_DIR); \
index 6493106f2875df3ee36ecbfcc5ac01a1ee430834..5676b4aa22de7068bbce034212497567d83a8b8c 100644 (file)
@@ -430,12 +430,15 @@ $(GNUSTEP_OBJ_DIR)/%${OEXT} : %.cp
                                                        $(ALL_CCFLAGS)) \
              $($<_FILE_FLAGS) -o $@$(END_ECHO)
 
-# precompiled header files (TODO: should go into GNUSTEP_OBJ_DIR?)
+# precompiled header files
+# TODO: should go into GNUSTEP_OBJ_DIR?
+# TODO: we need to create the derived_src here because there is no rule yet
+#       in the include path?
 GCH_SUFFIX=.h.gch
 $(DERIVED_SOURCES_DIR)/%$(GCH_SUFFIX): %.h
-       if ! test -d $(DERIVED_SOURCES_DIR); then \
+       $(ECHO_NOTHING)if ! test -d $(DERIVED_SOURCES_DIR); then \
          $(MKDIRS) $(DERIVED_SOURCES_DIR); \
-       fi
+       fi$(END_ECHO)
        $(ECHO_COMPILING)$(CC) -x objective-c-header $< -c \
              $(filter-out $($<_FILE_FILTER_OUT_FLAGS),$(ALL_CPPFLAGS) \
                                                        $(ALL_OBJCFLAGS)) \