]> err.no Git - sope/blob - gnustep-make/Master/application.make
fixed mapping of 'method' attribute
[sope] / gnustep-make / Master / application.make
1 #
2 #   application.make
3 #
4 #   Master makefile rules to build GNUstep-based applications.
5 #
6 #   Copyright (C) 1997, 2001, 2002 Free Software Foundation, Inc.
7 #
8 #   Author:  Nicola Pero <nicola@brainstorm.co.uk>
9 #   Author:  Ovidiu Predescu <ovidiu@net-community.com>
10 #   Based on the original version by Scott Christley.
11 #
12 #   This file is part of the GNUstep Makefile Package.
13 #
14 #   This library is free software; you can redistribute it and/or
15 #   modify it under the terms of the GNU General Public License
16 #   as published by the Free Software Foundation; either version 2
17 #   of the License, or (at your option) any later version.
18 #   
19 #   You should have received a copy of the GNU General Public
20 #   License along with this library; see the file COPYING.LIB.
21 #   If not, write to the Free Software Foundation,
22 #   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
24 ifeq ($(RULES_MAKE_LOADED),)
25 include $(GNUSTEP_MAKEFILES)/rules.make
26 endif
27
28 APP_NAME := $(strip $(APP_NAME))
29
30 internal-all:: $(APP_NAME:=.all.app.variables)
31
32 internal-install:: $(APP_NAME:=.install.app.variables)
33
34 internal-uninstall:: $(APP_NAME:=.uninstall.app.variables)
35
36 # Compute them manually to avoid having to do an Instance make
37 # invocation just to remove them.
38 _PSWRAP_C_FILES = $(foreach app,$(APP_NAME),$($(app)_PSWRAP_FILES:.psw=.c))
39 _PSWRAP_H_FILES = $(foreach app,$(APP_NAME),$($(app)_PSWRAP_FILES:.psw=.h))
40 # The following intricate code computes the list of xxxInfo.plist files
41 # for all applications xxx which have xxx_PREPROCESS_INFO_PLIST=yes.
42 _PLIST_INFO_FILES = $(addsuffix Info.plist,$(foreach app,$(APP_NAME),$(patsubst yes,$(app),$($(app)_PREPROCESS_INFO_PLIST))))
43
44 internal-clean::
45 ifeq ($(GNUSTEP_FLATTENED),)
46         (cd $(GNUSTEP_BUILD_DIR); \
47         rm -rf $(GNUSTEP_OBJ_DIR_NAME) $(_PSWRAP_C_FILES) $(_PSWRAP_H_FILES) \
48           $(_PLIST_INFO_FILES) *.$(APP_EXTENSION)/$(GNUSTEP_TARGET_LDIR))
49 else
50         (cd $(GNUSTEP_BUILD_DIR); \
51         rm -rf $(GNUSTEP_OBJ_DIR_NAME) $(_PSWRAP_C_FILES) $(_PSWRAP_H_FILES) \
52           $(_PLIST_INFO_FILES) *.$(APP_EXTENSION))
53 endif
54
55 internal-distclean::
56         (cd $(GNUSTEP_BUILD_DIR); \
57         rm -rf shared_obj static_obj shared_debug_obj shared_profile_obj \
58           static_debug_obj static_profile_obj shared_profile_debug_obj \
59           static_profile_debug_obj *.app *.debug *.profile)
60
61 # The following make trick extracts all tools in APP_NAME for which
62 # the xxx_SUBPROJECTS variable is set to something non-empty.
63 # For those apps (and only for them), we need to run 'clean' and
64 # 'distclean' in subprojects too.
65 #
66 # Please note that newer GNU make has a $(if condition,then,else)
67 # function, which would be so handy here!  But unfortunately it's not
68 # available in older GNU makes, so we must not use it.  This trick
69 # works around this problem.
70
71 APPS_WITH_SUBPROJECTS = $(strip $(foreach app,$(APP_NAME),$(patsubst %,$(app),$($(app)_SUBPROJECTS))))
72 ifneq ($(APPS_WITH_SUBPROJECTS),)
73 internal-clean:: $(APPS_WITH_SUBPROJECTS:=.clean.app.subprojects)
74 internal-distclean:: $(APPS_WITH_SUBPROJECTS:=.distclean.app.subprojects)
75 endif
76
77 internal-strings:: $(APP_NAME:=.strings.app.variables)
78
79 # FIXME - GNUSTEP_BUILD_DIR here.  Btw should we remove this or
80 # provide a better more general way of doing it ?
81 $(APP_NAME):
82         @$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory $@.all.app.variables