1 |
# @configure_input@ |
2 |
# |
3 |
# Main GNUmakefile for the GNUstep GNUmakefile Package. |
4 |
# |
5 |
# Copyright (C) 1997-2002 Free Software Foundation, Inc. |
6 |
# |
7 |
# Author: Scott Christley <scottc@net-community.com> |
8 |
# Author: Nicola Pero <n.pero@mi.flashnet.it> |
9 |
# |
10 |
# This file is part of the GNUstep Makefile Package. |
11 |
# |
12 |
# This library is free software; you can redistribute it and/or |
13 |
# modify it under the terms of the GNU General Public License |
14 |
# as published by the Free Software Foundation; either version 2 |
15 |
# of the License, or (at your option) any later version. |
16 |
# |
17 |
# You should have received a copy of the GNU General Public |
18 |
# License along with this library; see the file COPYING.LIB. |
19 |
# If not, write to the Free Software Foundation, |
20 |
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 |
|
22 |
# |
23 |
# I've thought about using the Makefile package files |
24 |
# to install the GNUmakefile package, a cool little recursion, |
25 |
# but there is nothing to made, and the files get installed |
26 |
# in a special directory, so it was simpler this way. |
27 |
# |
28 |
|
29 |
include config.make |
30 |
|
31 |
# To install everything inside a temporary directory (say as part of |
32 |
# building a binary package - deb or rpm), use something like `make |
33 |
# install special_prefix=/var/tmp/gnustep-make' |
34 |
special_prefix = |
35 |
|
36 |
GNUSTEP_SYSTEM_ROOT = $(special_prefix)@prefix@ |
37 |
GNUSTEP_LOCAL_ROOT = $(special_prefix)@GNUSTEP_LOCAL_ROOT@ |
38 |
GNUSTEP_NETWORK_ROOT = $(special_prefix)@GNUSTEP_NETWORK_ROOT@ |
39 |
srcdir = @srcdir@ |
40 |
VPATH = @srcdir@ |
41 |
|
42 |
GNUSTEP_FLATTENED = @GNUSTEP_FLATTENED@ |
43 |
GNUSTEP_TARGET_CPU = @clean_target_cpu@ |
44 |
GNUSTEP_TARGET_VENDOR = @clean_target_vendor@ |
45 |
GNUSTEP_TARGET_OS = @clean_target_os@ |
46 |
|
47 |
GNUSTEP_LIB_COMBO = @ac_cv_library_combo@ |
48 |
|
49 |
ifeq ($(GNUSTEP_FLATTENED),) |
50 |
GNUSTEP_TARGET_DIR = $(GNUSTEP_TARGET_CPU)/$(GNUSTEP_TARGET_OS) |
51 |
GNUSTEP_TARGET_LDIR = $(GNUSTEP_TARGET_DIR)/$(GNUSTEP_LIB_COMBO) |
52 |
MAYBE_LIBRARY_COMBO = $(GNUSTEP_LIB_COMBO) |
53 |
else |
54 |
GNUSTEP_TARGET_DIR = . |
55 |
GNUSTEP_TARGET_LDIR = . |
56 |
MAYBE_LIBRARY_COMBO = . |
57 |
endif |
58 |
|
59 |
export GNUSTEP_TARGET_DIR |
60 |
export GNUSTEP_TARGET_LDIR |
61 |
export MAYBE_LIBRARY_COMBO |
62 |
|
63 |
makedir = $(GNUSTEP_SYSTEM_ROOT)/@MAKEFILES_SUFFIX@ |
64 |
tooldir = $(GNUSTEP_SYSTEM_ROOT)/Tools |
65 |
|
66 |
INSTALL = @INSTALL@ |
67 |
INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
68 |
INSTALL_DATA = @INSTALL_DATA@ |
69 |
|
70 |
VERTAG = $(subst .,_,$(GNUSTEP_MAKE_VERSION)) |
71 |
|
72 |
MAKE_FILES = aggregate.make application.make bundle.make service.make \ |
73 |
common.make library-combo.make java.make jni.make library.make \ |
74 |
messages.make rules.make target.make names.make resource-set.make \ |
75 |
tool.make ctool.make test-library.make \ |
76 |
objc.make test-application.make test-tool.make subproject.make \ |
77 |
palette.make gswapp.make gswbundle.make clibrary.make \ |
78 |
documentation.make \ |
79 |
java-executable.template java-tool.make framework.make \ |
80 |
spec-rules.template spec-debug-rules.template \ |
81 |
spec-debug-alone-rules.template |
82 |
|
83 |
MASTER_MAKE_FILES = \ |
84 |
aggregate.make source-distribution.make rpm.make rules.make \ |
85 |
application.make bundle.make clibrary.make ctool.make \ |
86 |
documentation.make framework.make gswapp.make gswbundle.make \ |
87 |
library.make objc.make java.make java-tool.make palette.make \ |
88 |
resource-set.make service.make subproject.make test-application.make \ |
89 |
test-library.make test-tool.make tool.make |
90 |
|
91 |
INSTANCE_MAKE_FILES = \ |
92 |
rules.make \ |
93 |
application.make bundle.make clibrary.make ctool.make \ |
94 |
documentation.make framework.make gswapp.make gswbundle.make \ |
95 |
library.make objc.make java.make java-tool.make palette.make \ |
96 |
resource-set.make service.make subproject.make test-application.make \ |
97 |
test-library.make test-tool.make tool.make |
98 |
|
99 |
INSTANCE_SHARED_MAKE_FILES = bundle.make headers.make java.make \ |
100 |
stamp-string.make strings.make |
101 |
|
102 |
INSTANCE_DOC_MAKE_FILES = autogsdoc.make gsdoc.make install_files.make \ |
103 |
javadoc.make latex.make texi.make |
104 |
|
105 |
|
106 |
all: generated-files which_lib$(EXEEXT) user_home$(EXEEXT) |
107 |
|
108 |
# Please note that you should use a bit of care in the following rule, |
109 |
# because it must work in a directory which is not the source |
110 |
# directory - so for example $<, rather than which_lib.c, must be |
111 |
# used. (I mean: 'cd core/make; cd ..; mkdir make-build; cd |
112 |
# make-build; ../make/configure --disable-import; make;' must work) |
113 |
which_lib$(EXEEXT): which_lib.c config.h |
114 |
$(CC) @CFLAGS@ -Wall -I. -o $@ $< |
115 |
|
116 |
user_home$(EXEEXT): user_home.c config.h |
117 |
$(CC) @CFLAGS@ -DGNUSTEP_SYSTEM_ROOT=$(GNUSTEP_SYSTEM_ROOT) \ |
118 |
-Wall -I. -o $@ $< |
119 |
|
120 |
ifeq ($(messages),yes) |
121 |
EC = |
122 |
else |
123 |
EC = @ |
124 |
endif |
125 |
|
126 |
move_obsolete: |
127 |
$(EC)(echo "Moving paths from old heirarchy: "; \ |
128 |
$(srcdir)/move_obsolete_paths.sh $(GNUSTEP_SYSTEM_ROOT) $(GNUSTEP_LOCAL_ROOT) $(GNUSTEP_USER_ROOT)) |
129 |
|
130 |
install: all @GNUSTEP_MOVE_OBSOLETE@ |
131 |
$(EC)(echo "Creating system domain: $(GNUSTEP_SYSTEM_ROOT)"; \ |
132 |
$(srcdir)/create_domain_dir_tree.sh $(GNUSTEP_SYSTEM_ROOT); \ |
133 |
echo "Creating local and network dirs: $(GNUSTEP_LOCAL_ROOT), $(GNUSTEP_NETWORK_ROOT)"; \ |
134 |
$(srcdir)/mkinstalldirs $(GNUSTEP_LOCAL_ROOT) $(GNUSTEP_NETWORK_ROOT);\ |
135 |
echo "Creating makefile directories in: $(makedir)"; \ |
136 |
$(srcdir)/mkinstalldirs \ |
137 |
$(makedir) \ |
138 |
$(makedir)/$(GNUSTEP_TARGET_CPU) \ |
139 |
$(makedir)/$(GNUSTEP_TARGET_DIR) \ |
140 |
$(makedir)/Additional \ |
141 |
$(makedir)/Auxiliary \ |
142 |
$(makedir)/Master \ |
143 |
$(makedir)/Instance \ |
144 |
$(makedir)/Instance/Shared \ |
145 |
$(makedir)/Instance/Documentation) |
146 |
-$(EC) rm -f $(GNUSTEP_SYSTEM_ROOT)/Makefiles |
147 |
ifeq ($(HAS_LN_S), yes) |
148 |
$(EC) (cd $(GNUSTEP_SYSTEM_ROOT); $(LN_S) @MAKEFILES_SUFFIX@ Makefiles) |
149 |
endif |
150 |
$(EC)(echo "Installing gnustep-make support software"; \ |
151 |
$(INSTALL_PROGRAM) -m 755 which_lib$(EXEEXT) \ |
152 |
$(makedir)/$(GNUSTEP_TARGET_DIR); \ |
153 |
$(INSTALL_PROGRAM) -m 755 user_home$(EXEEXT) \ |
154 |
$(makedir)/$(GNUSTEP_TARGET_DIR)) |
155 |
$(EC)(for f in config.guess config.sub install-sh mkinstalldirs \ |
156 |
clean_cpu.sh clean_os.sh \ |
157 |
clean_vendor.sh cpu.sh GNUstep-reset.sh \ |
158 |
ld_lib_path.sh os.sh transform_paths.sh vendor.sh \ |
159 |
ld_lib_path.csh relative_path.sh ; do \ |
160 |
$(INSTALL_PROGRAM) -m 755 $(srcdir)/$$f $(makedir); \ |
161 |
done) |
162 |
$(EC)($(INSTALL_PROGRAM) -m 755 GNUstep.sh $(makedir); \ |
163 |
$(INSTALL_PROGRAM) -m 755 GNUstep.csh $(makedir); \ |
164 |
$(INSTALL_PROGRAM) -m 755 fixpath.sh $(makedir); \ |
165 |
$(INSTALL_PROGRAM) -m 755 openapp $(tooldir); \ |
166 |
$(INSTALL_PROGRAM) -m 755 debugapp $(tooldir); \ |
167 |
$(INSTALL_PROGRAM) -m 755 opentool $(tooldir)) |
168 |
$(EC)(echo "Installing makefiles"; \ |
169 |
for f in $(MAKE_FILES); do \ |
170 |
$(INSTALL_DATA) $(srcdir)/$$f $(makedir); \ |
171 |
done; \ |
172 |
for f in $(MASTER_MAKE_FILES); do \ |
173 |
$(INSTALL_DATA) $(srcdir)/Master/$$f $(makedir)/Master; \ |
174 |
done; \ |
175 |
for f in $(INSTANCE_MAKE_FILES); do \ |
176 |
$(INSTALL_DATA) $(srcdir)/Instance/$$f $(makedir)/Instance; \ |
177 |
done; \ |
178 |
for f in $(INSTANCE_SHARED_MAKE_FILES); do \ |
179 |
$(INSTALL_DATA) $(srcdir)/Instance/Shared/$$f \ |
180 |
$(makedir)/Instance/Shared; \ |
181 |
done; \ |
182 |
for f in $(INSTANCE_DOC_MAKE_FILES); do \ |
183 |
$(INSTALL_DATA) $(srcdir)/Instance/Documentation/$$f \ |
184 |
$(makedir)/Instance/Documentation; \ |
185 |
done; \ |
186 |
$(INSTALL_DATA) executable.template $(makedir); \ |
187 |
$(INSTALL_DATA) config.make $(makedir)/$(GNUSTEP_TARGET_DIR)) |
188 |
$(EC)($(srcdir)/mkinstalldirs $(GNUSTEP_SYSTEM_ROOT)/share; \ |
189 |
$(INSTALL_DATA) $(srcdir)/config.site $(GNUSTEP_SYSTEM_ROOT)/share) |
190 |
|
191 |
# |
192 |
# NICOLA - Need to clean the following message and print it at the end |
193 |
# of the install rule |
194 |
# |
195 |
# @echo "" |
196 |
# @echo "IMPORTANT: you need to execute a shell initialization script" |
197 |
# @echo "before you can use gnustep-make. The command to run the shell" |
198 |
# @echo "initialization script is:" |
199 |
# @echo ". $(makedir)/GNUstep.sh" |
200 |
# @echo "(be careful to put the space after the dot)" |
201 |
# @echo "Please run it now." |
202 |
# @echo "" |
203 |
|
204 |
uninstall: |
205 |
rm -f $(makedir)/$(GNUSTEP_TARGET_DIR)/which_lib$(EXEEXT) |
206 |
rm -f $(makedir)/$(GNUSTEP_TARGET_DIR)/user_home$(EXEEXT) |
207 |
for f in config.guess config.sub install-sh mkinstalldirs \ |
208 |
clean_cpu.sh clean_os.sh \ |
209 |
clean_vendor.sh cpu.sh ld_lib_path.sh os.sh \ |
210 |
transform_paths.sh vendor.sh \ |
211 |
ld_lib_path.csh fixpath.sh \ |
212 |
GNUstep.sh GNUstep.csh ; do \ |
213 |
rm -f $(makedir)/$$f; \ |
214 |
done |
215 |
rm -f $(tooldir)/openapp; \ |
216 |
rm -f $(tooldir)/debugapp; \ |
217 |
rm -f $(tooldir)/opentool; \ |
218 |
for f in $(MAKE_FILES); do \ |
219 |
rm -f $(makedir)/$$f; \ |
220 |
done |
221 |
rm -f $(makedir)/executable.template |
222 |
rm -f $(GNUSTEP_SYSTEM_ROOT)/share/config.site |
223 |
rm -f $(makedir)/$(GNUSTEP_TARGET_DIR)/config.make |
224 |
|
225 |
# To really uninstall all of GNUstep, a 'rm -Rf ${GNUSTEP_ROOT}' should do. |
226 |
|
227 |
clean: |
228 |
rm -f *~ which_lib$(EXEEXT) user_home$(EXEEXT) \ |
229 |
Master/*~ Instance/*~ Instance/Shared/*~ |
230 |
|
231 |
distclean: clean |
232 |
rm -f GNUmakefile config.make config.h |
233 |
rm -f config.cache config.log config.status |
234 |
rm -f openapp |
235 |
rm -f debugapp |
236 |
rm -f opentool |
237 |
rm -f executable.template |
238 |
rm -f GNUmakefile |
239 |
rm -f GNUstep.sh |
240 |
rm -f GNUstep.csh |
241 |
rm -f fixpath.sh |
242 |
rm -f gnustep-make.spec |
243 |
rm -f Documentation/GNUmakefile |
244 |
|
245 |
cvs-tag: |
246 |
cvs -z3 rtag make-$(VERTAG) make |
247 |
|
248 |
cvs-dist: |
249 |
cvs -z3 export -r make-$(VERTAG) make |
250 |
mv make gnustep-make-$(GNUSTEP_MAKE_VERSION) |
251 |
tar --gzip -cf gnustep-make-$(GNUSTEP_MAKE_VERSION).tar.gz gnustep-make-$(GNUSTEP_MAKE_VERSION) |
252 |
rm -rf gnustep-make-$(GNUSTEP_MAKE_VERSION) |
253 |
|
254 |
cvs-snapshot: |
255 |
cvs -z3 export -D now make |
256 |
mv make gnustep-make-$(GNUSTEP_MAKE_VERSION) |
257 |
tar --gzip -cf gnustep-make-$(GNUSTEP_MAKE_VERSION).tar.gz gnustep-make-$(GNUSTEP_MAKE_VERSION) |
258 |
rm -rf gnustep-make-$(GNUSTEP_MAKE_VERSION) |
259 |
|
260 |
test-RPM_TOPDIR: |
261 |
@(if [ -z "$(RPM_TOPDIR)" ]; then \ |
262 |
echo "Error - RPM_TOPDIR variable not set."; \ |
263 |
echo "You need to set it to the top of your rpm directory tree"; \ |
264 |
exit 1; \ |
265 |
fi) |
266 |
|
267 |
# The check for rpmbuild is for old RPM versions which didn't have |
268 |
# rpmbuild and used 'rpm -ba' instead. It can be removed when we are |
269 |
# reasonably sure no more old RPM versions (not having rpmbuild), are |
270 |
# still around. |
271 |
rpm: test-RPM_TOPDIR dist |
272 |
cp ../gnustep-make-$(GNUSTEP_MAKE_VERSION).tar.gz $(RPM_TOPDIR)/SOURCES/ |
273 |
cp gnustep-make.spec $(RPM_TOPDIR)/SPECS/ |
274 |
cd $(RPM_TOPDIR)/SPECS/ |
275 |
if which rpmbuild > /dev/null 2>/dev/null; then \ |
276 |
rpmbuild="rpmbuild"; \ |
277 |
else \ |
278 |
if which rpm > /dev/null 2>/dev/null; then \ |
279 |
rpmbuild="rpm"; \ |
280 |
else \ |
281 |
echo "Error: You don't have rpm installed!"; \ |
282 |
rpmbuild="rpmbuild"; \ |
283 |
fi; \ |
284 |
fi; \ |
285 |
$${rpmbuild} -ba gnustep-make.spec |
286 |
|
287 |
generated-files: GNUmakefile GNUstep.sh GNUstep.csh fixpath.sh config.h config.make debugapp openapp opentool gnustep-make.spec executable.template |
288 |
|
289 |
GNUmakefile: GNUmakefile.in config.status |
290 |
$(SHELL) config.status |
291 |
|
292 |
GNUstep.sh: GNUstep.sh.in |
293 |
$(SHELL) config.status |
294 |
|
295 |
GNUstep.csh: GNUstep.csh.in |
296 |
$(SHELL) config.status |
297 |
|
298 |
fixpath.sh: fixpath.sh.in |
299 |
$(SHELL) config.status |
300 |
|
301 |
config.h: config.h.in |
302 |
$(SHELL) config.status |
303 |
|
304 |
config.make: config.make.in Version |
305 |
$(SHELL) config.status --recheck |
306 |
|
307 |
debugapp: debugapp.in |
308 |
$(SHELL) config.status |
309 |
|
310 |
openapp: openapp.in |
311 |
$(SHELL) config.status |
312 |
|
313 |
opentool: opentool.in |
314 |
$(SHELL) config.status |
315 |
|
316 |
gnustep-make.spec: gnustep-make.spec.in Version |
317 |
$(SHELL) config.status --recheck |
318 |
|
319 |
executable.template: executable.template.in |
320 |
$(SHELL) config.status |