Implemented having source files in subdirectories without using a subproject, as in xxx_OBJC_FILES = Source/Beauty.m

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@28791 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2009-10-10 17:33:02 +00:00
parent 991c74d2ea
commit 0bfd3923ff
14 changed files with 61 additions and 10 deletions

View file

@ -1,3 +1,24 @@
2009-10-10 Nicola Pero <nicola.pero@meta-innovation.com>
Added support for having source files in subdirectories without
using a subproject. Just list them as in xxx_OBJC_FILES =
Source/Beauty.m.
* Instance/rules.make (OBJ_DIRS_TO_CREATE): New variables computed
from OBJ_FILES_TO_LINK. ($(OBJ_DIRS_TO_CREATE)): New rule to
create the directories.
* Instance/application.make (internal-app-all_): Depend on
OBJ_DIRS_TO_CREATE.
* Instance/bundle.make (internal-bundle-all_): Same change.
* Instance/ctool.make (internal-ctool-all_): Same change.
* Instance/framework.make (internal-framework-all_): Same change.
* Instance/gswapp.make (internal-gswapp-all_): Same change.
* Instance/gswbundle.make (internal-gswbundle-all_): Same change.
* Instance/objc.make (internal-objc_program-all_): Same change.
* Instance/palette.make (internal-palette-all_): Same change.
* Instance/service.make (internal-service-all_): Same change.
* Instance/subproject.make (internal-subproject-all_): Same change.
* Instance/tool.make (internal-tool-all_): Same change.
2009-10-10 Nicola Pero <nicola.pero@meta-innovation.com>
Try to warn users if they create their own Info-gnustep.plist file

View file

@ -155,6 +155,7 @@ endif
ifeq ($(FOUNDATION_LIB), apple)
internal-app-all_:: $(GNUSTEP_OBJ_DIR) \
$(OBJ_DIRS_TO_CREATE) \
$(APP_DIR)/Contents/MacOS \
internal-app-run-compile-submake \
shared-instance-bundle-all \
@ -173,6 +174,7 @@ $(APP_DIR)/Contents/MacOS:
else
internal-app-all_:: $(GNUSTEP_OBJ_DIR) \
$(OBJ_DIRS_TO_CREATE) \
$(APP_DIR)/$(GNUSTEP_TARGET_LDIR) \
internal-app-run-compile-submake \
internal-application-build-template \

View file

@ -107,7 +107,7 @@ endif # OBJ_FILES_TO_LINK
# apple.
#
internal-bundle-all_:: $(GNUSTEP_OBJ_DIR) build-bundle
internal-bundle-all_:: $(GNUSTEP_OBJ_DIR) $(OBJ_DIRS_TO_CREATE) build-bundle
# If they specified Info-gnustep.plist in the xxx_RESOURCE_FILES,
# print a warning. They are supposed to provide a xxxInfo.plist which
# gets merged with the automatically generated entries to generate

View file

@ -64,12 +64,13 @@ ALL_LIBS = \
ifeq ($(GNUSTEP_MAKE_PARALLEL_BUILDING), no)
# Standard building
internal-ctool-all_:: $(GNUSTEP_OBJ_DIR) \
$(OBJ_DIRS_TO_CREATE) \
$(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)
internal-ctool-all_:: $(GNUSTEP_OBJ_DIR) $(OBJ_DIRS_TO_CREATE)
$(ECHO_NOTHING)$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory --no-keep-going \
internal-ctool-compile \
GNUSTEP_TYPE=$(GNUSTEP_TYPE) \
@ -81,7 +82,7 @@ internal-ctool-all_:: $(GNUSTEP_OBJ_DIR)
internal-ctool-compile: $(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT)
endif
$(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT): $(OBJ_FILES_TO_LINK)
$(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT): $(OBJ_DIRS_TO_CREATE) $(OBJ_FILES_TO_LINK)
ifeq ($(OBJ_FILES_TO_LINK),)
$(WARNING_EMPTY_LINKING)
endif

View file

@ -330,7 +330,7 @@ endif
GNUSTEP_SHARED_BUNDLE_RESOURCE_PATH = $(FRAMEWORK_VERSION_DIR)/Resources
include $(GNUSTEP_MAKEFILES)/Instance/Shared/bundle.make
internal-framework-all_:: $(GNUSTEP_OBJ_DIR) \
internal-framework-all_:: $(GNUSTEP_OBJ_DIR) $(OBJ_DIRS_TO_CREATE) \
build-framework
# If they specified Info-gnustep.plist in the xxx_RESOURCE_FILES,
# print a warning. They are supposed to provide a xxxInfo.plist which
@ -570,6 +570,8 @@ else
LIB_LINK_FRAMEWORK_FILE = $(LIB_LINK_DLL_FILE)
endif
LIB_LINK_FILES_TO_LINK = $(OBJ_FILES_TO_LINK)
# 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

View file

@ -124,6 +124,7 @@ endif
ifeq ($(FOUNDATION_LIB), apple)
internal-gswapp-all_:: \
$(GNUSTEP_OBJ_DIR) \
$(OBJ_DIRS_TO_CREATE) \
$(GSWAPP_DIR)/Contents/MacOS \
$(GSWAPP_FILE) \
shared-instance-bundle-all \
@ -134,6 +135,7 @@ $(GSWAPP_DIR)/Contents/MacOS:
else
internal-gswapp-all_:: $(GNUSTEP_OBJ_DIR) \
$(OBJ_DIRS_TO_CREATE) \
$(GSWAPP_DIR)/$(GNUSTEP_TARGET_LDIR) \
$(GSWAPP_FILE) \
$(GSWAPP_DIR)/Resources \

View file

@ -92,6 +92,7 @@ endif
#ALL_GSWBUNDLE_LIBS = $(ADDITIONAL_GSW_LIBS) $(AUXILIARY_GSW_LIBS) $(GSW_LIBS) $(ALL_LIBS)
internal-gswbundle-all_:: $(GNUSTEP_OBJ_DIR) \
$(OBJ_DIRS_TO_CREATE) \
build-bundle-dir \
build-bundle
@ -126,7 +127,7 @@ build-bundle: $(GSWBUNDLE_FILE) \
gswbundle-webresource-files
$(GSWBUNDLE_FILE) : $(OBJ_FILES_TO_LINK)
$(GSWBUNDLE_FILE): $(OBJ_FILES_TO_LINK)
ifeq ($(OBJ_FILES_TO_LINK),)
$(WARNING_EMPTY_LINKING)
endif

View file

@ -258,12 +258,13 @@ endif
ifeq ($(GNUSTEP_MAKE_PARALLEL_BUILDING), no)
# Standard building
internal-library-all_:: $(GNUSTEP_OBJ_DIR) \
$(OBJ_DIRS_TO_CREATE) \
$(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_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-library-all_:: $(GNUSTEP_OBJ_DIR)
internal-library-all_:: $(GNUSTEP_OBJ_DIR) $(OBJ_DIRS_TO_CREATE)
$(ECHO_NOTHING)$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory --no-keep-going \
internal-library-compile \
GNUSTEP_TYPE=$(GNUSTEP_TYPE) \

View file

@ -54,12 +54,13 @@ ifeq ($(GNUSTEP_MAKE_PARALLEL_BUILDING), no)
# Standard building
internal-objc_program-all_:: \
$(GNUSTEP_OBJ_DIR) \
$(OBJ_DIRS_TO_CREATE) \
$(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)
internal-objc_program-all_:: $(GNUSTEP_OBJ_DIR) $(OBJ_DIRS_TO_CREATE)
$(ECHO_NOTHING)$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory --no-keep-going \
internal-objc_program-compile \
GNUSTEP_TYPE=$(GNUSTEP_TYPE) \

View file

@ -90,6 +90,7 @@ GNUSTEP_SHARED_BUNDLE_INSTALL_PATH = $(PALETTE_INSTALL_DIR)
include $(GNUSTEP_MAKEFILES)/Instance/Shared/bundle.make
internal-palette-all_:: $(GNUSTEP_OBJ_DIR) \
$(OBJ_DIRS_TO_CREATE) \
$(PALETTE_DIR)/Resources \
$(PALETTE_DIR)/$(GNUSTEP_TARGET_LDIR) \
internal-palette-run-compile-submake \
@ -133,7 +134,7 @@ internal-palette-compile: $(PALETTE_FILE)
endif
# Standard bundle build using the rules for this target
$(PALETTE_FILE) : $(OBJ_FILES_TO_LINK)
$(PALETTE_FILE): $(OBJ_FILES_TO_LINK)
ifeq ($(OBJ_FILES_TO_LINK),)
$(WARNING_EMPTY_LINKING)
endif

View file

@ -249,6 +249,22 @@ OBJ_FILES = $($(GNUSTEP_INSTANCE)_OBJ_FILES)
# object file, or not).
OBJ_FILES_TO_LINK = $(strip $(C_OBJ_FILES) $(OBJC_OBJ_FILES) $(CC_OBJ_FILES) $(OBJCC_OBJ_FILES) $(WINDRES_OBJ_FILES) $(SUBPROJECT_OBJ_FILES) $(OBJ_FILES))
# OBJ_DIRS_TO_CREATE is the set of all directories that contain
# OBJ_FILES_TO_LINK. For example, if you want to compile
# ./Source/File.m, you'd generate a obj/Source/File.o file, and we
# first need to create the directory obj/Source. Source/File.m would
# be in OBJC_FILES, obj/Source/File.o would be in OBJ_FILES_TO_LINK,
# and obj/Source would be in OBJ_DIRS_TO_CREATE.
#
# Explanation: $(dir ...) is used to extract the directory; $(sort
# ...) is used to remove duplicates; $(filter-out ...) is used to
# remove $(GNUSTEP_OBJ_DIR) which would always appear and is already
# covered by default.
OBJ_DIRS_TO_CREATE = $(filter-out $(GNUSTEP_OBJ_DIR)/,$(sort $(dir $(OBJ_FILES_TO_LINK))))
$(OBJ_DIRS_TO_CREATE):
$(ECHO_CREATING)cd $(GNUSTEP_BUILD_DIR); $(MKDIRS) $@$(END_ECHO)
# If C++ or ObjC++ are involved, we use the C++ compiler instead of
# the C/ObjC one to link; this happens automatically when compiling
# C++ or ObjC++ files, but we also want it to happen when linking,

View file

@ -76,6 +76,7 @@ GNUSTEP_SHARED_BUNDLE_INSTALL_PATH = $(SERVICE_INSTALL_DIR)
include $(GNUSTEP_MAKEFILES)/Instance/Shared/bundle.make
internal-service-all_:: $(GNUSTEP_OBJ_DIR) \
$(OBJ_DIRS_TO_CREATE) \
$(SERVICE_DIR)/$(GNUSTEP_TARGET_LDIR) \
internal-service-run-compile-submake \
$(SERVICE_DIR)/Resources/Info-gnustep.plist \

View file

@ -35,12 +35,13 @@ endif
ifeq ($(GNUSTEP_MAKE_PARALLEL_BUILDING), no)
# Standard building
internal-subproject-all_:: $(GNUSTEP_OBJ_DIR) \
$(OBJ_DIRS_TO_CREATE) \
$(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)
internal-subproject-all_:: $(GNUSTEP_OBJ_DIR) $(OBJ_DIRS_TO_CREATE)
$(ECHO_NOTHING)$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory --no-keep-going \
internal-subproject-compile \
GNUSTEP_TYPE=$(GNUSTEP_TYPE) \

View file

@ -64,12 +64,13 @@ endif
ifeq ($(GNUSTEP_MAKE_PARALLEL_BUILDING), no)
# Standard building
internal-tool-all_:: $(GNUSTEP_OBJ_DIR) \
$(OBJ_DIRS_TO_CREATE) \
$(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-tool-all_:: $(GNUSTEP_OBJ_DIR)
internal-tool-all_:: $(GNUSTEP_OBJ_DIR) $(OBJ_DIRS_TO_CREATE)
$(ECHO_NOTHING)$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory --no-keep-going \
internal-tool-compile \
GNUSTEP_TYPE=$(GNUSTEP_TYPE) \