+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
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
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.
#
--- /dev/null
+#
+# 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
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
# 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)
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
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)
# Compilation targets
#
internal-subproject-all_:: $(GNUSTEP_OBJ_DIR) \
+ shared-instance-pch-all \
$(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT)
ifeq ($(BUILD_DLL),yes)
#
include $(GNUSTEP_MAKEFILES)/Instance/Shared/headers.make
+include $(GNUSTEP_MAKEFILES)/Instance/Shared/pch.make
internal-subproject-install_:: shared-instance-headers-install
include $(GNUSTEP_MAKEFILES)/rules.make
endif
+include $(GNUSTEP_MAKEFILES)/Instance/Shared/pch.make
+
.PHONY: internal-tool-all_ \
internal-tool-install_ \
internal-tool-uninstall_ \
# 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)
(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); \
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); \
internal-clean::
rm -rf $(GNUSTEP_OBJ_DIR)
+ rm -rf $(DERIVED_SOURCES_DIR)
internal-distclean::
(cd $(GNUSTEP_BUILD_DIR); \
$(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)) \