3 # Main GNUmakefile for the GNUstep GNUmakefile Package.
5 # Copyright (C) 1997-2002 Free Software Foundation, Inc.
7 # Author: Scott Christley <scottc@net-community.com>
8 # Author: Nicola Pero <n.pero@mi.flashnet.it>
10 # This file is part of the GNUstep Makefile Package.
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.
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.
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.
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'
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@
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@
47 GNUSTEP_LIB_COMBO = @ac_cv_library_combo@
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)
54 GNUSTEP_TARGET_DIR = .
55 GNUSTEP_TARGET_LDIR = .
56 MAYBE_LIBRARY_COMBO = .
59 export GNUSTEP_TARGET_DIR
60 export GNUSTEP_TARGET_LDIR
61 export MAYBE_LIBRARY_COMBO
63 makedir = $(GNUSTEP_SYSTEM_ROOT)/@MAKEFILES_SUFFIX@
64 tooldir = $(GNUSTEP_SYSTEM_ROOT)/Tools
67 INSTALL_PROGRAM = @INSTALL_PROGRAM@
68 INSTALL_DATA = @INSTALL_DATA@
70 VERTAG = $(subst .,_,$(GNUSTEP_MAKE_VERSION))
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 \
79 java-executable.template java-tool.make framework.make \
80 native-library.make spec-rules.template spec-debug-rules.template \
81 spec-debug-alone-rules.template \
85 aggregate.make source-distribution.make rpm.make rules.make \
86 application.make bundle.make clibrary.make ctool.make \
87 documentation.make framework.make gswapp.make gswbundle.make \
88 library.make objc.make java.make java-tool.make palette.make \
89 resource-set.make service.make subproject.make test-application.make \
90 test-library.make test-tool.make tool.make
92 INSTANCE_MAKE_FILES = \
94 application.make bundle.make clibrary.make ctool.make \
95 documentation.make framework.make gswapp.make gswbundle.make \
96 library.make objc.make java.make java-tool.make palette.make \
97 resource-set.make service.make subproject.make test-application.make \
98 test-library.make test-tool.make tool.make
100 INSTANCE_SHARED_MAKE_FILES = bundle.make headers.make java.make \
101 stamp-string.make strings.make
103 INSTANCE_DOC_MAKE_FILES = autogsdoc.make gsdoc.make install_files.make \
104 javadoc.make latex.make texi.make
106 all: generated-files which_lib$(EXEEXT) user_home$(EXEEXT)
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 $@ $<
116 user_home$(EXEEXT): user_home.c config.h
117 $(CC) @CFLAGS@ -DGNUSTEP_SYSTEM_ROOT=$(GNUSTEP_SYSTEM_ROOT) \
120 ifeq ($(messages),yes)
127 $(EC)(echo "Moving paths from old heirarchy: "; \
128 $(srcdir)/move_obsolete_paths.sh $(GNUSTEP_SYSTEM_ROOT) $(GNUSTEP_LOCAL_ROOT) $(GNUSTEP_USER_ROOT))
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 \
138 $(makedir)/$(GNUSTEP_TARGET_CPU) \
139 $(makedir)/$(GNUSTEP_TARGET_DIR) \
140 $(makedir)/Additional \
141 $(makedir)/Auxiliary \
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)
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 strip_makefiles.sh; do \
160 $(INSTALL_PROGRAM) -m 755 $(srcdir)/$$f $(makedir); \
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); \
172 for f in $(MASTER_MAKE_FILES); do \
173 $(INSTALL_DATA) $(srcdir)/Master/$$f $(makedir)/Master; \
175 for f in $(INSTANCE_MAKE_FILES); do \
176 $(INSTALL_DATA) $(srcdir)/Instance/$$f $(makedir)/Instance; \
178 for f in $(INSTANCE_SHARED_MAKE_FILES); do \
179 $(INSTALL_DATA) $(srcdir)/Instance/Shared/$$f \
180 $(makedir)/Instance/Shared; \
182 for f in $(INSTANCE_DOC_MAKE_FILES); do \
183 $(INSTALL_DATA) $(srcdir)/Instance/Documentation/$$f \
184 $(makedir)/Instance/Documentation; \
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 $(EC)(echo "Installing system GNUsteprc"; \
191 $(INSTALL_DATA) GNUsteprc $(GNUSTEP_SYSTEM_ROOT)/.GNUsteprc)
192 $(EC)(if [ "@GNUSTEP_STRIP_MAKEFILES@" = "strip" ]; then \
193 echo "Stripping makefiles and shell scripts..."; \
194 cd $(makedir); ./strip_makefiles.sh; \
198 # NICOLA - Need to clean the following message and print it at the end
199 # of the install rule
202 # @echo "IMPORTANT: you need to execute a shell initialization script"
203 # @echo "before you can use gnustep-make. The command to run the shell"
204 # @echo "initialization script is:"
205 # @echo ". $(makedir)/GNUstep.sh"
206 # @echo "(be careful to put the space after the dot)"
207 # @echo "Please run it now."
211 rm -f $(makedir)/$(GNUSTEP_TARGET_DIR)/which_lib$(EXEEXT)
212 rm -f $(makedir)/$(GNUSTEP_TARGET_DIR)/user_home$(EXEEXT)
213 for f in config.guess config.sub install-sh mkinstalldirs \
214 clean_cpu.sh clean_os.sh \
215 clean_vendor.sh cpu.sh ld_lib_path.sh os.sh \
216 transform_paths.sh vendor.sh \
217 ld_lib_path.csh fixpath.sh \
218 GNUstep.sh GNUstep.csh GNUstep-reset.sh \
219 relative_path.sh strip_makefiles.sh; do \
220 rm -f $(makedir)/$$f; \
222 rm -f $(tooldir)/openapp; \
223 rm -f $(tooldir)/debugapp; \
224 rm -f $(tooldir)/opentool; \
225 for f in $(MAKE_FILES); do \
226 rm -f $(makedir)/$$f; \
228 for f in $(MASTER_MAKE_FILES); do \
229 rm -f $(makedir)/Master/$$f; \
231 for f in $(INSTANCE_MAKE_FILES); do \
232 rm -f $(makedir)/Instance/$$f; \
234 for f in $(INSTANCE_SHARED_MAKE_FILES); do \
235 rm -f $(makedir)/Instance/Shared/$$f; \
237 for f in $(INSTANCE_DOC_MAKE_FILES); do \
238 rm -f $(makedir)/Instance/Documentation/$$f; \
240 rm -f $(makedir)/executable.template
241 rm -f $(GNUSTEP_SYSTEM_ROOT)/share/config.site
242 rm -f $(makedir)/$(GNUSTEP_TARGET_DIR)/config.make
243 rm -f $(GNUSTEP_SYSTEM_ROOT)/.GNUsteprc
244 -for f in $(makedir)/$(GNUSTEP_TARGET_CPU) \
245 $(makedir)/$(GNUSTEP_TARGET_DIR) \
246 $(makedir)/Additional \
247 $(makedir)/Auxiliary \
249 $(makedir)/Instance/Shared \
250 $(makedir)/Instance/Documentation \
251 $(makedir)/Instance; do \
254 # To really uninstall all of GNUstep, a 'rm -Rf ${GNUSTEP_ROOT}' should do.
257 rm -f *~ which_lib$(EXEEXT) user_home$(EXEEXT) \
258 Master/*~ Instance/*~ Instance/Shared/*~
261 rm -f GNUmakefile config.make config.h
262 rm -f config.cache config.log config.status
266 rm -f executable.template
270 rm -f gnustep-make.spec
274 cvs -z3 rtag make-$(VERTAG) make
277 cvs -z3 export -r make-$(VERTAG) make
278 mv make gnustep-make-$(GNUSTEP_MAKE_VERSION)
279 tar --gzip -cf gnustep-make-$(GNUSTEP_MAKE_VERSION).tar.gz gnustep-make-$(GNUSTEP_MAKE_VERSION)
280 rm -rf gnustep-make-$(GNUSTEP_MAKE_VERSION)
283 cvs -z3 export -D now make
284 mv make gnustep-make-$(GNUSTEP_MAKE_VERSION)
285 tar --gzip -cf gnustep-make-$(GNUSTEP_MAKE_VERSION).tar.gz gnustep-make-$(GNUSTEP_MAKE_VERSION)
286 rm -rf gnustep-make-$(GNUSTEP_MAKE_VERSION)
289 @(if [ -z "$(RPM_TOPDIR)" ]; then \
290 echo "Error - RPM_TOPDIR variable not set."; \
291 echo "You need to set it to the top of your rpm directory tree"; \
295 # The check for rpmbuild is for old RPM versions which didn't have
296 # rpmbuild and used 'rpm -ba' instead. It can be removed when we are
297 # reasonably sure no more old RPM versions (not having rpmbuild), are
299 rpm: test-RPM_TOPDIR dist
300 cp ../gnustep-make-$(GNUSTEP_MAKE_VERSION).tar.gz $(RPM_TOPDIR)/SOURCES/
301 cp gnustep-make.spec $(RPM_TOPDIR)/SPECS/
302 cd $(RPM_TOPDIR)/SPECS/
303 if which rpmbuild > /dev/null 2>/dev/null; then \
304 rpmbuild="rpmbuild"; \
306 if which rpm > /dev/null 2>/dev/null; then \
309 echo "Error: You don't have rpm installed!"; \
310 rpmbuild="rpmbuild"; \
313 $${rpmbuild} -ba gnustep-make.spec
315 generated-files: GNUmakefile GNUstep.sh GNUstep.csh fixpath.sh config.h config.make debugapp openapp opentool gnustep-make.spec executable.template
317 GNUmakefile: GNUmakefile.in config.status
318 $(SHELL) config.status
320 GNUstep.sh: GNUstep.sh.in
321 $(SHELL) config.status
323 GNUstep.csh: GNUstep.csh.in
324 $(SHELL) config.status
326 fixpath.sh: fixpath.sh.in
327 $(SHELL) config.status
329 config.h: config.h.in
330 $(SHELL) config.status
332 config.make: config.make.in Version
333 $(SHELL) config.status --recheck
335 debugapp: debugapp.in
336 $(SHELL) config.status
339 $(SHELL) config.status
341 opentool: opentool.in
342 $(SHELL) config.status
344 gnustep-make.spec: gnustep-make.spec.in Version
345 $(SHELL) config.status --recheck
347 executable.template: executable.template.in
348 $(SHELL) config.status