Commit | Line | Data |
---|---|---|
fecd2382 RP |
1 | # Makefile for GNU Assembler |
2 | # Copyright (C) 1987, 1988, 1990, 1991 Free Software Foundation, Inc. | |
3 | ||
4 | #This file is part of GNU GAS. | |
5 | ||
6 | #GNU GAS is free software; you can redistribute it and/or modify | |
7 | #it under the terms of the GNU General Public License as published by | |
8 | #the Free Software Foundation; either version 1, or (at your option) | |
9 | #any later version. | |
10 | ||
11 | #GNU GAS is distributed in the hope that it will be useful, | |
12 | #but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | #GNU General Public License for more details. | |
15 | ||
16 | #You should have received a copy of the GNU General Public License | |
17 | #along with GNU GAS; see the file COPYING. If not, write to | |
18 | #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
19 | ||
20 | # $Id$ | |
21 | ||
22 | # The targets for external use include: | |
23 | # all, doc, proto, install, uninstall, includes, TAGS, | |
24 | # clean, cleanconfig, realclean, stage1, stage2, stage3, stage4. | |
25 | ||
26 | # Variables that exist for you to override. | |
27 | # See below for how to change them for certain systems. | |
28 | ||
29 | ALLOCA = | |
d1a9e594 | 30 | CFLAGS = -g $(XCFLAGS) -I$(srcdir)/../include |
fecd2382 RP |
31 | INTERNAL_CFLAGS = $(CROSS) |
32 | OLDCC = cc | |
33 | BISON = bison | |
34 | BISONFLAGS = -v | |
35 | AR = ar | |
36 | OLDAR_FLAGS = qc | |
37 | AR_FLAGS = rc | |
38 | SHELL = /bin/sh | |
39 | # on sysV, define this as cp. | |
40 | INSTALL = install -c | |
41 | # These permit overriding just for certain files. | |
42 | INSTALL_PROGRAM = $(INSTALL) | |
43 | INSTALL_FILE = $(INSTALL) | |
44 | ||
45 | # Define this as & to perform parallel make on a Sequent. | |
46 | # Note that this has some bugs, and it seems currently necessary | |
47 | # to compile all the gen* files first by hand to avoid erroneous results. | |
48 | P = | |
49 | ||
50 | # How to invoke ranlib. | |
51 | RANLIB = ranlib | |
52 | # Test to use to see whether ranlib exists on the system. | |
53 | RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ] | |
54 | ||
55 | # CFLAGS for use with OLDCC, for compiling gnulib. | |
56 | # NOTE: -O does not work on some Unix systems! | |
57 | CCLIBFLAGS = -O | |
58 | ||
59 | # Version of ar to use when compiling gnulib. | |
60 | OLDAR = ar | |
61 | ||
d964a611 | 62 | version=`awk '{print substr ($$4, 2, length ($$4) - 3); }' $(unsubdir)/../gcc/version.c` |
fecd2382 RP |
63 | |
64 | # Directory where sources are, from where we are. | |
65 | srcdir = . | |
66 | # Common prefix for installation directories. | |
67 | # NOTE: This directory must exist when you start installation. | |
3d6f0983 | 68 | destdir = /usr/local |
fecd2382 | 69 | # Directory in which to put the executable for the command `gcc' |
c2fa4ebc | 70 | bindir = $(destdir)/H-$(host_alias)/T-$(target_alias)/bin |
fecd2382 | 71 | # Directory in which to put the directories used by the compiler. |
c2fa4ebc | 72 | libdir = $(destdir)/H-$(host_alias)/T-$(target_alias)/lib |
fecd2382 RP |
73 | # Directory in which the compiler finds executables, libraries, etc. |
74 | libsubdir = $(libdir)/gcc/$(target)/$(version) | |
75 | # Number to put in man-page filename. | |
76 | manext = 1 | |
77 | # Directory in which to put man pages. | |
c2fa4ebc | 78 | mandir = $(destdir)/H-independent/man/man$(manext) |
fecd2382 RP |
79 | |
80 | # Additional system libraries to link with. | |
81 | CLIB= | |
82 | ||
fecd2382 RP |
83 | # Specify the rule for actually making gnulib. |
84 | GNULIB = gnulib.portable | |
85 | ||
86 | # Specify the rule for actually making gnulib2. | |
87 | GNULIB2 = gnulib2.portable | |
88 | ||
89 | # List of extra C and assembler files to add to gnulib. | |
90 | # Assembler files should have names ending in `.asm'. | |
91 | LIBFUNCS_EXTRA = | |
92 | ||
93 | # Program to convert libraries. | |
94 | LIBCONVERT = | |
95 | ||
96 | # Control whether header files are installed. | |
97 | INSTALL_HEADERS=install-headers | |
98 | ||
99 | # Change this to empty to prevent installing limits.h | |
100 | LIMITS_H = limits.h | |
101 | ||
102 | # Directory to link to, when using the target `maketest'. | |
103 | DIR = ../gcc | |
104 | ||
105 | # For better debugging under COFF, define SEPARATE_AUX_OUTPUT in config.h | |
106 | # and define the following variable as `aux-output2.c' in make-... | |
107 | AUX_OUTPUT2 = | |
108 | ||
109 | # Flags to use when cross-building GCC. | |
110 | # Prefix to apply to names of object files when using them | |
111 | # to run on the machine we are compiling on. | |
112 | HOST_PREFIX= | |
113 | # Prefix to apply to names of object files when compiling them | |
114 | # to run on the machine we are compiling on. | |
115 | # The default for this variable is chosen to keep these rules | |
116 | # out of the way of the other rules for compiling the same source files. | |
117 | HOST_PREFIX_1=loser- | |
118 | HOST_CC=$(CC) | |
119 | HOST_CFLAGS=$(ALL_CFLAGS) | |
120 | HOST_LDFLAGS=$(LDFLAGS) | |
121 | HOST_CPPFLAGS=$(CPPFLAGS) | |
122 | ||
123 | # Choose the real default target. | |
da0b2bff | 124 | ALL=as.new |
fecd2382 RP |
125 | |
126 | # End of variables for you to override. | |
127 | ||
128 | # Lists of files for various purposes. | |
129 | ||
130 | REAL_SOURCES = \ | |
131 | $(srcdir)/app.c \ | |
132 | $(srcdir)/as.c \ | |
133 | $(srcdir)/atof-generic.c \ | |
134 | $(srcdir)/bignum-copy.c \ | |
135 | $(srcdir)/cond.c \ | |
136 | $(srcdir)/expr.c \ | |
137 | $(srcdir)/flonum-const.c \ | |
138 | $(srcdir)/flonum-copy.c \ | |
139 | $(srcdir)/flonum-mult.c \ | |
140 | $(srcdir)/frags.c \ | |
141 | $(srcdir)/hash.c \ | |
142 | $(srcdir)/hex-value.c \ | |
143 | $(srcdir)/input-file.c \ | |
144 | $(srcdir)/input-scrub.c \ | |
145 | $(srcdir)/messages.c \ | |
146 | $(srcdir)/output-file.c \ | |
147 | $(srcdir)/read.c \ | |
148 | $(srcdir)/strstr.c \ | |
149 | $(srcdir)/subsegs.c \ | |
150 | $(srcdir)/symbols.c \ | |
151 | $(srcdir)/version.c \ | |
152 | $(srcdir)/write.c \ | |
153 | $(srcdir)/xmalloc.c \ | |
154 | $(srcdir)/xrealloc.c | |
155 | ||
156 | # in an expedient order | |
157 | LINKED_SOURCES = \ | |
158 | targ-cpu.c \ | |
159 | obj-format.c \ | |
160 | atof-targ.c | |
161 | ||
162 | SOURCES = $(LINKED_SOURCES) $(REAL_SOURCES) | |
163 | ||
164 | REAL_HEADERS = \ | |
165 | $(srcdir)/as.h \ | |
166 | $(srcdir)/bignum.h \ | |
167 | $(srcdir)/expr.h \ | |
168 | $(srcdir)/flonum.h \ | |
169 | $(srcdir)/frags.h \ | |
170 | $(srcdir)/hash.h \ | |
171 | $(srcdir)/input-file.h \ | |
172 | $(srcdir)/tc.h \ | |
173 | $(srcdir)/obj.h \ | |
174 | $(srcdir)/read.h \ | |
fecd2382 RP |
175 | $(srcdir)/struc-symbol.h \ |
176 | $(srcdir)/subsegs.h \ | |
177 | $(srcdir)/symbols.h \ | |
178 | $(srcdir)/syscalls.h \ | |
179 | $(srcdir)/write.h | |
180 | ||
181 | LINKED_HEADERS = \ | |
182 | a.out.gnu.h \ | |
183 | a.out.h \ | |
184 | host.h \ | |
185 | targ-env.h \ | |
186 | targ-cpu.h \ | |
187 | obj-format.h \ | |
188 | atof-targ.h | |
189 | ||
190 | HEADERS = $(LINKED_HEADERS) $(REAL_HEADERS) | |
191 | ||
192 | OBJS = \ | |
193 | targ-cpu.o \ | |
194 | obj-format.o \ | |
195 | atof-targ.o \ | |
196 | app.o \ | |
197 | as.o \ | |
198 | atof-generic.o \ | |
199 | bignum-copy.o \ | |
200 | cond.o \ | |
201 | expr.o \ | |
202 | flonum-const.o \ | |
203 | flonum-copy.o \ | |
204 | flonum-mult.o \ | |
205 | frags.o \ | |
206 | hash.o \ | |
207 | hex-value.o \ | |
208 | input-file.o \ | |
209 | input-scrub.o \ | |
210 | messages.o \ | |
211 | output-file.o \ | |
212 | read.o \ | |
213 | strstr.o \ | |
214 | subsegs.o \ | |
215 | symbols.o \ | |
216 | version.o \ | |
217 | write.o \ | |
218 | xmalloc.o \ | |
219 | xrealloc.o | |
220 | ||
f6b67e4c RP |
221 | #### host, target, and site specific Makefile frags come in here. |
222 | ||
fecd2382 RP |
223 | # Definition of `all' is here so that new rules inserted by sed |
224 | # do not specify the default target. | |
225 | # The real definition is under `all.internal'. | |
226 | ||
227 | all: $(ALL) | |
228 | ||
f6b67e4c RP |
229 | fake-as: force |
230 | - rm -f ./as.new | |
921faa52 | 231 | cp /bin/as ./fake-as |
f6b67e4c | 232 | |
fecd2382 RP |
233 | # Now figure out from those variables how to compile and link. |
234 | ||
235 | # This is the variable actually used when we compile. | |
6a3958b2 | 236 | ALL_CFLAGS = $(INTERNAL_CFLAGS) $(CFLAGS) $(HDEFINES) $(TDEFINES) |
fecd2382 RP |
237 | |
238 | # Even if ALLOCA is set, don't use it if compiling with GCC. | |
239 | USE_ALLOCA= `if [ x"${CC}" = x"${OLDCC}" ] ; then echo ${ALLOCA}; else true; fi` | |
240 | USE_HOST_ALLOCA= `if [ x"${CC}" = x"${OLDCC}" ] ; then echo ${HOST_PREFIX}${ALLOCA}; else true; fi` | |
241 | ||
fecd2382 RP |
242 | # Likewise, for use in the tools that must run on this machine |
243 | # even if we are cross-building GCC. | |
244 | # We don't use USE_ALLOCA because backquote expansion doesn't work in deps. | |
245 | HOST_LIBDEPS= $(HOST_PREFIX)$(OBSTACK) $(HOST_PREFIX)$(ALLOCA) $(HOST_PREFIX)$(MALLOC) | |
246 | ||
247 | # How to link with both our special library facilities | |
248 | # and the system's installed libraries. | |
f6b67e4c RP |
249 | |
250 | LIBS = $(LOCAL_LOADLIBES) $(CLIB) $(srcdir)/../libiberty`if [ -d $(srcdir)/libiberty.$(target) ] ; then echo .$(target) ; fi`$(subdir)/libiberty.a | |
fecd2382 RP |
251 | |
252 | # Likewise, for use in the tools that must run on this machine | |
253 | # even if we are cross-building GCC. | |
f6b67e4c | 254 | HOST_LIBS = $(HOST_PREFIX)$(OBSTACK) $(USE_HOST_ALLOCA) $(HOST_PREFIX)$(MALLOC) $(CLIB) |
fecd2382 RP |
255 | |
256 | # Specify the directories to be searched for header files. | |
257 | # Both . and srcdir are used, in that order, | |
258 | # so that tm.h and config.h will be found in the compilation | |
259 | # subdirectory rather than in the source directory. | |
260 | INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config | |
261 | SUBDIR_INCLUDES = -I.. -I../$(srcdir) -I../$(srcdir)/config | |
262 | ||
263 | # Always use -I$(srcdir)/config when compiling. | |
264 | .c.o: | |
265 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $< | |
266 | ||
267 | # This tells GNU make version 3 not to export all the variables | |
268 | # defined in this file into the environment. | |
269 | .NOEXPORT: | |
270 | \f | |
271 | # Files to be copied away after each stage in building. | |
272 | STAGE_GCC=gcc | |
da0b2bff | 273 | STAGESTUFF = *.o as.new |
fecd2382 RP |
274 | |
275 | # The files that "belong" in CONFIG_H are deliberately omitted | |
276 | # because having them there would not be useful in actual practice. | |
277 | # All they would do is cause complete recompilation every time | |
278 | # one of the machine description files is edited. | |
279 | # That may or may not be what one wants to do. | |
280 | # If it is, rm *.o is an easy way to do it. | |
281 | # CONFIG_H = config.h tm.h | |
282 | CONFIG_H = | |
283 | \f | |
da0b2bff RP |
284 | as.new: $(OBJS) $(LIBDEPS) |
285 | -mv -f as.new as.old | |
286 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES) | |
fecd2382 | 287 | |
61907f51 RP |
288 | objdump: |
289 | ||
fecd2382 RP |
290 | all.internal: native |
291 | # This is what is made with the host's compiler if making a cross assembler. | |
6a3958b2 | 292 | native: config.status as |
fecd2382 RP |
293 | |
294 | config.status: | |
295 | @echo You must configure gas. Look at the INSTALL file for details. | |
296 | @false | |
297 | ||
298 | compilations: ${OBJS} | |
299 | ||
300 | # Compiling object files from source files. | |
301 | ||
fecd2382 | 302 | app.o : app.c as.h host.h targ-env.h obj-format.h \ |
d1a9e594 | 303 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
304 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h |
305 | as.o : as.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 306 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
307 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h |
308 | atof-generic.o : atof-generic.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 309 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
310 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h |
311 | bignum-copy.o : bignum-copy.c as.h host.h \ | |
312 | targ-env.h obj-format.h \ | |
d1a9e594 | 313 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
314 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h |
315 | cond.o : cond.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 316 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 317 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
d1a9e594 | 318 | |
fecd2382 | 319 | debug.o : debug.c as.h host.h targ-env.h obj-format.h \ |
d1a9e594 | 320 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
321 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
322 | subsegs.h | |
323 | expr.o : expr.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 324 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 325 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
d1a9e594 | 326 | |
fecd2382 RP |
327 | flonum-const.o : flonum-const.c flonum.h bignum.h |
328 | flonum-copy.o : flonum-copy.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 329 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
330 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h |
331 | flonum-mult.o : flonum-mult.c flonum.h bignum.h | |
332 | frags.o : frags.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 333 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 334 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
d1a9e594 | 335 | subsegs.h |
fecd2382 | 336 | hash.o : hash.c as.h host.h targ-env.h obj-format.h \ |
d1a9e594 | 337 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
338 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h |
339 | hex-value.o : hex-value.c | |
340 | input-file.o : input-file.c as.h host.h \ | |
341 | targ-env.h obj-format.h targ-cpu.h \ | |
d1a9e594 | 342 | struc-symbol.h write.h flonum.h bignum.h expr.h \ |
fecd2382 RP |
343 | frags.h hash.h read.h symbols.h tc.h obj.h input-file.h |
344 | input-scrub.o : input-scrub.c /usr/include/errno.h /usr/include/sys/errno.h \ | |
345 | as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 346 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
347 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
348 | input-file.h | |
349 | messages.o : messages.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 350 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 351 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h |
d1a9e594 | 352 | obstack.o : obstack.c |
fecd2382 | 353 | output-file.o : output-file.c as.h host.h targ-env.h obj-format.h \ |
d1a9e594 | 354 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
355 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
356 | output-file.h | |
357 | read.o : read.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 358 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 359 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
d1a9e594 | 360 | |
fecd2382 RP |
361 | strstr.o : strstr.c |
362 | subsegs.o : subsegs.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 363 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 364 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
d1a9e594 | 365 | subsegs.h |
fecd2382 | 366 | symbols.o : symbols.c as.h host.h targ-env.h obj-format.h \ |
d1a9e594 | 367 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 368 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
d1a9e594 | 369 | subsegs.h |
fecd2382 RP |
370 | version.o : version.c |
371 | write.o : write.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 372 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 373 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
d1a9e594 | 374 | subsegs.h output-file.h |
fecd2382 RP |
375 | xmalloc.o : xmalloc.c |
376 | xrealloc.o : xrealloc.c | |
377 | atof-targ.o : atof-targ.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 378 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
379 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h \ |
380 | symbols.h tc.h obj.h | |
381 | obj-format.o : obj-format.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 382 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 383 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h \ |
d1a9e594 | 384 | symbols.h tc.h obj.h |
fecd2382 | 385 | targ-cpu.o : targ-cpu.c targ-env.h obj-format.h \ |
d1a9e594 | 386 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 387 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h \ |
da0b2bff | 388 | symbols.h tc.h obj.h $(TARG_CPU_DEPENDENTS) |
d1a9e594 | 389 | |
fecd2382 RP |
390 | \f |
391 | # Compile the libraries to be used by gen*. | |
392 | # If we are not cross-building, gen* use the same .o's that cc1 will use, | |
393 | # and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict | |
394 | # with the rules for rtl.o, alloca.o, etc. | |
395 | $(HOST_PREFIX_1)alloca.o: alloca.c | |
396 | rm -f $(HOST_PREFIX)alloca.c | |
397 | cp $(srcdir)/alloca.c $(HOST_PREFIX)alloca.c | |
398 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c | |
399 | ||
400 | $(HOST_PREFIX_1)obstack.o: obstack.c | |
401 | rm -f $(HOST_PREFIX)obstack.c | |
402 | cp $(srcdir)/obstack.c $(HOST_PREFIX)obstack.c | |
403 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c | |
404 | ||
405 | $(HOST_PREFIX_1)malloc.o: malloc.c | |
406 | rm -f $(HOST_PREFIX)malloc.c | |
407 | cp $(srcdir)/malloc.c $(HOST_PREFIX)malloc.c | |
408 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c | |
409 | \f | |
410 | # Remake the info files. | |
411 | ||
921faa52 | 412 | doc: $(srcdir)/as.info |
fecd2382 | 413 | |
921faa52 RP |
414 | $(srcdir)/as.info: $(srcdir)/doc/as.texinfo |
415 | (cd doc; make as.info; mv as.info $srcdir) | |
fecd2382 RP |
416 | |
417 | \f | |
418 | # Deletion of files made during compilation. | |
419 | # There are three levels of this: `clean', `cleanconfig' and `realclean'. | |
420 | # `clean' deletes what you want to delete ordinarily to save space. | |
421 | # This is most, but not all, of the files made by compilation. | |
422 | # `cleanconfig' also deletes everything depending | |
423 | # on the choice of config files. | |
424 | # `realclean' also deletes everything that could be regenerated automatically. | |
425 | ||
426 | clean: | |
427 | -rm -f $(STAGESTUFF) | |
428 | # Delete the temporary source copies for cross compilation. | |
429 | -rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c | |
430 | -rm -f $(HOST_PREFIX_1)obstack.c | |
431 | # Delete the stamp files except stamp-gnulib2. | |
432 | -rm -f core | |
433 | ||
434 | # Like clean but also delete the links made to configure gas. | |
435 | cleanconfig: clean | |
436 | -rm -f config.status Makefile host.h targ-env.h | |
437 | -rm -f targ-cpu.h targ-cpu.c | |
438 | -rm -f obj-format.h obj-format.c | |
439 | -rm -f atof-targ.c | |
440 | ||
441 | # Get rid of every file that's generated from some other file (except INSTALL). | |
442 | realclean: cleanconfig | |
443 | -rm -f gas.aux gas.cps gas.fns gas.info gas.kys gas.pgs gas.tps gas.vrs | |
444 | -rm -f TAGS | |
445 | -rm -f gas.info* gas.?? gas.??s gas.log gas.toc gas.*aux | |
446 | -rm -f *.dvi | |
447 | \f | |
448 | # Entry points `install', `includes' and `uninstall'. | |
449 | ||
450 | # Copy the files into directories where they will be run. | |
a26878d1 | 451 | install: $(ALL) |
c2fa4ebc RP |
452 | # $(INSTALL_PROGRAM) $(ALL) $(libsubdir)/as |
453 | cp $(ALL) $(bindir)/as.new | |
454 | mv -f $(bindir)/as.new $(bindir)/as | |
fecd2382 RP |
455 | |
456 | # Create the installation directory. | |
457 | install-dir: | |
458 | -mkdir $(libdir) | |
459 | -mkdir $(libdir)/gcc | |
460 | -mkdir $(libdir)/gcc/$(target) | |
461 | -mkdir $(libdir)/gcc/$(target)/$(version) | |
462 | ||
463 | # Install the compiler executables built during cross compilation. | |
464 | install-cross: native install-dir | |
465 | -if [ -f cc1 ] ; then $(INSTALL_PROGRAM) cc1 $(libsubdir)/cc1; else true; fi | |
466 | -if [ -f cc1plus ] ; then $(INSTALL_PROGRAM) cc1plus $(libsubdir)/cc1plus; else true; fi | |
467 | $(INSTALL_PROGRAM) cpp $(libsubdir)/cpp | |
468 | ./gcc -dumpspecs > $(libsubdir)/specs | |
469 | $(INSTALL_PROGRAM) gcc $(bindir)/gcc | |
470 | ||
471 | # Install the man pages. | |
472 | install-man: install-dir $(srcdir)/gcc.1 protoize.1 unprotoize.1 | |
473 | $(INSTALL_FILE) $(srcdir)/gcc.1 $(mandir)/gcc.$(manext) | |
474 | chmod a-x $(mandir)/gcc.$(manext) | |
475 | $(INSTALL_FILE) $(srcdir)/protoize.1 $(mandir)/protoize.$(manext) | |
476 | chmod a-x $(mandir)/protoize.$(manext) | |
477 | $(INSTALL_FILE) $(srcdir)/unprotoize.1 $(mandir)/unprotoize.$(manext) | |
478 | chmod a-x $(mandir)/unprotoize.$(manext) | |
479 | ||
480 | # Cancel installation by deleting the installed files. | |
481 | uninstall: | |
482 | -rm -rf $(libsubdir) | |
6a3958b2 | 483 | -rm -rf $(bindir)/as |
fecd2382 RP |
484 | -rm -rf $(mandir)/gas.$(manext) |
485 | ||
486 | \f | |
487 | # These exist for maintenance purposes. | |
488 | ||
489 | tags TAGS: force | |
490 | etags $(REAL_SOURCES) $(REAL_HEADERS) README Makefile config/*.[hc] | |
491 | ||
da0b2bff | 492 | bootstrap: $(ALL) force |
fecd2382 | 493 | $(MAKE) stage1 |
a26878d1 | 494 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(ALL) |
fecd2382 | 495 | $(MAKE) stage2 |
a26878d1 | 496 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(ALL) |
a01bf1fb | 497 | $(MAKE) comparison against=stage2 |
fecd2382 RP |
498 | |
499 | bootstrap2: force | |
a26878d1 | 500 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(ALL) |
fecd2382 | 501 | $(MAKE) stage2 |
a26878d1 | 502 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(ALL) |
da0b2bff | 503 | $(MAKE) comparison against=stage2 |
fecd2382 RP |
504 | |
505 | bootstrap3: force | |
a26878d1 | 506 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(ALL) |
a01bf1fb | 507 | $(MAKE) comparison against=stage2 |
fecd2382 RP |
508 | |
509 | # Copy the object files from a particular stage into a subdirectory. | |
510 | stage1: force | |
511 | -mkdir stage1 | |
512 | -mv $(STAGESTUFF) stage1 | |
da0b2bff | 513 | (cd stage1 ; ln as.new as) |
fecd2382 RP |
514 | |
515 | stage2: force | |
516 | -mkdir stage2 | |
517 | -mv $(STAGESTUFF) stage2 | |
da0b2bff | 518 | (cd stage2 ; ln as.new as) |
fecd2382 RP |
519 | |
520 | stage3: force | |
521 | -mkdir stage3 | |
6a3958b2 | 522 | -mv $(STAGESTUFF) stage3 |
da0b2bff | 523 | (cd stage3 ; ln as.new as) |
fecd2382 | 524 | |
a01bf1fb RP |
525 | against=stage2 |
526 | ||
527 | comparison: force | |
528 | for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done | |
529 | ||
6a3958b2 | 530 | de-stage1: force |
da0b2bff | 531 | - (cd stage1 ; rm as ; mv -f * ..) |
6a3958b2 RP |
532 | - rmdir stage1 |
533 | ||
534 | de-stage2: force | |
da0b2bff | 535 | - (cd stage2 ; rm as ; mv -f * ..) |
6a3958b2 RP |
536 | - rmdir stage2 |
537 | ||
538 | de-stage3: force | |
da0b2bff | 539 | - (cd stage3 ; rm as ; mv -f * ..) |
6a3958b2 | 540 | - rmdir stage3 |
fecd2382 RP |
541 | |
542 | # Copy just the executable files from a particular stage into a subdirectory, | |
543 | # and delete the object files. Use this if you're just verifying a version | |
544 | # that is pretty sure to work, and you are short of disk space. | |
545 | risky-stage1: force | |
546 | -mkdir stage1 | |
547 | -mv cc1 cpp cccp gcc stage1 | |
548 | -rm -f stage1/gnulib | |
549 | -cp gnulib stage1 && $(RANLIB) stage1/gnulib | |
550 | -make clean | |
551 | ||
552 | risky-stage2: force | |
553 | -mkdir stage2 | |
554 | -mv cc1 cpp cccp gcc stage2 | |
555 | -rm -f stage2/gnulib | |
556 | -cp gnulib stage2 && $(RANLIB) stage2/gnulib | |
557 | -make clean | |
558 | ||
559 | risky-stage3: force | |
560 | -mkdir stage3 | |
561 | -mv cc1 cpp cccp gcc stage3 | |
562 | -rm -f stage3/gnulib | |
563 | -cp gnulib stage3 && $(RANLIB) stage3/gnulib | |
564 | -make clean | |
565 | ||
566 | risky-stage4: force | |
567 | -mkdir stage4 | |
568 | -mv cc1 cpp cccp gcc stage4 | |
569 | -rm -f stage4/gnulib | |
570 | -cp gnulib stage4 && $(RANLIB) stage4/gnulib | |
571 | -make clean | |
572 | ||
573 | #In GNU Make, ignore whether `stage*' exists. | |
574 | .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap | |
575 | .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4 | |
576 | ||
577 | force: | |
578 | ||
f1eb48b6 | 579 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
a26878d1 | 580 | $(SHELL) ./config.status |
61907f51 | 581 |