Extended parallel building support to various projects

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@27886 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2009-02-16 11:21:57 +00:00
parent 5cbaf50fb7
commit 33d8d7f345
10 changed files with 197 additions and 14 deletions

View file

@ -1,3 +1,32 @@
2009-02-16 Nicola Pero <nicola.pero@meta-innovation.com>
Extended experimental parallel building support to most project
types. You can use 'make GNUSTEP_MAKE_PARALLEL_BUILDING=YES -j2'
to try out the new parallel building support.
* Instance/application.make (internal-app-run-compile-submake):
New target with separate implementations to support parallel and
non-parallel building.
(internal-app-compile): New target.
(internal-app-all_): Depend on internal-app-run-compile-submake
instead of APP_FILE.
* Instance/bundle.make (internal-bundle-run-compile-submake),
(internal-bundle-compile), (internal-bundle-all_): Same changes.
* Instance/framework.make
(internal-framework-run-compile-submake),
(internal-framework-compile), (build-framework): Same changes.
* Instance/palette.make (internal-palette-run-compile-submake),
(internal-palette-compile), (internal-palette-all_): Same changes.
* Instance/service.make (internal-service-run-compile-submake),
(internal-service-compile), (internal-service-all_): Same changes.
* Instance/ctool.make (internal-ctool-all_): When doing a parallel
build, use a submake 'compile' invocation to compile.
(internal-ctool-compile): New target for the 'compile' invocation.
* Instance/objc.make (internal-objc_program-all_),
(internal-objc_program-compile): Same changes.
* Instance/subproject.make (internal-subproject-all_),
(internal-subproject-compile): Same changes.
2009-02-16 Nicola Pero <nicola.pero@meta-innovation.com>
* Instance/library.make (internal-library-all_): Fixed

View file

@ -129,11 +129,29 @@ $(APP_FILE): $(OBJ_FILES_TO_LINK)
#
# Compilation targets
#
ifeq ($(GNUSTEP_MAKE_PARALLEL_BUILDING), no)
# Standard building
internal-app-run-compile-submake: $(APP_FILE)
else
# Parallel building. The actual compilation is delegated to a
# sub-make invocation where _GNUSTEP_MAKE_PARALLEL is set to yet.
# That sub-make invocation will compile files in parallel.
internal-app-run-compile-submake:
$(ECHO_NOTHING)$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory --no-keep-going \
internal-app-compile \
GNUSTEP_TYPE=$(GNUSTEP_TYPE) \
GNUSTEP_INSTANCE=$(GNUSTEP_INSTANCE) \
GNUSTEP_OPERATION=compile \
GNUSTEP_BUILD_DIR="$(GNUSTEP_BUILD_DIR)" \
_GNUSTEP_MAKE_PARALLEL=yes$(END_ECHO)
internal-app-compile: $(APP_FILE)
endif
ifeq ($(FOUNDATION_LIB), apple)
internal-app-all_:: $(GNUSTEP_OBJ_DIR) \
$(APP_DIR)/Contents/MacOS \
$(APP_FILE) \
internal-app-run-compile-submake \
shared-instance-bundle-all \
$(APP_INFO_PLIST_FILE)
@ -144,7 +162,7 @@ else
internal-app-all_:: $(GNUSTEP_OBJ_DIR) \
$(APP_DIR)/$(GNUSTEP_TARGET_LDIR) \
$(APP_FILE) \
internal-app-run-compile-submake \
internal-application-build-template \
$(APP_DIR)/Resources \
$(APP_INFO_PLIST_FILE) \

View file

@ -1,4 +1,4 @@
#
# -*-makefile-*-
# Instace/bundle.make
#
# Instance makefile rules to build GNUstep-based bundles.
@ -150,12 +150,12 @@ include $(GNUSTEP_MAKEFILES)/Instance/Shared/bundle.make
ifneq ($(OBJ_FILES_TO_LINK),)
ifneq ($(FOUNDATION_LIB),apple)
build-bundle: $(BUNDLE_DIR)/$(GNUSTEP_TARGET_LDIR) \
$(BUNDLE_FILE) \
internal-bundle-run-compile-submake \
shared-instance-bundle-all \
$(BUNDLE_INFO_PLIST_FILE)
else
build-bundle: $(BUNDLE_DIR)/Contents/MacOS \
$(BUNDLE_FILE) \
internal-bundle-run-compile-submake \
shared-instance-bundle-all \
$(BUNDLE_INFO_PLIST_FILE)
endif
@ -167,6 +167,25 @@ endif
$(BUNDLE_DIR)/$(GNUSTEP_TARGET_LDIR):
$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
ifeq ($(GNUSTEP_MAKE_PARALLEL_BUILDING), no)
# Standard building
internal-bundle-run-compile-submake: $(BUNDLE_FILE)
else
# Parallel building. The actual compilation is delegated to a
# sub-make invocation where _GNUSTEP_MAKE_PARALLEL is set to yet.
# That sub-make invocation will compile files in parallel.
internal-bundle-run-compile-submake:
$(ECHO_NOTHING)$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory --no-keep-going \
internal-bundle-compile \
GNUSTEP_TYPE=$(GNUSTEP_TYPE) \
GNUSTEP_INSTANCE=$(GNUSTEP_INSTANCE) \
GNUSTEP_OPERATION=compile \
GNUSTEP_BUILD_DIR="$(GNUSTEP_BUILD_DIR)" \
_GNUSTEP_MAKE_PARALLEL=yes$(END_ECHO)
internal-bundle-compile: $(BUNDLE_FILE)
endif
$(BUNDLE_FILE): $(OBJ_FILES_TO_LINK)
$(ECHO_LINKING)$(BUNDLE_LINK_CMD)$(END_ECHO)

View file

@ -1,4 +1,4 @@
#
# -*-makefile-*-
# Instance/ctool.make
#
# Instance Makefile rules to build GNUstep-based command line ctools.
@ -60,8 +60,25 @@ ALL_LIBS = \
#
# Compilation targets
#
ifeq ($(GNUSTEP_MAKE_PARALLEL_BUILDING), no)
# Standard building
internal-ctool-all_:: $(GNUSTEP_OBJ_DIR) \
$(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT)
$(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT)
else
# Parallel building. The actual compilation is delegated to a
# sub-make invocation where _GNUSTEP_MAKE_PARALLEL is set to yet.
# That sub-make invocation will compile files in parallel.
internal-ctool-all_:: $(GNUSTEP_OBJ_DIR)
$(ECHO_NOTHING)$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory --no-keep-going \
internal-ctool-compile \
GNUSTEP_TYPE=$(GNUSTEP_TYPE) \
GNUSTEP_INSTANCE=$(GNUSTEP_INSTANCE) \
GNUSTEP_OPERATION=compile \
GNUSTEP_BUILD_DIR="$(GNUSTEP_BUILD_DIR)" \
_GNUSTEP_MAKE_PARALLEL=yes$(END_ECHO)
internal-ctool-compile: $(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT)
endif
$(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT): $(OBJ_FILES_TO_LINK)
$(ECHO_LINKING)$(LD) $(ALL_LDFLAGS) -o $(LDOUT)$@ \

View file

@ -24,6 +24,8 @@ ifeq ($(RULES_MAKE_LOADED),)
include $(GNUSTEP_MAKEFILES)/rules.make
endif
# NB: Parallel building is not supported here (yet?).
#
# The names of the documents are in the DOCUMENT_NAME variable.
# These final documents will be generated in info, dvi, ps, and html output.

View file

@ -483,12 +483,12 @@ else
endif
ifeq ($(FRAMEWORK_VERSION_SUPPORT), yes)
build-framework: $(FRAMEWORK_FILE) \
build-framework: internal-framework-run-compile-submake \
shared-instance-bundle-all \
$(FRAMEWORK_VERSION_DIR)/Resources/$(FRAMEWORK_INFO_PLIST_FILE) \
$(GNUSTEP_BUILD_DIR)/$(GNUSTEP_INSTANCE).framework/$(GNUSTEP_TARGET_LDIR)/$(GNUSTEP_INSTANCE)
else
build-framework: $(FRAMEWORK_FILE) \
build-framework: internal-framework-run-compile-submake \
shared-instance-bundle-all \
$(FRAMEWORK_VERSION_DIR)/Resources/$(FRAMEWORK_INFO_PLIST_FILE)
endif
@ -554,6 +554,13 @@ else
LIB_LINK_FRAMEWORK_FILE = $(LIB_LINK_DLL_FILE)
endif
# Important: FRAMEWORK_FILE (which is created in the parallel
# 'compile' invocation) depends on DUMMY_FRAMEWORK_OBJ_FILES as well,
# which depends on a lot of other rules. These rules *must* be safe
# for parallel building, because they will be used during a parallel
# build. In particular, note that DUMMY_FRAMEWORK_OBJ_FILE must
# itself depend on OBJ_FILES_TO_LINK else it might be built before all
# files are compiled.
$(FRAMEWORK_FILE): $(DUMMY_FRAMEWORK_OBJ_FILE) $(OBJ_FILES_TO_LINK)
$(ECHO_LINKING) \
$(LIB_LINK_CMD) || $(RM) $(FRAMEWORK_FILE) ; \
@ -562,6 +569,25 @@ $(FRAMEWORK_FILE): $(DUMMY_FRAMEWORK_OBJ_FILE) $(OBJ_FILES_TO_LINK)
$(LN_S) $(LIB_LINK_FRAMEWORK_FILE) $(GNUSTEP_INSTANCE)) \
$(END_ECHO)
ifeq ($(GNUSTEP_MAKE_PARALLEL_BUILDING), no)
# Standard building
internal-framework-run-compile-submake: $(FRAMEWORK_FILE)
else
# Parallel building. The actual compilation is delegated to a
# sub-make invocation where _GNUSTEP_MAKE_PARALLEL is set to yet.
# That sub-make invocation will compile files in parallel.
internal-framework-run-compile-submake:
$(ECHO_NOTHING)$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory --no-keep-going \
internal-framework-compile \
GNUSTEP_TYPE=$(GNUSTEP_TYPE) \
GNUSTEP_INSTANCE=$(GNUSTEP_INSTANCE) \
GNUSTEP_OPERATION=compile \
GNUSTEP_BUILD_DIR="$(GNUSTEP_BUILD_DIR)" \
_GNUSTEP_MAKE_PARALLEL=yes$(END_ECHO)
internal-framework-compile: $(FRAMEWORK_FILE)
endif
PRINCIPAL_CLASS = $(strip $($(GNUSTEP_INSTANCE)_PRINCIPAL_CLASS))
ifeq ($(PRINCIPAL_CLASS),)

View file

@ -1,4 +1,4 @@
#
# -*-makefile-*-
# Instance/objc.make
#
# Instance Makefile rules to build ObjC-based (but not GNUstep) programs.
@ -49,9 +49,26 @@ ALL_OBJC_LIBS = \
$(ADDITIONAL_OBJC_LIBS) $(AUXILIARY_OBJC_LIBS) $(OBJC_LIBS) \
$(TARGET_SYSTEM_LIBS)
ifeq ($(GNUSTEP_MAKE_PARALLEL_BUILDING), no)
# Standard building
internal-objc_program-all_:: \
$(GNUSTEP_OBJ_DIR) \
$(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT)
else
# Parallel building. The actual compilation is delegated to a
# sub-make invocation where _GNUSTEP_MAKE_PARALLEL is set to yet.
# That sub-make invocation will compile files in parallel.
internal-objc_program-all_:: $(GNUSTEP_OBJ_DIR)
$(ECHO_NOTHING)$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory --no-keep-going \
internal-objc_program-compile \
GNUSTEP_TYPE=$(GNUSTEP_TYPE) \
GNUSTEP_INSTANCE=$(GNUSTEP_INSTANCE) \
GNUSTEP_OPERATION=compile \
GNUSTEP_BUILD_DIR="$(GNUSTEP_BUILD_DIR)" \
_GNUSTEP_MAKE_PARALLEL=yes$(END_ECHO)
internal-objc_program-compile: $(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT)
endif
$(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT): $(OBJ_FILES_TO_LINK)
$(ECHO_LINKING)$(LD) $(ALL_LDFLAGS) $(CC_LDFLAGS) -o $(LDOUT)$@ \

View file

@ -1,4 +1,4 @@
#
# -*-makefile-*-
# Instance/palette.make
#
# Instance Makefile rules to build GNUstep-based palettes.
@ -90,7 +90,7 @@ include $(GNUSTEP_MAKEFILES)/Instance/Shared/bundle.make
internal-palette-all_:: $(GNUSTEP_OBJ_DIR) \
$(PALETTE_DIR)/Resources \
$(PALETTE_DIR)/$(GNUSTEP_TARGET_LDIR) \
$(PALETTE_FILE) \
internal-palette-run-compile-submake \
$(PALETTE_DIR)/Resources/Info-gnustep.plist \
$(PALETTE_DIR)/Resources/palette.table \
shared-instance-bundle-all
@ -98,6 +98,25 @@ internal-palette-all_:: $(GNUSTEP_OBJ_DIR) \
$(PALETTE_DIR)/$(GNUSTEP_TARGET_LDIR):
$(ECHO_CREATING)$(MKDIRS) $(PALETTE_DIR)/$(GNUSTEP_TARGET_LDIR)$(END_ECHO)
ifeq ($(GNUSTEP_MAKE_PARALLEL_BUILDING), no)
# Standard building
internal-palette-run-compile-submake: $(PALETTE_FILE)
else
# Parallel building. The actual compilation is delegated to a
# sub-make invocation where _GNUSTEP_MAKE_PARALLEL is set to yet.
# That sub-make invocation will compile files in parallel.
internal-palette-run-compile-submake:
$(ECHO_NOTHING)$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory --no-keep-going \
internal-palette-compile \
GNUSTEP_TYPE=$(GNUSTEP_TYPE) \
GNUSTEP_INSTANCE=$(GNUSTEP_INSTANCE) \
GNUSTEP_OPERATION=compile \
GNUSTEP_BUILD_DIR="$(GNUSTEP_BUILD_DIR)" \
_GNUSTEP_MAKE_PARALLEL=yes$(END_ECHO)
internal-palette-compile: $(PALETTE_FILE)
endif
# Standard bundle build using the rules for this target
$(PALETTE_FILE) : $(OBJ_FILES_TO_LINK)
$(ECHO_LINKING)$(BUNDLE_LD) $(BUNDLE_LDFLAGS) \

View file

@ -1,4 +1,4 @@
#
# -*-makefile-*-
# Instance/service.make
#
# Instance Makefile rules to build GNUstep-based services.
@ -75,10 +75,29 @@ include $(GNUSTEP_MAKEFILES)/Instance/Shared/bundle.make
internal-service-all_:: $(GNUSTEP_OBJ_DIR) \
$(SERVICE_DIR)/$(GNUSTEP_TARGET_LDIR) \
$(SERVICE_FILE) \
internal-service-run-compile-submake \
$(SERVICE_DIR)/Resources/Info-gnustep.plist \
shared-instance-bundle-all
ifeq ($(GNUSTEP_MAKE_PARALLEL_BUILDING), no)
# Standard building
internal-service-run-compile-submake: $(SERVICE_FILE)
else
# Parallel building. The actual compilation is delegated to a
# sub-make invocation where _GNUSTEP_MAKE_PARALLEL is set to yet.
# That sub-make invocation will compile files in parallel.
internal-service-run-compile-submake:
$(ECHO_NOTHING)$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory --no-keep-going \
internal-service-compile \
GNUSTEP_TYPE=$(GNUSTEP_TYPE) \
GNUSTEP_INSTANCE=$(GNUSTEP_INSTANCE) \
GNUSTEP_OPERATION=compile \
GNUSTEP_BUILD_DIR="$(GNUSTEP_BUILD_DIR)" \
_GNUSTEP_MAKE_PARALLEL=yes$(END_ECHO)
internal-service-compile: $(SERVICE_FILE)
endif
$(SERVICE_FILE): $(OBJ_FILES_TO_LINK)
$(ECHO_LINKING)$(LD) $(ALL_LDFLAGS) $(CC_LDFLAGS) -o $(LDOUT)$@ \
$(OBJ_FILES_TO_LINK) $(ALL_SERVICE_LIBS)$(END_ECHO)

View file

@ -31,8 +31,25 @@ endif
#
# Compilation targets
#
ifeq ($(GNUSTEP_MAKE_PARALLEL_BUILDING), no)
# Standard building
internal-subproject-all_:: $(GNUSTEP_OBJ_DIR) \
$(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT)
else
# Parallel building. The actual compilation is delegated to a
# sub-make invocation where _GNUSTEP_MAKE_PARALLEL is set to yet.
# That sub-make invocation will compile files in parallel.
internal-subproject-all_:: $(GNUSTEP_OBJ_DIR)
$(ECHO_NOTHING)$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory --no-keep-going \
internal-subproject-compile \
GNUSTEP_TYPE=$(GNUSTEP_TYPE) \
GNUSTEP_INSTANCE=$(GNUSTEP_INSTANCE) \
GNUSTEP_OPERATION=compile \
GNUSTEP_BUILD_DIR="$(GNUSTEP_BUILD_DIR)" \
_GNUSTEP_MAKE_PARALLEL=yes$(END_ECHO)
internal-subproject-compile: $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT)
endif
# We need to depend on SUBPROJECT_OBJ_FILES to account for sub-subprojects.
$(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT): $(OBJ_FILES_TO_LINK)