Entirely rewritten to use the new Instnace/Shared/bundle.make, which allows

it for example to have subprojects with resources, which was requested


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@18834 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2004-03-11 19:03:05 +00:00
parent 17d2158e63
commit abba62087b

View file

@ -3,9 +3,10 @@
#
# Instance Makefile rules to build GNUstep web based applications.
#
# Copyright (C) 1997 Free Software Foundation, Inc.
# Copyright (C) 1997-2004 Free Software Foundation, Inc.
#
# Author: Manuel Guesdon <mguesdon@sbuilders.com>
# Author: Manuel Guesdon <mguesdon@sbuilders.com>,
# Nicola Pero <n.pero@mi.flashnet.it>
# Based on application.make by Ovidiu Predescu <ovidiu@net-community.com>
# Based on gswapp.make by Helge Hess, MDlink online service center GmbH.
# Based on the original version by Scott Christley.
@ -31,7 +32,6 @@ endif
# copying them.
#
# The name of the application is in the GSWAPP_NAME variable.
# The list of languages the app is localized in are in xxx_LANGUAGES <==
# The list of application resource file are in xxx_RESOURCE_FILES
@ -44,16 +44,6 @@ endif
# xxx_LOCALIZED_WEBSERVER_RESOURCE_DIRS
# where xxx is the application name <==
COMPONENTS = $($(GNUSTEP_INSTANCE)_COMPONENTS)
LANGUAGES = $($(GNUSTEP_INSTANCE)_LANGUAGES)
WEBSERVER_RESOURCE_FILES = $($(GNUSTEP_INSTANCE)_WEBSERVER_RESOURCE_FILES)
LOCALIZED_WEBSERVER_RESOURCE_FILES = $($(GNUSTEP_INSTANCE)_LOCALIZED_WEBSERVER_RESOURCE_FILES)
WEBSERVER_RESOURCE_DIRS = $($(GNUSTEP_INSTANCE)_WEBSERVER_RESOURCE_DIRS)
LOCALIZED_RESOURCE_FILES = $($(GNUSTEP_INSTANCE)_LOCALIZED_RESOURCE_FILES)
RESOURCE_FILES = $($(GNUSTEP_INSTANCE)_RESOURCE_FILES)
RESOURCE_DIRS = $($(GNUSTEP_INSTANCE)_RESOURCE_DIRS)
# Determine the application directory extension
ifeq ($(profile), yes)
GSWAPP_EXTENSION = profile
@ -70,13 +60,18 @@ GNUSTEP_GSWAPPS = $(GNUSTEP_INSTALLATION_DIR)/GSWApps
.PHONY: internal-gswapp-all_ \
internal-gswapp-install_ \
internal-gswapp-uninstall_ \
gswapp-components \
gswapp-webresource-dir \
gswapp-webresource-files \
gswapp-localized-webresource-files \
gswapp-resource-dir \
gswapp-resource-files \
gswapp-localized-resource-files
internal-gswapp-copy_into_dir
#
# Determine where to install. By default, install into GNUSTEP_GSWAPPS.
#
ifneq ($($(GNUSTEP_INSTANCE)_INSTALL_DIR),)
GSWAPP_INSTALL_DIR = $($(GNUSTEP_INSTANCE)_INSTALL_DIR)
endif
ifeq ($(GSWAPP_INSTALL_DIR),)
GSWAPP_INSTALL_DIR = $(GNUSTEP_GSWAPPS)
endif
# Libraries that go before the WO libraries
ALL_GSW_LIBS = \
@ -91,18 +86,28 @@ ALL_GSW_LIBS = \
GSWAPP_DIR_NAME = $(GNUSTEP_INSTANCE:=.$(GSWAPP_EXTENSION))
GSWAPP_DIR = $(GNUSTEP_BUILD_DIR)/$(GSWAPP_DIR_NAME)
GSWAPP_RESOURCE_DIRS = $(foreach d, $(RESOURCE_DIRS), $(GSWAPP_DIR)/Resources/$(d))
GSWAPP_WEBSERVER_RESOURCE_DIRS = $(foreach d, $(WEBSERVER_RESOURCE_DIRS), $(GSWAPP_DIR)/Resources/WebServer/$(d))
ifeq ($(strip $(LANGUAGES)),)
LANGUAGES="English"
endif
# Support building NeXT applications
#
# Now include the standard resource-bundle routines from Shared/bundle.make
#
ifneq ($(FOUNDATION_LIB), apple)
GSWAPP_FILE_NAME = \
$(GSWAPP_DIR_NAME)/$(GNUSTEP_TARGET_LDIR)/$(GNUSTEP_INSTANCE)$(EXEEXT)
# GNUstep bundle
GNUSTEP_SHARED_BUNDLE_RESOURCE_PATH = $(GSWAPP_DIR)/Resources
GSWAPP_INFO_PLIST_FILE = $(GSWAPP_DIR)/Resources/Info-gnustep.plist
else
GSWAPP_FILE_NAME = $(GSWAPP_DIR_NAME)/$(GNUSTEP_INSTANCE)$(EXEEXT)
# OSX bundle
GNUSTEP_SHARED_BUNDLE_RESOURCE_PATH = $(GSWAPP_DIR)/Contents/Resources
GSWAPP_INFO_PLIST_FILE = $(GSWAPP_DIR)/Contents/Info.plist
endif
GNUSTEP_SHARED_BUNDLE_MAIN_PATH = $(GSWAPP_DIR_NAME)
GNUSTEP_SHARED_BUNDLE_INSTALL_DIR = $(GSWAPP_INSTALL_DIR)
include $(GNUSTEP_MAKEFILES)/Instance/Shared/bundle.make
ifneq ($(FOUNDATION_LIB), apple)
GSWAPP_FILE_NAME = $(GSWAPP_DIR_NAME)/$(GNUSTEP_TARGET_LDIR)/$(GNUSTEP_INSTANCE)$(EXEEXT)
else
GSWAPP_FILE_NAME = $(GSWAPP_DIR_NAME)/Contents/MacOS/$(GNUSTEP_INSTANCE)$(EXEEXT)
endif
GSWAPP_FILE = $(GNUSTEP_BUILD_DIR)/$(GSWAPP_FILE_NAME)
@ -114,7 +119,6 @@ GSWAPP_FILE = $(GNUSTEP_BUILD_DIR)/$(GSWAPP_FILE_NAME)
$(GSWAPP_FILE): $(OBJ_FILES_TO_LINK)
$(ECHO_LINKING)$(LD) $(ALL_LDFLAGS) -o $(LDOUT)$@ $(OBJ_FILES_TO_LINK)\
$(ALL_GSW_LIBS)$(END_ECHO)
ifneq ($(FOUNDATION_LIB), apple)
$(ECHO_NOTHING)$(TRANSFORM_PATHS_SCRIPT) $(subst -L,,$(ALL_LIB_DIRS)) \
>$(GSWAPP_DIR)/$(GNUSTEP_TARGET_LDIR)/library_paths.openapp$(END_ECHO)
@ -125,162 +129,26 @@ endif
#
ifeq ($(FOUNDATION_LIB), apple)
internal-gswapp-all_:: \
$(GNUSTEP_OBJ_DIR) $(GSWAPP_DIR) $(GSWAPP_FILE) \
gswapp-components \
gswapp-localized-webresource-files \
gswapp-webresource-files \
gswapp-localized-resource-files \
gswapp-resource-files \
$(GSWAPP_DIR)/$(GNUSTEP_INSTANCE).sh
$(GNUSTEP_OBJ_DIR) \
$(GSWAPP_DIR)/Contents/MacOS \
$(GSWAPP_FILE) \
shared-instance-bundle-all \
$(GSWAPP_INFO_PLIST_FILE)
$(GSWAPP_DIR):
$(ECHO_CREATING)mkdir $@$(END_ECHO)
$(GSWAPP_DIR)/Contents/MacOS:
$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
else
internal-gswapp-all_:: \
$(GNUSTEP_OBJ_DIR) \
$(GSWAPP_DIR)/$(GNUSTEP_TARGET_LDIR) $(GSWAPP_FILE) \
gswapp-components \
gswapp-localized-webresource-files \
gswapp-webresource-files \
gswapp-localized-resource-files \
gswapp-resource-files \
$(GSWAPP_DIR)/$(GNUSTEP_INSTANCE).sh
internal-gswapp-all_:: $(GNUSTEP_OBJ_DIR) \
$(GSWAPP_DIR)/$(GNUSTEP_TARGET_LDIR) \
$(GSWAPP_FILE) \
$(GSWAPP_DIR)/Resources \
$(GSWAPP_INFO_PLIST_FILE) \
shared-instance-bundle-all
$(GSWAPP_DIR)/$(GNUSTEP_TARGET_LDIR):
$(ECHO_CREATING)$(MKDIRS) $(GSWAPP_DIR)/$(GNUSTEP_TARGET_LDIR)$(END_ECHO)
endif
$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
ifeq ($(GNUSTEP_INSTANCE)_GEN_SCRIPT,yes) #<==
$(GSWAPP_DIR)/$(GNUSTEP_INSTANCE).sh: $(GSWAPP_DIR)
$(ECHO_CREATING)(echo "#!/bin/sh"; \
echo '# Automatically generated, do not edit!'; \
echo '$${GNUSTEP_HOST_LDIR}/$(GNUSTEP_INSTANCE) $$1 $$2 $$3 $$4 $$5 $$6 $$7 $$8') >$@$(END_ECHO)
$(ECHO_NOTHING)chmod +x $@$(END_ECHO)
else
$(GSWAPP_DIR)/$(GNUSTEP_INSTANCE).sh:
endif
gswapp-components:: $(GSWAPP_DIR)/Resources
ifneq ($(strip $(COMPONENTS)),)
@ echo "Linking components into the application wrapper..."; \
cd $(GSWAPP_DIR)/Resources; \
for component in $(COMPONENTS); do \
if [ -d ../../$$component ]; then \
$(LN_S) -f ../../$$component ./;\
fi; \
done; \
echo "Linking localized components into the application wrapper..."; \
for l in $(LANGUAGES); do \
if [ -d ../../$$l.lproj ]; then \
$(MKDIRS) $$l.lproj; \
cd $$l.lproj; \
for f in $(COMPONENTS); do \
if [ -d ../../../$$l.lproj/$$f ]; then \
$(LN_S) -f ../../../$$l.lproj/$$f .;\
fi;\
done;\
cd ..; \
fi;\
done
endif
# FIXME - this is behaving differently than in gswbundle.make !
# It's also not behaving consistently with xxx_RESOURCE_DIRS
gswapp-webresource-dir:: $(GSWAPP_WEBSERVER_RESOURCE_DIRS)
ifneq ($(strip $(WEBSERVER_RESOURCE_DIRS)),)
@ echo "Linking webserver Resource Dirs into the application wrapper..."; \
cd $(GSWAPP_DIR)/Resources; \
for dir in $(WEBSERVER_RESOURCE_DIRS); do \
if [ -d ../../$$dir ]; then \
$(LN_S) -f ../../$$dir ./;\
fi; \
done;
endif
$(GSWAPP_WEBSERVER_RESOURCE_DIRS):
#@$(MKDIRS) $(GSWAPP_WEBSERVER_RESOURCE_DIRS)
gswapp-webresource-files:: $(GSWAPP_DIR)/Resources/WebServer \
gswapp-webresource-dir
ifneq ($(strip $(WEBSERVER_RESOURCE_FILES)),)
@echo "Linking webserver resources into the application wrapper..."; \
cd $(GSWAPP_DIR)/Resources/WebServer; \
for ff in $(WEBSERVER_RESOURCE_FILES); do \
$(LN_S) -f ../../WebServerResources/$$ff .;\
done
endif
gswapp-localized-webresource-files:: $(GSWAPP_DIR)/Resources/WebServer gswapp-webresource-dir
ifneq ($(strip $(LOCALIZED_WEBSERVER_RESOURCE_FILES)),)
@ echo "Linking localized web resources into the application wrapper..."; \
cd $(GSWAPP_DIR)/Resources/WebServer; \
for l in $(LANGUAGES); do \
if [ -d ../../WebServerResources/$$l.lproj ]; then \
$(MKDIRS) $$l.lproj;\
cd $$l.lproj; \
for f in $(LOCALIZED_WEBSERVER_RESOURCE_FILES); do \
if [ -f ../../../WebServerResources/$$l.lproj/$$f ]; then \
if [ ! -r $$f ]; then \
$(LN_S) ../../../WebServerResources/$$l.lproj/$$f $$f;\
fi;\
fi;\
done;\
cd ..; \
else\
echo "Warning - WebServerResources/$$l.lproj not found - ignoring";\
fi;\
done
endif
# This is not consistent with what other projects do ... so it can't stay
# this way. Use COMPONENTS instead.
gswapp-resource-dir:: $(GSWAPP_RESOURCE_DIRS)
ifneq ($(strip $(RESOURCE_DIRS)),)
@ echo "Linking Resource Dirs into the application wrapper..."; \
cd $(GSWAPP_DIR)/Resources; \
for dir in $(RESOURCE_DIRS); do \
if [ -d ../../$$dir ]; then \
$(LN_S) -f ../../$$dir ./;\
fi; \
done;
endif
$(GSWAPP_RESOURCE_DIRS):
#@$(MKDIRS) $(GSWAPP_RESOURCE_DIRS)
gswapp-resource-files:: $(GSWAPP_DIR)/Resources/Info-gnustep.plist \
gswapp-resource-dir
ifneq ($(strip $(RESOURCE_FILES)),)
@ echo "Linking resources into the application wrapper..."; \
cd $(GSWAPP_DIR)/Resources/; \
for ff in $(RESOURCE_FILES); do \
echo $$ff; \
$(LN_S) -f ../../$$ff .;\
done
endif
gswapp-localized-resource-files:: $(GSWAPP_DIR)/Resources \
gswapp-resource-dir
ifneq ($(strip $(LOCALIZED_RESOURCE_FILES)),)
@ echo "Linking localized resources into the application wrapper..."; \
cd $(GSWAPP_DIR)/Resources; \
for l in $(LANGUAGES); do \
if [ -d ../../$$l.lproj ]; then
$(MKDIRS) $$l.lproj; \
cd $$l.lproj; \
for f in $(LOCALIZED_RESOURCE_FILES); do \
if [ -f ../../../$$l.lproj/$$f ]; then \
echo $$l.lproj/$$ff; \
$(LN_S) -f ../../../$$l.lproj/$$f .;\
fi;\
done;\
cd ..; \
else \
echo "Warning - $$l.lproj not found - ignoring";\
fi;\
done
endif
PRINCIPAL_CLASS = $(strip $($(GNUSTEP_INSTANCE)_PRINCIPAL_CLASS))
@ -293,7 +161,7 @@ HAS_GSWCOMPONENTS = $($(GNUSTEP_INSTANCE)_HAS_GSWCOMPONENTS)
GSWAPP_INFO_PLIST = $($(GNUSTEP_INSTANCE)_GSWAPP_INFO_PLIST)
MAIN_MODEL_FILE = $(strip $(subst .gmodel,,$(subst .gorm,,$(subst .nib,,$($(GNUSTEP_INSTANCE)_MAIN_MODEL_FILE)))))
$(GSWAPP_DIR)/Resources/Info-gnustep.plist: $(GSWAPP_DIR)/Resources
$(GSWAPP_INFO_PLIST_FILE):
$(ECHO_CREATING)(echo "{"; echo ' NOTE = "Automatically generated, do not edit!";'; \
echo " NSExecutable = \"$(GNUSTEP_INSTANCE)\";"; \
echo " NSPrincipalClass = \"$(PRINCIPAL_CLASS)\";"; \
@ -309,24 +177,18 @@ $(GSWAPP_DIR)/Resources/Info-gnustep.plist: $(GSWAPP_DIR)/Resources
fi; \
echo "}") >$@$(END_ECHO)
$(GSWAPP_DIR)/Resources:
$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
internal-gswapp-copy_into_dir:: shared-instance-bundle-copy_into_dir
$(GSWAPP_DIR)/Resources/WebServer:
$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
# install/uninstall targets
internal-gswapp-install_::
$(ECHO_INSTALLING)$(MKINSTALLDIRS) $(GNUSTEP_GSWAPPS); \
rm -rf $(GNUSTEP_GSWAPPS)/$(GSWAPP_DIR_NAME); \
(cd $(GNUSTEP_BUILD_DIR); $(TAR) ch --exclude=CVS --to-stdout $(GSWAPP_DIR_NAME)) | (cd $(GNUSTEP_GSWAPPS); $(TAR) xf -)$(END_ECHO)
ifneq ($(CHOWN_TO),)
$(ECHO_CHOWNING)$(CHOWN) -R $(CHOWN_TO) $(GNUSTEP_GSWAPPS)/$(GSWAPP_DIR_NAME)$(END_ECHO)
endif
$(GSWAPP_INSTALL_DIR):
$(ECHO_CREATING)$(MKINSTALLDIRS) $@$(END_ECHO)
internal-gswapp-install_:: shared-instance-bundle-install
ifeq ($(strip),yes)
$(ECHO_STRIPPING)$(STRIP) $(GNUSTEP_GSWAPPS)/$(GSWAPP_FILE_NAME)$(END_ECHO)
$(ECHO_STRIPPING)$(STRIP) $(GSWAPP_INSTALL_DIR)/$(GSWAPP_FILE_NAME)$(END_ECHO)
endif
internal-gswapp-uninstall_::
$(ECHO_UNINSTALLING)(cd $(GNUSTEP_GSWAPPS); rm -rf $(GSWAPP_DIR_NAME))$(END_ECHO)
internal-gswapp-uninstall_:: shared-instance-bundle-uninstall
include $(GNUSTEP_MAKEFILES)/Instance/Shared/strings.make