4
# Instance Makefile rules to build GNUstep web based applications.
6
# Copyright (C) 1997-2004 Free Software Foundation, Inc.
8
# Author: Manuel Guesdon <mguesdon@sbuilders.com>,
9
# Nicola Pero <n.pero@mi.flashnet.it>
10
# Based on application.make by Ovidiu Predescu <ovidiu@net-community.com>
11
# Based on gswapp.make by Helge Hess, MDlink online service center GmbH.
12
# Based on the original version by Scott Christley.
14
# This file is part of the GNUstep Makefile Package.
16
# This library is free software; you can redistribute it and/or
17
# modify it under the terms of the GNU General Public License
18
# as published by the Free Software Foundation; either version 2
19
# of the License, or (at your option) any later version.
21
# You should have received a copy of the GNU General Public
22
# License along with this library; see the file COPYING.LIB.
23
# If not, write to the Free Software Foundation,
24
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
ifeq ($(RULES_MAKE_LOADED),)
27
include $(GNUSTEP_MAKEFILES)/rules.make
30
# FIXME/TODO - this file has not been updated to use
31
# Instance/Shared/bundle.make because it is linking resources instead of
35
# The name of the application is in the GSWAPP_NAME variable.
36
# The list of languages the app is localized in are in xxx_LANGUAGES <==
37
# The list of application resource file are in xxx_RESOURCE_FILES
38
# The list of localized application resource file are in
39
# xxx_LOCALIZED_RESOURCE_FILES <==
40
# The list of application resource directories are in xxx_RESOURCE_DIRS
41
# The list of application web server resource directories are in
42
# xxx_WEBSERVER_RESOURCE_DIRS <==
43
# The list of localized application web server resource directories are in
44
# xxx_LOCALIZED_WEBSERVER_RESOURCE_DIRS
45
# where xxx is the application name <==
47
# Determine the application directory extension
48
ifeq ($(profile), yes)
49
GSWAPP_EXTENSION = profile
52
GSWAPP_EXTENSION = debug
54
GSWAPP_EXTENSION = gswa
58
GNUSTEP_GSWAPPS = $(GNUSTEP_INSTALLATION_DIR)/GSWApps
60
.PHONY: internal-gswapp-all_ \
61
internal-gswapp-install_ \
62
internal-gswapp-uninstall_ \
63
internal-gswapp-copy_into_dir
66
# Determine where to install. By default, install into GNUSTEP_GSWAPPS.
68
ifneq ($($(GNUSTEP_INSTANCE)_INSTALL_DIR),)
69
GSWAPP_INSTALL_DIR = $($(GNUSTEP_INSTANCE)_INSTALL_DIR)
72
ifeq ($(GSWAPP_INSTALL_DIR),)
73
GSWAPP_INSTALL_DIR = $(GNUSTEP_GSWAPPS)
76
# Libraries that go before the WO libraries
78
$(shell $(WHICH_LIB_SCRIPT) \
80
$(ADDITIONAL_GSW_LIBS) $(AUXILIARY_GSW_LIBS) $(GSW_LIBS) \
81
$(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS) \
82
$(FND_LIBS) $(ADDITIONAL_OBJC_LIBS) $(AUXILIARY_OBJC_LIBS) \
83
$(OBJC_LIBS) $(SYSTEM_LIBS) $(TARGET_SYSTEM_LIBS) \
84
debug=$(debug) profile=$(profile) shared=$(shared) \
85
libext=$(LIBEXT) shared_libext=$(SHARED_LIBEXT))
87
GSWAPP_DIR_NAME = $(GNUSTEP_INSTANCE:=.$(GSWAPP_EXTENSION))
88
GSWAPP_DIR = $(GNUSTEP_BUILD_DIR)/$(GSWAPP_DIR_NAME)
91
# Now include the standard resource-bundle routines from Shared/bundle.make
94
ifneq ($(FOUNDATION_LIB), apple)
96
GNUSTEP_SHARED_BUNDLE_RESOURCE_PATH = $(GSWAPP_DIR)/Resources
97
GSWAPP_INFO_PLIST_FILE = $(GSWAPP_DIR)/Resources/Info-gnustep.plist
100
GNUSTEP_SHARED_BUNDLE_RESOURCE_PATH = $(GSWAPP_DIR)/Contents/Resources
101
GSWAPP_INFO_PLIST_FILE = $(GSWAPP_DIR)/Contents/Info.plist
103
GNUSTEP_SHARED_BUNDLE_MAIN_PATH = $(GSWAPP_DIR_NAME)
104
GNUSTEP_SHARED_BUNDLE_INSTALL_DIR = $(GSWAPP_INSTALL_DIR)
105
include $(GNUSTEP_MAKEFILES)/Instance/Shared/bundle.make
107
ifneq ($(FOUNDATION_LIB), apple)
108
GSWAPP_FILE_NAME = $(GSWAPP_DIR_NAME)/$(GNUSTEP_TARGET_LDIR)/$(GNUSTEP_INSTANCE)$(EXEEXT)
110
GSWAPP_FILE_NAME = $(GSWAPP_DIR_NAME)/Contents/MacOS/$(GNUSTEP_INSTANCE)$(EXEEXT)
113
GSWAPP_FILE = $(GNUSTEP_BUILD_DIR)/$(GSWAPP_FILE_NAME)
119
$(GSWAPP_FILE): $(OBJ_FILES_TO_LINK)
120
$(ECHO_LINKING)$(LD) $(ALL_LDFLAGS) -o $(LDOUT)$@ $(OBJ_FILES_TO_LINK)\
121
$(ALL_GSW_LIBS)$(END_ECHO)
122
ifneq ($(FOUNDATION_LIB), apple)
123
$(ECHO_NOTHING)$(TRANSFORM_PATHS_SCRIPT) $(subst -L,,$(ALL_LIB_DIRS)) \
124
>$(GSWAPP_DIR)/$(GNUSTEP_TARGET_LDIR)/library_paths.openapp$(END_ECHO)
128
# Compilation targets
130
ifeq ($(FOUNDATION_LIB), apple)
131
internal-gswapp-all_:: \
133
$(GSWAPP_DIR)/Contents/MacOS \
135
shared-instance-bundle-all \
136
$(GSWAPP_INFO_PLIST_FILE)
138
$(GSWAPP_DIR)/Contents/MacOS:
139
$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
142
internal-gswapp-all_:: $(GNUSTEP_OBJ_DIR) \
143
$(GSWAPP_DIR)/$(GNUSTEP_TARGET_LDIR) \
145
$(GSWAPP_DIR)/Resources \
146
$(GSWAPP_INFO_PLIST_FILE) \
147
shared-instance-bundle-all
149
$(GSWAPP_DIR)/$(GNUSTEP_TARGET_LDIR):
150
$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
154
PRINCIPAL_CLASS = $(strip $($(GNUSTEP_INSTANCE)_PRINCIPAL_CLASS))
156
ifeq ($(PRINCIPAL_CLASS),)
157
PRINCIPAL_CLASS = $(GNUSTEP_INSTANCE)
160
HAS_GSWCOMPONENTS = $($(GNUSTEP_INSTANCE)_HAS_GSWCOMPONENTS)
161
GSWAPP_INFO_PLIST = $($(GNUSTEP_INSTANCE)_GSWAPP_INFO_PLIST)
162
MAIN_MODEL_FILE = $(strip $(subst .gmodel,,$(subst .gorm,,$(subst .nib,,$($(GNUSTEP_INSTANCE)_MAIN_MODEL_FILE)))))
164
$(GSWAPP_INFO_PLIST_FILE):
165
$(ECHO_CREATING)(echo "{"; echo ' NOTE = "Automatically generated, do not edit!";'; \
166
echo " NSExecutable = \"$(GNUSTEP_INSTANCE)\";"; \
167
echo " NSPrincipalClass = \"$(PRINCIPAL_CLASS)\";"; \
168
if [ "$(HAS_GSWCOMPONENTS)" != "" ]; then \
169
echo " HasGSWComponents = \"$(HAS_GSWCOMPONENTS)\";"; \
171
echo " NSMainNibFile = \"$(MAIN_MODEL_FILE)\";"; \
172
if [ -r "$(GNUSTEP_INSTANCE)Info.plist" ]; then \
173
cat $(GNUSTEP_INSTANCE)Info.plist; \
175
if [ "$(GSWAPP_INFO_PLIST)" != "" ]; then \
176
cat $(GSWAPP_INFO_PLIST); \
178
echo "}") >$@$(END_ECHO)
180
internal-gswapp-copy_into_dir:: shared-instance-bundle-copy_into_dir
182
# install/uninstall targets
184
$(GSWAPP_INSTALL_DIR):
185
$(ECHO_CREATING)$(MKINSTALLDIRS) $@$(END_ECHO)
187
internal-gswapp-install_:: shared-instance-bundle-install
189
$(ECHO_STRIPPING)$(STRIP) $(GSWAPP_INSTALL_DIR)/$(GSWAPP_FILE_NAME)$(END_ECHO)
192
internal-gswapp-uninstall_:: shared-instance-bundle-uninstall
194
include $(GNUSTEP_MAKEFILES)/Instance/Shared/strings.make