Committed rewrite of resource-set.make that I had forgotten to commit; fixed new framework symlinks in non-flattened case

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@24856 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2007-03-13 08:56:51 +00:00
parent d9cf37e43b
commit 2d332482ad
3 changed files with 116 additions and 32 deletions

View file

@ -1,3 +1,25 @@
2007-03-13 Nicola Pero <nicola.pero@meta-innovation.com>
* Instance/framework.make
($(GNUSTEP_BUILD_DIR)/$(GNUSTEP_INSTANCE).framework/$(GNUSTEP_TARGET_LDIR)):
New rule to create the directory when non-flattened.
($(GNUSTEP_BUILD_DIR)/$(GNUSTEP_INSTANCE).framework/$(GNUSTEP_TARGET_LDIR)/$(GNUSTEP_INSTANCE)):
Depend on the new rule; use REL_PATH_SCRIPT to compute correct
symlink when non-flattened.
2007-03-13 Nicola Pero <nicola.pero@meta-innovation.com>
* Instance/resource-set.make (RESOURCE_FILES_DIR): New variable.
($(RESOURCE_FILES_INSTALL_DIR)): Added missing CHOWN.
(LOCALIZED_RESOURCE_DIRS): New variable; implemented rules to
support it.
(internal-resource_set-install_): Create the
LOCALIZED_RESOURCE_DIRS if needed. Use 'cp -rf' instead of
INSTALL_DATA to install RESOURCE_FILES and
LOCALIZED_RESOURCE_FILES so that directories can be used as well.
Do a final CHOWN to fixup ownership of all the installed stuff.
($(RESOURCE_FILES_INSTALL_DIR)/%): Do a CHOWN.
2007-03-09 Nicola Pero <nicola.pero@meta-innovation.com>
* Instance/library.make: Changed resource installation directory

View file

@ -465,7 +465,10 @@ ifeq ($(findstring darwin, $(GNUSTEP_TARGET_OS)), darwin)
# what we are compiling is not made the Current framework version, I
# think it's not our business to touch the Current stuff, so let's
# ignore it. It's faster to ignore it anyway. ;-)
$(GNUSTEP_BUILD_DIR)/$(GNUSTEP_INSTANCE).framework/$(GNUSTEP_TARGET_LDIR)/$(GNUSTEP_INSTANCE):
$(GNUSTEP_BUILD_DIR)/$(GNUSTEP_INSTANCE).framework/$(GNUSTEP_TARGET_LDIR):
$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
$(GNUSTEP_BUILD_DIR)/$(GNUSTEP_INSTANCE).framework/$(GNUSTEP_TARGET_LDIR)/$(GNUSTEP_INSTANCE): $(GNUSTEP_BUILD_DIR)/$(GNUSTEP_INSTANCE).framework/$(GNUSTEP_TARGET_LDIR)/
ifeq ($(MAKE_CURRENT_VERSION),yes)
$(ECHO_NOTHING)cd $(GNUSTEP_BUILD_DIR)/$(GNUSTEP_INSTANCE).framework; \
$(RM_LN_S) $(GNUSTEP_INSTANCE); \
@ -488,12 +491,19 @@ else
# by just using -Lpath_to_the_framework/xxx.framework/$TARGET_LDIR
#
ifeq ($(FRAMEWORK_VERSION_SUPPORT), yes)
$(GNUSTEP_BUILD_DIR)/$(GNUSTEP_INSTANCE).framework/$(GNUSTEP_TARGET_LDIR)/$(GNUSTEP_INSTANCE):
$(GNUSTEP_BUILD_DIR)/$(GNUSTEP_INSTANCE).framework/$(GNUSTEP_TARGET_LDIR):
$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
$(GNUSTEP_BUILD_DIR)/$(GNUSTEP_INSTANCE).framework/$(GNUSTEP_TARGET_LDIR)/$(GNUSTEP_INSTANCE): $(GNUSTEP_BUILD_DIR)/$(GNUSTEP_INSTANCE).framework/$(GNUSTEP_TARGET_LDIR)/
ifeq ($(MAKE_CURRENT_VERSION),yes)
$(ECHO_NOTHING)cd $(GNUSTEP_BUILD_DIR)/$(GNUSTEP_INSTANCE).framework/$(GNUSTEP_TARGET_LDIR); \
$(RM_LN_S) $(GNUSTEP_INSTANCE) $(FRAMEWORK_LIBRARY_FILES); \
$(LN_S) Versions/Current/$(GNUSTEP_TARGET_LDIR)/$(GNUSTEP_INSTANCE) $(GNUSTEP_INSTANCE); \
$(LN_S) Versions/Current/$(GNUSTEP_TARGET_LDIR)/$(FRAMEWORK_LIBRARY_FILE) $(FRAMEWORK_LIBRARY_FILE)$(END_ECHO)
$(LN_S) `$(REL_PATH_SCRIPT) $(GNUSTEP_TARGET_LDIR) \
Versions/Current/$(GNUSTEP_TARGET_LDIR)/$(GNUSTEP_INSTANCE)` \
$(GNUSTEP_INSTANCE); \
$(LN_S) `$(REL_PATH_SCRIPT) $(GNUSTEP_TARGET_LDIR) \
Versions/Current/$(GNUSTEP_TARGET_LDIR)/$(FRAMEWORK_LIBRARY_FILE)` \
$(FRAMEWORK_LIBRARY_FILE)$(END_ECHO)
endif
endif
endif

View file

@ -23,19 +23,31 @@ ifeq ($(RULES_MAKE_LOADED),)
include $(GNUSTEP_MAKEFILES)/rules.make
endif
#
# This is used to install a bunch of resource files somewhere. It is
# different from a bundle without resources; in a bundle without
# resources, we first create the bundle in the build directory, then
# copy the build to the install dir, overwriting anything already
# there. This instead will install the separate resource files
# directly in the installation directory; it's more efficient as it
# doesn't create a local bundle, and it doesn't overwrite an existing
# bundle in the installation directory.
#
#
# The name of the set of resources is in the RESOURCE_SET_NAME variable.
# The list of resource file are in xxx_RESOURCE_FILES
# The list of resource files/dirs is in xxx_RESOURCE_FILES
# The list of resource directories to create are in xxx_RESOURCE_DIRS
# The directory in which to install the resources is in the
# xxx_INSTALL_DIR
# The directory in which the resources are is in the
# xxx_RESOURCE_FILES_DIR (defaults to ./ if omitted)
# The list of LANGUAGES is in the xxx_LANGUAGES variable.
# The list of localized files to be read from yyy.lproj and copied
# The list of localized files/dirs to be read from yyy.lproj and copied
# into $(RESOURCE_FILES_INSTALL_DIR)/yyy.lproj for each language yyy
# is in the xxx_LOCALIZED_RESOURCE_FILES variable.
#
# The list of localized dirs to be created empty inside each
# $(RESOURCE_FILES_INSTALL_DIR)/yyy.lproj for each language yyy
# is in the xxx_LOCALIZED_RESOURCE_DIRS variable.
.PHONY: internal-resource_set-install_ \
internal-resource_set-uninstall_
@ -63,21 +75,6 @@ ifeq ($(RESOURCE_FILES_INSTALL_DIR),)
RESOURCE_FILES_INSTALL_DIR = $(GNUSTEP_RESOURCES)/$(GNUSTEP_INSTANCE)
endif
# Rule to build the installation dir
$(RESOURCE_FILES_INSTALL_DIR):
$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
# Determine the additional installation dirs to build
RESOURCE_DIRS = $($(GNUSTEP_INSTANCE)_RESOURCE_DIRS)
ifneq ($(RESOURCE_DIRS),)
# Rule to build the additional installation dirs
$(addprefix $(RESOURCE_FILES_INSTALL_DIR)/,$(RESOURCE_DIRS)):
$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
endif
# Determine the dir to take the resources from
RESOURCE_FILES_DIR = $($(GNUSTEP_INSTANCE)_RESOURCE_FILES_DIR)
ifeq ($(RESOURCE_FILES_DIR),)
@ -87,7 +84,23 @@ endif
# Determine the list of resource files
RESOURCE_FILES = $($(GNUSTEP_INSTANCE)_RESOURCE_FILES)
RESOURCE_DIRS = $($(GNUSTEP_INSTANCE)_RESOURCE_DIRS)
ifneq ($(RESOURCE_DIRS),)
# Rule to build the additional installation dirs
$(addprefix $(RESOURCE_FILES_INSTALL_DIR)/,$(RESOURCE_DIRS)):
$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
ifneq ($(CHOWN_TO),)
$(ECHO_CHOWNING)$(CHOWN) -R $(CHOWN_TO) $@$(END_ECHO)
endif
endif
# Rule to build the installation dir
$(RESOURCE_FILES_INSTALL_DIR):
$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
ifneq ($(CHOWN_TO),)
$(ECHO_CHOWNING)$(CHOWN) -R $(CHOWN_TO) $@$(END_ECHO)
endif
# Determine the list of languages
override LANGUAGES = $($(GNUSTEP_INSTANCE)_LANGUAGES)
@ -95,9 +108,20 @@ ifeq ($(LANGUAGES),)
override LANGUAGES = English
endif
# Determine the list of localized resource files
LOCALIZED_RESOURCE_FILES = $($(GNUSTEP_INSTANCE)_LOCALIZED_RESOURCE_FILES)
LOCALIZED_RESOURCE_DIRS = $($(GNUSTEP_INSTANCE)_LOCALIZED_RESOURCE_DIRS)
ifneq ($(LOCALIZED_RESOURCE_DIRS),)
# The following expression will create all the
# RESOURCE_FILES_INSTALL_DIR/LANGUAGE/LOCALIZED_RESOURCE_DIR that we
# need to build.
$(foreach LANGUAGE,$(LANGUAGES),$(addprefix $(RESOURCE_FILES_INSTALL_DIR)/$(LANGUAGE), $(LOCALIZED_RESOURCE_DIRS))):
$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
ifneq ($(CHOWN_TO),)
$(ECHO_CHOWNING)$(CHOWN) -R $(CHOWN_TO) $@$(END_ECHO)
endif
endif
#
# We provide two different algorithms of installing resource files.
@ -108,23 +132,33 @@ ifeq ($(GNUSTEP_DEVELOPER),)
# Standard one - just run a subshell and loop, and install everything.
internal-resource_set-install_: \
$(RESOURCE_FILES_INSTALL_DIR) \
$(addprefix $(RESOURCE_FILES_INSTALL_DIR)/,$(RESOURCE_DIRS))
$(addprefix $(RESOURCE_FILES_INSTALL_DIR)/,$(RESOURCE_DIRS)) \
$(foreach LANGUAGE,$(LANGUAGES),$(addprefix $(RESOURCE_FILES_INSTALL_DIR)/$(LANGUAGE), $(LOCALIZED_RESOURCE_DIRS)))
ifneq ($(RESOURCE_FILES),)
$(ECHO_NOTHING)for file in $(RESOURCE_FILES) __done; do \
if [ $$file != __done ]; then \
$(INSTALL_DATA) $(RESOURCE_FILES_DIR)/$$file \
$(RESOURCE_FILES_INSTALL_DIR)/$$file; \
$(ECHO_NOTHING)for f in $(RESOURCE_FILES); do \
if [ -f $$f -o -d $$f ]; then \
cp -fr $(RESOURCE_FILES_DIR)/$$f \
$(RESOURCE_FILES_INSTALL_DIR)/$$f; \
else \
echo "Warning: $$f not found - ignoring"; \
fi; \
done$(END_ECHO)
ifneq ($(CHOWN_TO),)
$(ECHO_CHOWNING)for f in $(RESOURCE_FILES); do \
if [ -f $$f -o -d $$f ]; then \
$(CHOWN) -R $(CHOWN_TO) $(RESOURCE_FILES_INSTALL_DIR)/$$f; \
fi; \
done$(END_ECHO)
endif
endif
ifneq ($(LOCALIZED_RESOURCE_FILES),)
$(ECHO_NOTHING)for l in $(LANGUAGES); do \
if [ -d $$l.lproj ]; then \
$(MKINSTALLDIRS) $(RESOURCE_FILES_INSTALL_DIR)/$$l.lproj; \
for f in $(LOCALIZED_RESOURCE_FILES); do \
if [ -f $$l.lproj/$$f ]; then \
$(INSTALL_DATA) $$l.lproj/$$f \
$(RESOURCE_FILES_INSTALL_DIR)/$$l.lproj; \
if [ -f $$l.lproj/$$f -o -d $$l.lproj/$$f ]; then \
cp -fr $$l.lproj/$$f \
$(RESOURCE_FILES_INSTALL_DIR)/$$l.lproj; \
else \
echo "Warning: $$l.lproj/$$f not found - ignoring"; \
fi; \
@ -133,16 +167,34 @@ ifneq ($(LOCALIZED_RESOURCE_FILES),)
echo "Warning: $$l.lproj not found - ignoring"; \
fi; \
done$(END_ECHO)
ifneq ($(CHOWN_TO),)
$(ECHO_CHOWNING)for l in $(LANGUAGES); do \
if [ -d $$l.lproj ]; then \
$(CHOWN) -R $(CHOWN_TO) $(RESOURCE_FILES_INSTALL_DIR)/$$l.lproj; \
for f in $(LOCALIZED_RESOURCE_FILES); do \
if [ -f $$l.lproj/$$f -o -d $$l.lproj/$$f ]; then \
$(CHOWN) -R $(CHOWN_TO) $(RESOURCE_FILES_INSTALL_DIR)/$$l.lproj/$$f; \
fi; \
done; \
fi; \
done$(END_ECHO)
endif
endif
else # Following code turned on by setting GNUSTEP_DEVELOPER=YES in the shell
# TODO/FIXME: Update the code; implement proper
# LOCALIZED_RESOURCE_FILES that also allows directories etc.
.PHONY: internal-resource-set-install-languages
# One optimized for recurrent installations during development - this
# rule installs a single file only if strictly needed
$(RESOURCE_FILES_INSTALL_DIR)/% : $(RESOURCE_FILES_DIR)/%
$(ECHO_NOTHING)$(INSTALL_DATA) $< $@$(END_ECHO)
$(ECHO_NOTHING)cp -fr $< $(RESOURCE_FILES_DIR)$(END_ECHO)
ifneq ($(CHOWN_TO),)
$(ECHO_CHOWNING)$(CHOWN) -R $(CHOWN_TO) $@$(END_ECHO)
endif
# This rule depends on having installed all files
internal-resource_set-install_: \