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 | |
1058238c | 8 | #the Free Software Foundation; either version 2, or (at your option) |
fecd2382 RP |
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 | ||
fecd2382 RP |
20 | # The targets for external use include: |
21 | # all, doc, proto, install, uninstall, includes, TAGS, | |
22 | # clean, cleanconfig, realclean, stage1, stage2, stage3, stage4. | |
23 | ||
24 | # Variables that exist for you to override. | |
25 | # See below for how to change them for certain systems. | |
26 | ||
1058238c RP |
27 | srcdir = . |
28 | ||
29 | prefix = /usr/local | |
30 | ||
31 | bindir = $(prefix)/bin | |
32 | datadir = $(prefix)/lib | |
33 | libdir = $(prefix)/lib | |
34 | mandir = $(datadir)/man | |
35 | man1dir = $(mandir)/man1 | |
36 | man2dir = $(mandir)/man2 | |
37 | man3dir = $(mandir)/man3 | |
38 | man4dir = $(mandir)/man4 | |
39 | man5dir = $(mandir)/man5 | |
40 | man6dir = $(mandir)/man6 | |
41 | man7dir = $(mandir)/man7 | |
42 | man8dir = $(mandir)/man8 | |
43 | man9dir = $(mandir)/man9 | |
3340f7e5 | 44 | infodir = $(datadir)/info |
1058238c RP |
45 | includedir = $(prefix)/include |
46 | docdir = $(datadir)/doc | |
47 | ||
fecd2382 | 48 | SHELL = /bin/sh |
1058238c | 49 | |
fecd2382 | 50 | INSTALL = install -c |
fecd2382 | 51 | INSTALL_PROGRAM = $(INSTALL) |
1058238c | 52 | INSTALL_DATA = $(INSTALL) |
fecd2382 | 53 | |
1058238c RP |
54 | AR = ar |
55 | AR_FLAGS = qv | |
56 | BISON = bison | |
57 | MAKEINFO = makeinfo | |
fecd2382 | 58 | RANLIB = ranlib |
fecd2382 | 59 | |
fecd2382 RP |
60 | # Lists of files for various purposes. |
61 | ||
62 | REAL_SOURCES = \ | |
63 | $(srcdir)/app.c \ | |
64 | $(srcdir)/as.c \ | |
65 | $(srcdir)/atof-generic.c \ | |
66 | $(srcdir)/bignum-copy.c \ | |
67 | $(srcdir)/cond.c \ | |
68 | $(srcdir)/expr.c \ | |
69 | $(srcdir)/flonum-const.c \ | |
70 | $(srcdir)/flonum-copy.c \ | |
71 | $(srcdir)/flonum-mult.c \ | |
72 | $(srcdir)/frags.c \ | |
73 | $(srcdir)/hash.c \ | |
74 | $(srcdir)/hex-value.c \ | |
75 | $(srcdir)/input-file.c \ | |
76 | $(srcdir)/input-scrub.c \ | |
77 | $(srcdir)/messages.c \ | |
542e1629 | 78 | $(srcdir)/obstack.c \ |
fecd2382 RP |
79 | $(srcdir)/output-file.c \ |
80 | $(srcdir)/read.c \ | |
542e1629 | 81 | $(srcdir)/strerror.c \ |
fecd2382 RP |
82 | $(srcdir)/strstr.c \ |
83 | $(srcdir)/subsegs.c \ | |
84 | $(srcdir)/symbols.c \ | |
85 | $(srcdir)/version.c \ | |
86 | $(srcdir)/write.c \ | |
3340f7e5 | 87 | $(srcdir)/listing.c \ |
fecd2382 RP |
88 | $(srcdir)/xmalloc.c \ |
89 | $(srcdir)/xrealloc.c | |
90 | ||
91 | # in an expedient order | |
92 | LINKED_SOURCES = \ | |
93 | targ-cpu.c \ | |
94 | obj-format.c \ | |
95 | atof-targ.c | |
96 | ||
97 | SOURCES = $(LINKED_SOURCES) $(REAL_SOURCES) | |
98 | ||
99 | REAL_HEADERS = \ | |
100 | $(srcdir)/as.h \ | |
101 | $(srcdir)/bignum.h \ | |
102 | $(srcdir)/expr.h \ | |
103 | $(srcdir)/flonum.h \ | |
104 | $(srcdir)/frags.h \ | |
105 | $(srcdir)/hash.h \ | |
106 | $(srcdir)/input-file.h \ | |
542e1629 | 107 | $(srcdir)/listing.h \ |
fecd2382 RP |
108 | $(srcdir)/tc.h \ |
109 | $(srcdir)/obj.h \ | |
542e1629 | 110 | $(srcdir)/obstack.h \ |
fecd2382 | 111 | $(srcdir)/read.h \ |
fecd2382 RP |
112 | $(srcdir)/struc-symbol.h \ |
113 | $(srcdir)/subsegs.h \ | |
114 | $(srcdir)/symbols.h \ | |
115 | $(srcdir)/syscalls.h \ | |
116 | $(srcdir)/write.h | |
117 | ||
118 | LINKED_HEADERS = \ | |
119 | a.out.gnu.h \ | |
120 | a.out.h \ | |
121 | host.h \ | |
122 | targ-env.h \ | |
123 | targ-cpu.h \ | |
124 | obj-format.h \ | |
125 | atof-targ.h | |
126 | ||
127 | HEADERS = $(LINKED_HEADERS) $(REAL_HEADERS) | |
128 | ||
129 | OBJS = \ | |
130 | targ-cpu.o \ | |
131 | obj-format.o \ | |
132 | atof-targ.o \ | |
133 | app.o \ | |
134 | as.o \ | |
135 | atof-generic.o \ | |
136 | bignum-copy.o \ | |
137 | cond.o \ | |
138 | expr.o \ | |
139 | flonum-const.o \ | |
140 | flonum-copy.o \ | |
141 | flonum-mult.o \ | |
142 | frags.o \ | |
143 | hash.o \ | |
144 | hex-value.o \ | |
145 | input-file.o \ | |
146 | input-scrub.o \ | |
147 | messages.o \ | |
542e1629 | 148 | obstack.o \ |
fecd2382 RP |
149 | output-file.o \ |
150 | read.o \ | |
542e1629 | 151 | strerror.o \ |
fecd2382 RP |
152 | strstr.o \ |
153 | subsegs.o \ | |
154 | symbols.o \ | |
155 | version.o \ | |
156 | write.o \ | |
3340f7e5 | 157 | listing.o \ |
fecd2382 RP |
158 | xmalloc.o \ |
159 | xrealloc.o | |
160 | ||
f6b67e4c RP |
161 | #### host, target, and site specific Makefile frags come in here. |
162 | ||
542e1629 | 163 | all: as.new |
1058238c | 164 | info: |
81f73963 | 165 | install-info: |
fecd2382 | 166 | |
fecd2382 RP |
167 | # Now figure out from those variables how to compile and link. |
168 | ||
169 | # This is the variable actually used when we compile. | |
3340f7e5 | 170 | ALL_CFLAGS = -g $(INTERNAL_CFLAGS) $(CFLAGS) $(HDEFINES) $(TDEFINES) |
fecd2382 | 171 | |
fecd2382 RP |
172 | # How to link with both our special library facilities |
173 | # and the system's installed libraries. | |
f6b67e4c | 174 | |
542e1629 | 175 | LIBS = $(LOCAL_LOADLIBES) $(CLIB) # ../libiberty/libiberty.a |
fecd2382 RP |
176 | |
177 | # Specify the directories to be searched for header files. | |
178 | # Both . and srcdir are used, in that order, | |
179 | # so that tm.h and config.h will be found in the compilation | |
180 | # subdirectory rather than in the source directory. | |
1058238c RP |
181 | INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config -I$(srcdir)/../include |
182 | SUBDIR_INCLUDES = -I.. -I$(srcdir) -I$(srcdir)/config | |
fecd2382 RP |
183 | |
184 | # Always use -I$(srcdir)/config when compiling. | |
185 | .c.o: | |
186 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $< | |
187 | ||
188 | # This tells GNU make version 3 not to export all the variables | |
189 | # defined in this file into the environment. | |
190 | .NOEXPORT: | |
542e1629 | 191 | |
fecd2382 | 192 | # Files to be copied away after each stage in building. |
da0b2bff | 193 | STAGESTUFF = *.o as.new |
fecd2382 | 194 | |
da0b2bff RP |
195 | as.new: $(OBJS) $(LIBDEPS) |
196 | -mv -f as.new as.old | |
197 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES) | |
fecd2382 | 198 | |
fecd2382 RP |
199 | config.status: |
200 | @echo You must configure gas. Look at the INSTALL file for details. | |
201 | @false | |
202 | ||
fecd2382 RP |
203 | # Compiling object files from source files. |
204 | ||
fecd2382 | 205 | app.o : app.c as.h host.h targ-env.h obj-format.h \ |
d1a9e594 | 206 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
207 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h |
208 | as.o : as.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 209 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
210 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h |
211 | atof-generic.o : atof-generic.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 212 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
213 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h |
214 | bignum-copy.o : bignum-copy.c as.h host.h \ | |
215 | targ-env.h obj-format.h \ | |
d1a9e594 | 216 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
217 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h |
218 | cond.o : cond.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 219 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 220 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
d1a9e594 | 221 | |
fecd2382 | 222 | debug.o : debug.c as.h host.h targ-env.h obj-format.h \ |
d1a9e594 | 223 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
224 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
225 | subsegs.h | |
226 | expr.o : expr.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 227 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 228 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
d1a9e594 | 229 | |
fecd2382 RP |
230 | flonum-const.o : flonum-const.c flonum.h bignum.h |
231 | flonum-copy.o : flonum-copy.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 232 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
233 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h |
234 | flonum-mult.o : flonum-mult.c flonum.h bignum.h | |
235 | frags.o : frags.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 236 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 237 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
d1a9e594 | 238 | subsegs.h |
fecd2382 | 239 | hash.o : hash.c as.h host.h targ-env.h obj-format.h \ |
d1a9e594 | 240 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
241 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h |
242 | hex-value.o : hex-value.c | |
243 | input-file.o : input-file.c as.h host.h \ | |
244 | targ-env.h obj-format.h targ-cpu.h \ | |
d1a9e594 | 245 | struc-symbol.h write.h flonum.h bignum.h expr.h \ |
fecd2382 RP |
246 | frags.h hash.h read.h symbols.h tc.h obj.h input-file.h |
247 | input-scrub.o : input-scrub.c /usr/include/errno.h /usr/include/sys/errno.h \ | |
248 | as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 249 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
250 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
251 | input-file.h | |
3340f7e5 RP |
252 | listing.o : listing.c as.h host.h targ-env.h flonum.h bignum.h \ |
253 | listing.h obj-format.h targ-cpu.h struc-symbol.h write.h expr.h \ | |
254 | frags.h hash.h read.h symbols.h tc.h obj.h input-file.h | |
fecd2382 | 255 | messages.o : messages.c as.h host.h targ-env.h obj-format.h \ |
d1a9e594 | 256 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 257 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h |
d1a9e594 | 258 | obstack.o : obstack.c |
fecd2382 | 259 | output-file.o : output-file.c as.h host.h targ-env.h obj-format.h \ |
d1a9e594 | 260 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
261 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
262 | output-file.h | |
263 | read.o : read.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 264 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 265 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
d1a9e594 | 266 | |
fecd2382 RP |
267 | strstr.o : strstr.c |
268 | subsegs.o : subsegs.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 269 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 270 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
d1a9e594 | 271 | subsegs.h |
fecd2382 | 272 | symbols.o : symbols.c as.h host.h targ-env.h obj-format.h \ |
d1a9e594 | 273 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 274 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
d1a9e594 | 275 | subsegs.h |
fecd2382 RP |
276 | version.o : version.c |
277 | write.o : write.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 278 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 279 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
d1a9e594 | 280 | subsegs.h output-file.h |
fecd2382 RP |
281 | xmalloc.o : xmalloc.c |
282 | xrealloc.o : xrealloc.c | |
283 | atof-targ.o : atof-targ.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 284 | targ-cpu.h struc-symbol.h \ |
fecd2382 RP |
285 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h \ |
286 | symbols.h tc.h obj.h | |
287 | obj-format.o : obj-format.c as.h host.h targ-env.h obj-format.h \ | |
d1a9e594 | 288 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 289 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h \ |
d1a9e594 | 290 | symbols.h tc.h obj.h |
fecd2382 | 291 | targ-cpu.o : targ-cpu.c targ-env.h obj-format.h \ |
d1a9e594 | 292 | targ-cpu.h struc-symbol.h \ |
fecd2382 | 293 | write.h flonum.h bignum.h expr.h frags.h hash.h read.h \ |
da0b2bff | 294 | symbols.h tc.h obj.h $(TARG_CPU_DEPENDENTS) |
d1a9e594 | 295 | |
fecd2382 RP |
296 | # Remake the info files. |
297 | ||
921faa52 | 298 | doc: $(srcdir)/as.info |
fecd2382 | 299 | |
921faa52 RP |
300 | $(srcdir)/as.info: $(srcdir)/doc/as.texinfo |
301 | (cd doc; make as.info; mv as.info $srcdir) | |
fecd2382 | 302 | |
fecd2382 | 303 | clean: |
542e1629 | 304 | -rm -f $(STAGESTUFF) core |
fecd2382 RP |
305 | |
306 | # Like clean but also delete the links made to configure gas. | |
542e1629 RP |
307 | distclean: clean |
308 | -rm -f config.status Makefile host.h targ-env.h targ-cpu.h \ | |
309 | targ-cpu.c obj-format.h obj-format.c atof-targ.c \ | |
310 | gas.aux gas.cps gas.fns gas.info gas.kys gas.pgs | |
311 | gas.tps gas.vrs TAGS gas.info* gas.?? gas.??s gas.log \ | |
312 | gas.toc gas.*aux *.dvi | |
313 | ||
fecd2382 RP |
314 | # Entry points `install', `includes' and `uninstall'. |
315 | ||
316 | # Copy the files into directories where they will be run. | |
542e1629 RP |
317 | install: |
318 | if [ "$(host_alias)" = "$(target_alias)" ] ; then \ | |
319 | $(INSTALL_PROGRAM) as.new $(bindir)/as ; \ | |
320 | else \ | |
321 | $(INSTALL_PROGRAM) as.new $(bindir)/as-$(target_alias) ; \ | |
322 | fi | |
fecd2382 RP |
323 | |
324 | # Create the installation directory. | |
325 | install-dir: | |
326 | -mkdir $(libdir) | |
327 | -mkdir $(libdir)/gcc | |
328 | -mkdir $(libdir)/gcc/$(target) | |
329 | -mkdir $(libdir)/gcc/$(target)/$(version) | |
330 | ||
fecd2382 RP |
331 | # Cancel installation by deleting the installed files. |
332 | uninstall: | |
333 | -rm -rf $(libsubdir) | |
6a3958b2 | 334 | -rm -rf $(bindir)/as |
fecd2382 RP |
335 | -rm -rf $(mandir)/gas.$(manext) |
336 | ||
542e1629 | 337 | |
fecd2382 RP |
338 | # These exist for maintenance purposes. |
339 | ||
340 | tags TAGS: force | |
622e4c4c | 341 | etags $(REAL_SOURCES) $(REAL_HEADERS) $(srcdir)/README $(srcdir)/Makefile $(srcdir)/config/*.[hc] |
fecd2382 | 342 | |
542e1629 | 343 | bootstrap: as.new force |
fecd2382 | 344 | $(MAKE) stage1 |
542e1629 | 345 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new |
fecd2382 | 346 | $(MAKE) stage2 |
542e1629 | 347 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new |
a01bf1fb | 348 | $(MAKE) comparison against=stage2 |
fecd2382 RP |
349 | |
350 | bootstrap2: force | |
542e1629 | 351 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new |
fecd2382 | 352 | $(MAKE) stage2 |
542e1629 | 353 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new |
da0b2bff | 354 | $(MAKE) comparison against=stage2 |
fecd2382 RP |
355 | |
356 | bootstrap3: force | |
542e1629 | 357 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new |
a01bf1fb | 358 | $(MAKE) comparison against=stage2 |
fecd2382 RP |
359 | |
360 | # Copy the object files from a particular stage into a subdirectory. | |
361 | stage1: force | |
362 | -mkdir stage1 | |
363 | -mv $(STAGESTUFF) stage1 | |
81f73963 | 364 | if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; ln -s as.new as) ; fi |
fecd2382 RP |
365 | |
366 | stage2: force | |
367 | -mkdir stage2 | |
368 | -mv $(STAGESTUFF) stage2 | |
81f73963 | 369 | if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; ln -s as.new as) ; fi |
fecd2382 RP |
370 | |
371 | stage3: force | |
372 | -mkdir stage3 | |
6a3958b2 | 373 | -mv $(STAGESTUFF) stage3 |
81f73963 | 374 | if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; ln -s as.new as) ; fi |
fecd2382 | 375 | |
a01bf1fb RP |
376 | against=stage2 |
377 | ||
378 | comparison: force | |
379 | for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done | |
380 | ||
6a3958b2 | 381 | de-stage1: force |
da0b2bff | 382 | - (cd stage1 ; rm as ; mv -f * ..) |
6a3958b2 RP |
383 | - rmdir stage1 |
384 | ||
385 | de-stage2: force | |
da0b2bff | 386 | - (cd stage2 ; rm as ; mv -f * ..) |
6a3958b2 RP |
387 | - rmdir stage2 |
388 | ||
389 | de-stage3: force | |
da0b2bff | 390 | - (cd stage3 ; rm as ; mv -f * ..) |
6a3958b2 | 391 | - rmdir stage3 |
fecd2382 | 392 | |
fecd2382 RP |
393 | #In GNU Make, ignore whether `stage*' exists. |
394 | .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap | |
fecd2382 RP |
395 | |
396 | force: | |
397 | ||
f1eb48b6 | 398 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
a26878d1 | 399 | $(SHELL) ./config.status |
61907f51 | 400 |