Commit | Line | Data |
---|---|---|
fecd2382 | 1 | # Makefile for GNU Assembler |
7420b02b | 2 | # Copyright (C) 1987-1992, 1993 Free Software Foundation, Inc. |
fecd2382 | 3 | |
7420b02b | 4 | # This file is part of GNU GAS. |
fecd2382 | 5 | |
7420b02b JL |
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 2, or (at your option) | |
9 | # any later version. | |
fecd2382 | 10 | |
7420b02b JL |
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. | |
fecd2382 | 15 | |
7420b02b JL |
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 | |
a2a5a4fa | 18 | # the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
fecd2382 | 19 | |
fecd2382 RP |
20 | # The targets for external use include: |
21 | # all, doc, proto, install, uninstall, includes, TAGS, | |
daa7e184 | 22 | # clean, mostlyclean, distclean, realclean, stage1, stage2, stage3, stage4. |
fecd2382 RP |
23 | |
24 | # Variables that exist for you to override. | |
25 | # See below for how to change them for certain systems. | |
26 | ||
b11fb939 KR |
27 | VPATH = @srcdir@ |
28 | srcdir = @srcdir@ | |
7420b02b | 29 | srcroot = $(srcdir)/.. |
1058238c | 30 | |
fa156ffe | 31 | target_alias = @target_alias@ |
1bc37618 | 32 | prefix = @prefix@ |
1058238c | 33 | |
fa156ffe | 34 | program_transform_name = @program_transform_name@ |
1bc37618 | 35 | exec_prefix = @exec_prefix@ |
787c6bfe RP |
36 | bindir = $(exec_prefix)/bin |
37 | libdir = $(exec_prefix)/lib | |
b63defaa | 38 | tooldir = $(exec_prefix)/$(target_alias) |
787c6bfe | 39 | |
1058238c | 40 | datadir = $(prefix)/lib |
787c6bfe | 41 | mandir = $(prefix)/man |
1058238c RP |
42 | man1dir = $(mandir)/man1 |
43 | man2dir = $(mandir)/man2 | |
44 | man3dir = $(mandir)/man3 | |
45 | man4dir = $(mandir)/man4 | |
46 | man5dir = $(mandir)/man5 | |
47 | man6dir = $(mandir)/man6 | |
48 | man7dir = $(mandir)/man7 | |
49 | man8dir = $(mandir)/man8 | |
50 | man9dir = $(mandir)/man9 | |
787c6bfe | 51 | infodir = $(prefix)/info |
1058238c RP |
52 | includedir = $(prefix)/include |
53 | docdir = $(datadir)/doc | |
54 | ||
aa30c7ee | 55 | VERSION=cygnus-2.5.3 |
c97b9003 | 56 | |
fecd2382 | 57 | SHELL = /bin/sh |
1058238c | 58 | |
7420b02b | 59 | INSTALL = $${srcroot}/install.sh -c |
fecd2382 | 60 | INSTALL_PROGRAM = $(INSTALL) |
1058238c | 61 | INSTALL_DATA = $(INSTALL) |
aa30c7ee | 62 | INSTALL_XFORM = $(INSTALL) -t='-e $(program_transform_name)' |
c97b9003 | 63 | INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1 |
fecd2382 | 64 | |
a1c7c0f3 | 65 | DISTSTUFF= make-gas.com m68k-parse.c |
6d60424f | 66 | |
1058238c RP |
67 | AR = ar |
68 | AR_FLAGS = qv | |
a1c7c0f3 ILT |
69 | BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi` |
70 | BISONFLAGS = | |
1058238c | 71 | MAKEINFO = makeinfo |
c97b9003 | 72 | TEXI2DVI = texi2dvi |
fecd2382 | 73 | RANLIB = ranlib |
b11fb939 | 74 | CC = @CC@ |
4b857710 ILT |
75 | CFLAGS = -g |
76 | ||
7420b02b JL |
77 | MAKEOVERRIDES= |
78 | ||
5f757edc ILT |
79 | EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \ |
80 | echo $${rootme}/../expect/expect ; \ | |
81 | else echo expect ; fi` | |
82 | ||
4b857710 ILT |
83 | FLAGS_TO_PASS = \ |
84 | "prefix=$(prefix)" \ | |
85 | "exec_prefix=$(exec_prefix)" \ | |
86 | "tooldir=$(tooldir)" \ | |
87 | "AR=$(AR)" \ | |
88 | "AR_FLAGS=$(AR_FLAGS)" \ | |
89 | "CC=$(CC)" \ | |
90 | "CFLAGS=$(CFLAGS)" \ | |
91 | "RANLIB=$(RANLIB)" \ | |
92 | "LOADLIBES=$(LOADLIBES)" \ | |
93 | "LDFLAGS=$(LDFLAGS)" \ | |
94 | "BISON=$(BISON)" \ | |
95 | "LEX=$(LEX)" \ | |
96 | "MAKEINFO=$(MAKEINFO)" \ | |
97 | "INSTALL=$(INSTALL)" \ | |
98 | "INSTALL_DATA=$(INSTALL_DATA)" \ | |
99 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" | |
fecd2382 | 100 | |
833c46e1 KR |
101 | RUNTEST = `if [ -f ${srcdir}/../dejagnu/runtest ] ; then \ |
102 | echo ${srcdir}/../dejagnu/runtest ; else echo runtest; \ | |
103 | fi` | |
104 | RUNTESTFLAGS= | |
c97b9003 | 105 | |
fecd2382 RP |
106 | # Lists of files for various purposes. |
107 | ||
108 | REAL_SOURCES = \ | |
109 | $(srcdir)/app.c \ | |
110 | $(srcdir)/as.c \ | |
111 | $(srcdir)/atof-generic.c \ | |
112 | $(srcdir)/bignum-copy.c \ | |
113 | $(srcdir)/cond.c \ | |
114 | $(srcdir)/expr.c \ | |
5d53038b | 115 | $(srcdir)/flonum-konst.c \ |
fecd2382 RP |
116 | $(srcdir)/flonum-copy.c \ |
117 | $(srcdir)/flonum-mult.c \ | |
118 | $(srcdir)/frags.c \ | |
119 | $(srcdir)/hash.c \ | |
fecd2382 RP |
120 | $(srcdir)/input-file.c \ |
121 | $(srcdir)/input-scrub.c \ | |
dffc8b9e | 122 | $(srcdir)/literal.c \ |
fecd2382 RP |
123 | $(srcdir)/messages.c \ |
124 | $(srcdir)/output-file.c \ | |
125 | $(srcdir)/read.c \ | |
fecd2382 RP |
126 | $(srcdir)/subsegs.c \ |
127 | $(srcdir)/symbols.c \ | |
fecd2382 | 128 | $(srcdir)/write.c \ |
3340f7e5 | 129 | $(srcdir)/listing.c \ |
9cc8106c | 130 | $(srcdir)/ecoff.c \ |
b63defaa | 131 | $(srcdir)/stabs.c |
fecd2382 RP |
132 | |
133 | # in an expedient order | |
134 | LINKED_SOURCES = \ | |
135 | targ-cpu.c \ | |
136 | obj-format.c \ | |
137 | atof-targ.c | |
138 | ||
139 | SOURCES = $(LINKED_SOURCES) $(REAL_SOURCES) | |
140 | ||
141 | REAL_HEADERS = \ | |
142 | $(srcdir)/as.h \ | |
143 | $(srcdir)/bignum.h \ | |
144 | $(srcdir)/expr.h \ | |
145 | $(srcdir)/flonum.h \ | |
146 | $(srcdir)/frags.h \ | |
147 | $(srcdir)/hash.h \ | |
148 | $(srcdir)/input-file.h \ | |
542e1629 | 149 | $(srcdir)/listing.h \ |
fecd2382 RP |
150 | $(srcdir)/tc.h \ |
151 | $(srcdir)/obj.h \ | |
152 | $(srcdir)/read.h \ | |
fecd2382 RP |
153 | $(srcdir)/struc-symbol.h \ |
154 | $(srcdir)/subsegs.h \ | |
155 | $(srcdir)/symbols.h \ | |
9cc8106c ILT |
156 | $(srcdir)/write.h \ |
157 | $(srcdir)/ecoff.h | |
fecd2382 RP |
158 | |
159 | LINKED_HEADERS = \ | |
fecd2382 RP |
160 | targ-env.h \ |
161 | targ-cpu.h \ | |
162 | obj-format.h \ | |
163 | atof-targ.h | |
164 | ||
165 | HEADERS = $(LINKED_HEADERS) $(REAL_HEADERS) | |
166 | ||
7e047ac2 ILT |
167 | TE_OBJS= |
168 | ||
b11fb939 | 169 | # @target_frag@ |
b3cd8555 | 170 | |
fecd2382 RP |
171 | OBJS = \ |
172 | targ-cpu.o \ | |
173 | obj-format.o \ | |
174 | atof-targ.o \ | |
175 | app.o \ | |
176 | as.o \ | |
177 | atof-generic.o \ | |
178 | bignum-copy.o \ | |
179 | cond.o \ | |
180 | expr.o \ | |
5d53038b | 181 | flonum-konst.o \ |
fecd2382 RP |
182 | flonum-copy.o \ |
183 | flonum-mult.o \ | |
184 | frags.o \ | |
185 | hash.o \ | |
fecd2382 RP |
186 | input-file.o \ |
187 | input-scrub.o \ | |
dffc8b9e | 188 | literal.o \ |
fecd2382 RP |
189 | messages.o \ |
190 | output-file.o \ | |
191 | read.o \ | |
fecd2382 RP |
192 | subsegs.o \ |
193 | symbols.o \ | |
fecd2382 | 194 | write.o \ |
3340f7e5 | 195 | listing.o \ |
9cc8106c | 196 | ecoff.o \ |
c751ad19 | 197 | stabs.o \ |
7e047ac2 ILT |
198 | sb.o \ |
199 | macro.o \ | |
816a827b | 200 | @extra_objects@ \ |
b3cd8555 | 201 | $(TE_OBJS) |
f6b67e4c | 202 | |
7e047ac2 ILT |
203 | GASPOBJS = \ |
204 | gasp.o \ | |
205 | macro.o \ | |
206 | sb.o \ | |
207 | hash.o | |
208 | ||
1df6e266 | 209 | all: .gdbinit as.new gasp.new |
7420b02b JL |
210 | @srcroot=`cd $(srcroot); pwd`; export srcroot; \ |
211 | (cd doc ; $(MAKE) $(FLAGS_TO_PASS) all) | |
79a54a5b | 212 | |
7420b02b JL |
213 | dvi info install-info clean-info: |
214 | @srcroot=`cd $(srcroot); pwd`; export srcroot; \ | |
215 | (cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@) | |
fecd2382 | 216 | |
c20c7506 JL |
217 | make-gas.com: stamp-mk.com |
218 | stamp-mk.com: vmsconf.sh Makefile | |
816a827b | 219 | sh $(srcdir)/vmsconf.sh $(OBJS) > new-make.com |
c20c7506 JL |
220 | $(srcdir)/../move-if-change new-make.com $(srcdir)/make-gas.com |
221 | touch stamp-mk.com | |
222 | ||
fecd2382 RP |
223 | # Now figure out from those variables how to compile and link. |
224 | ||
225 | # This is the variable actually used when we compile. | |
420065a5 | 226 | ALL_CFLAGS = $(INTERNAL_CFLAGS) $(CROSS) $(CFLAGS) $(HDEFINES) $(TDEFINES) |
fecd2382 | 227 | |
fecd2382 RP |
228 | # How to link with both our special library facilities |
229 | # and the system's installed libraries. | |
f6b67e4c | 230 | |
b11fb939 | 231 | LIBS = @OPCODES_LIB@ @BFDLIB@ $(LOCAL_LOADLIBES) ../libiberty/libiberty.a |
fecd2382 RP |
232 | |
233 | # Specify the directories to be searched for header files. | |
234 | # Both . and srcdir are used, in that order, | |
235 | # so that tm.h and config.h will be found in the compilation | |
236 | # subdirectory rather than in the source directory. | |
816a827b | 237 | INCLUDES = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(srcdir)/../include -I$(srcdir)/.. -I$(srcdir)/../bfd |
fecd2382 RP |
238 | |
239 | # Always use -I$(srcdir)/config when compiling. | |
240 | .c.o: | |
241 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $< | |
242 | ||
243 | # This tells GNU make version 3 not to export all the variables | |
244 | # defined in this file into the environment. | |
245 | .NOEXPORT: | |
542e1629 | 246 | |
fecd2382 | 247 | # Files to be copied away after each stage in building. |
c20c7506 | 248 | STAGESTUFF = *.o as.new gasp.new |
fecd2382 | 249 | |
b11fb939 | 250 | $(OBJS): @ALL_OBJ_DEPS@ |
c92d9ee9 | 251 | |
7f2cb270 | 252 | as.new: $(OBJS) $(LIBS) |
da0b2bff | 253 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES) |
fecd2382 | 254 | |
84951544 KR |
255 | $(OBJS): config.h as.h targ-env.h obj-format.h targ-cpu.h flonum.h expr.h \ |
256 | struc-symbol.h write.h frags.h hash.h read.h symbols.h tc.h obj.h \ | |
257 | listing.h bignum.h | |
b11fb939 | 258 | |
138b11d8 ILT |
259 | gasp.new: $(GASPOBJS) ../libiberty/libiberty.a |
260 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o gasp.new $(GASPOBJS) ../libiberty/libiberty.a $(LOADLIBES) | |
a5a4b5ac | 261 | |
c97b9003 DZ |
262 | installcheck: |
263 | @echo No installcheck target is available yet for the GNU assembler. | |
264 | ||
5f757edc ILT |
265 | site.exp: ./Makefile |
266 | @echo "Making a new config file..." | |
267 | -@rm -f ./tmp? | |
268 | @touch site.exp | |
269 | -@mv site.exp site.bak | |
270 | @echo "## these variables are automatically generated by make ##" > ./tmp0 | |
271 | @echo "# Do not edit here. If you wish to override these values," >> ./tmp0 | |
272 | @echo "# do so in the last section." >> ./tmp0 | |
273 | @echo set host_os @host_os@ >> ./tmp0 | |
274 | @echo set host_alias @host_alias@ >> ./tmp0 | |
275 | @echo set host_cpu @host_cpu@ >> ./tmp0 | |
276 | @echo set host_vendor @host_vendor@ >> ./tmp0 | |
277 | @echo set target_os @target_os@ >> ./tmp0 | |
278 | @echo set target_alias @target_alias@ >> ./tmp0 | |
279 | @echo set target_cpu @target_cpu@ >> ./tmp0 | |
280 | @echo set target_vendor @target_vendor@ >> ./tmp0 | |
281 | @echo set host_triplet @host@ >> ./tmp0 | |
282 | @echo set target_triplet @target@ >> ./tmp0 | |
283 | @echo set target_canonical @target@ >> ./tmp0 | |
284 | @echo set srcdir ${srcdir} >> ./tmp0 | |
285 | @echo set exec_prefix ${exec_prefix} >> ./tmp0 | |
286 | @echo set objdir `pwd` >> ./tmp0 | |
287 | @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0 | |
288 | @sed -e '1,/^## All variables above are.*##/ d' < site.bak >> ./tmp0 | |
289 | @mv -f ./tmp0 site.exp | |
290 | ||
291 | check: site.exp | |
292 | if [ -d testsuite ]; then \ | |
293 | true; \ | |
294 | else \ | |
295 | mkdir testsuite; \ | |
296 | fi | |
297 | rm -f testsuite/site.exp | |
298 | cp site.exp testsuite/site.exp | |
299 | rootme=`pwd`; export rootme; \ | |
300 | srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \ | |
301 | cd testsuite; \ | |
302 | EXPECT=${EXPECT} ; export EXPECT ; \ | |
303 | if [ -f $${rootme}/../expect/expect ] ; then \ | |
304 | TCL_LIBRARY=$${srcdir}/../tcl/library ; \ | |
305 | export TCL_LIBRARY ; fi ; \ | |
306 | $(RUNTEST) --tool gas --srcdir $${srcdir}/testsuite $(RUNTESTFLAGS) | |
787c6bfe | 307 | |
b11fb939 KR |
308 | config.status: configure |
309 | if [ -r config.status ]; then \ | |
1be01033 | 310 | sh ./config.status --recheck ; \ |
b11fb939 KR |
311 | else \ |
312 | echo You must configure gas. Look at the INSTALL file for details. ; \ | |
313 | exit 1 ; \ | |
314 | fi | |
315 | ||
fc00f451 | 316 | config.h: config-stamp ; @true |
b11fb939 | 317 | config-stamp: Makefile conf |
fc00f451 | 318 | -rm -f config.new config-stamp |
1e84ff7e KR |
319 | echo '/* config.h. Generated automatically by make. */' > config.new |
320 | echo '#ifndef GAS_VERSION' >> config.new | |
b11fb939 KR |
321 | echo '#define GAS_VERSION "$(VERSION)"' >> config.new |
322 | echo '' >> config.new | |
323 | cat conf >> config.new | |
324 | echo '#endif /* GAS_VERSION */' >> config.new | |
fc00f451 KR |
325 | $(srcdir)/../move-if-change config.new config.h |
326 | touch config-stamp | |
327 | ||
fecd2382 RP |
328 | # Compiling object files from source files. |
329 | ||
833c46e1 KR |
330 | TARG_CPU_DEP_a29k = |
331 | TARG_CPU_DEP_alpha = | |
332 | # start-sanitize-arc | |
333 | TARG_CPU_DEP_arc = $(srcdir)/../include/opcode/arc.h | |
334 | # end-sanitize-arc | |
335 | TARG_CPU_DEP_arm = | |
336 | TARG_CPU_DEP_generic = | |
337 | TARG_CPU_DEP_h8300 = $(srcdir)/../include/opcode/h8300.h | |
338 | TARG_CPU_DEP_h8500 = $(srcdir)/../opcodes/h8500-opc.h | |
339 | TARG_CPU_DEP_hppa = | |
340 | TARG_CPU_DEP_i386 = $(srcdir)/../include/opcode/i386.h | |
341 | TARG_CPU_DEP_i860 = | |
342 | TARG_CPU_DEP_i960 = | |
a1c7c0f3 | 343 | TARG_CPU_DEP_m68k = $(srcdir)/../include/opcode/m68k.h \ |
7e047ac2 | 344 | $(srcdir)/config/m68k-parse.h subsegs.h |
833c46e1 KR |
345 | TARG_CPU_DEP_m88k = $(srcdir)/config/m88k-opcode.h |
346 | TARG_CPU_DEP_mips = $(srcdir)/../include/opcode/mips.h | |
347 | TARG_CPU_DEP_ns32k = | |
348 | TARG_CPU_DEP_ppc = | |
349 | # start-sanitize-rce | |
350 | TARG_CPU_DEP_rce = $(srcdir)/../opcodes/rce-opc.h | |
351 | # end-sanitize-rce | |
352 | TARG_CPU_DEP_sh = $(srcdir)/../opcodes/sh-opc.h | |
353 | TARG_CPU_DEP_sparc = | |
354 | TARG_CPU_DEP_tahoe = | |
355 | TARG_CPU_DEP_vax = | |
356 | TARG_CPU_DEP_w65 = $(srcdir)/../opcodes/w65-opc.h | |
357 | TARG_CPU_DEP_z8k = $(srcdir)/../opcodes/z8k-opc.h | |
358 | ||
7e047ac2 ILT |
359 | gasp.o : gasp.c sb.h macro.h config.h |
360 | sb.o : sb.c sb.h config.h | |
361 | macro.o : macro.c macro.h sb.h hash.h config.h | |
84951544 | 362 | app.o : app.c write.h |
7e047ac2 | 363 | as.o : as.c output-file.h write.h subsegs.h sb.h macro.h |
84951544 KR |
364 | atof-generic.o : atof-generic.c |
365 | bignum-copy.o : bignum-copy.c | |
366 | cond.o : cond.c | |
367 | debug.o : debug.c subsegs.h | |
368 | expr.o : expr.c | |
369 | flonum-konst.o : flonum-konst.c | |
370 | flonum-copy.o : flonum-copy.c | |
371 | flonum-mult.o : flonum-mult.c | |
372 | frags.o : frags.c subsegs.h | |
373 | hash.o : hash.c | |
84951544 | 374 | input-file.o : input-file.c input-file.h |
7e047ac2 | 375 | input-scrub.o : input-scrub.c input-file.h sb.h |
84951544 KR |
376 | listing.o : listing.c input-file.h subsegs.h |
377 | literal.o : literal.c subsegs.h | |
378 | messages.o : messages.c | |
379 | output-file.o : output-file.c output-file.h | |
7e047ac2 | 380 | read.o : read.c sb.h macro.h |
84951544 KR |
381 | subsegs.o : subsegs.c subsegs.h |
382 | symbols.o : symbols.c subsegs.h | |
383 | write.o : write.c subsegs.h output-file.h | |
384 | ecoff.o : ecoff.c ecoff.h \ | |
385 | $(srcdir)/../include/coff/internal.h $(srcdir)/../include/coff/sym.h \ | |
386 | $(srcdir)/../include/coff/ecoff.h \ | |
387 | $(srcdir)/../include/coff/symconst.h \ | |
388 | $(srcdir)/../include/aout/stab_gnu.h | |
389 | stabs.o : stabs.c subsegs.h $(srcdir)/../include/aout/stab_gnu.h | |
390 | atof-targ.o : atof-targ.c | |
391 | obj-format.o : obj-format.c | |
bf4bd1fc | 392 | targ-cpu.o : targ-cpu.c $(TARG_CPU_DEP_@target_cpu_type@) |
d1a9e594 | 393 | |
816a827b ILT |
394 | obj-elf.o : $(srcdir)/config/obj-elf.c |
395 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-elf.c | |
396 | obj-ecoff.o : $(srcdir)/config/obj-ecoff.c | |
397 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-ecoff.c | |
398 | ||
399 | e-mipself.o : $(srcdir)/config/e-mipself.c | |
400 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-mipself.c | |
401 | e-mipsecoff.o : $(srcdir)/config/e-mipsecoff.c | |
402 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-mipsecoff.c | |
403 | ||
a1c7c0f3 ILT |
404 | # The m68k operand parser. |
405 | ||
406 | m68k-parse.c: $(srcdir)/config/m68k-parse.y | |
407 | $(BISON) $(BISONFLAGS) $(srcdir)/config/m68k-parse.y | |
408 | mv -f y.tab.c m68k-parse.c | |
336435bc | 409 | m68k-parse.o: m68k-parse.c $(srcdir)/config/m68k-parse.h |
a1c7c0f3 | 410 | |
fecd2382 RP |
411 | # Remake the info files. |
412 | ||
921faa52 | 413 | doc: $(srcdir)/as.info |
fecd2382 | 414 | |
921faa52 | 415 | $(srcdir)/as.info: $(srcdir)/doc/as.texinfo |
c97b9003 | 416 | @(cd doc; $(MAKE) $(FLAGS_TO_PASS) as.info; mv as.info $srcdir) |
fecd2382 | 417 | |
6d60424f | 418 | diststuff: $(DISTSTUFF) |
367d6244 | 419 | |
7420b02b | 420 | clean-here: |
f2889110 | 421 | -rm -f $(STAGESTUFF) core stamp-mk.com |
5f757edc | 422 | -rm -rf testsuite |
fecd2382 | 423 | |
daa7e184 ILT |
424 | clean mostlyclean: clean-here |
425 | @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@ | |
7420b02b | 426 | |
fecd2382 | 427 | # Like clean but also delete the links made to configure gas. |
367d6244 | 428 | distclean: clean-here |
daa7e184 | 429 | @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@ |
b11fb939 | 430 | -rm -f config.status Makefile targ-env.h targ-cpu.h \ |
7420b02b | 431 | targ-cpu.c obj-format.h obj-format.c atof-targ.c TAGS \ |
f2889110 | 432 | config-stamp config.h conf config.log config.cache .gdbinit |
6b0a6eaa KR |
433 | maintainer-clean realclean: clean distclean |
434 | @echo "This command is intended for maintainers to use;" | |
435 | @echo "it deletes files that may require special tools to rebuild." | |
6d60424f | 436 | -rm -rf $(DISTSTUFF) |
542e1629 | 437 | |
fecd2382 RP |
438 | # Entry points `install', `includes' and `uninstall'. |
439 | ||
440 | # Copy the files into directories where they will be run. | |
542e1629 | 441 | install: |
7420b02b | 442 | srcroot=`cd $(srcroot); pwd`; export srcroot; \ |
c97b9003 | 443 | $(INSTALL_XFORM) as.new $(bindir)/as; \ |
7420b02b | 444 | $(INSTALL_XFORM1) $(srcdir)/doc/as.1 $(man1dir)/as.1; \ |
28d3e4a3 | 445 | n=`echo as | sed '$(program_transform_name)'`; \ |
efbfb612 ILT |
446 | if [ -d $(tooldir) ]; then \ |
447 | if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \ | |
448 | rm -f $(tooldir)/bin/as; \ | |
ac7f7dfe | 449 | ln $(bindir)/$$n $(tooldir)/bin/as >/dev/null 2>/dev/null \ |
efbfb612 ILT |
450 | || $(INSTALL_PROGRAM) as.new $(tooldir)/bin/as; \ |
451 | else true; fi | |
a5a4b5ac | 452 | srcroot=`cd $(srcroot); pwd`; export srcroot; \ |
138b11d8 | 453 | $(INSTALL_XFORM) gasp.new $(bindir)/gasp |
fecd2382 | 454 | |
fecd2382 RP |
455 | # Cancel installation by deleting the installed files. |
456 | uninstall: | |
fa156ffe | 457 | -n=`t='$(program_transform_name)'; echo as | sed $$t`; \ |
7e10f53c ILT |
458 | rm -f $(bindir)/$$n; \ |
459 | rm -f $(mandir)/$$n.1 | |
fa156ffe | 460 | -n=`t='$(program_transform_name)'; echo gasp | sed $$t`; \ |
a5a4b5ac | 461 | rm -f $(bindir)/$$n; \ |
542e1629 | 462 | |
fecd2382 RP |
463 | # These exist for maintenance purposes. |
464 | ||
465 | tags TAGS: force | |
787c6bfe | 466 | etags $(REAL_HEADERS) $(REAL_SOURCES) $(srcdir)/config/*.[hc] $(srcdir)/README $(srcdir)/Makefile.in |
ac7f7dfe | 467 | |
542e1629 | 468 | bootstrap: as.new force |
fecd2382 | 469 | $(MAKE) stage1 |
3256c4b5 KR |
470 | rm -f stage && ln -s stage1 stage |
471 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new | |
fecd2382 | 472 | $(MAKE) stage2 |
3256c4b5 KR |
473 | rm -f stage && ln -s stage2 stage |
474 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new | |
a01bf1fb | 475 | $(MAKE) comparison against=stage2 |
fecd2382 RP |
476 | |
477 | bootstrap2: force | |
3256c4b5 KR |
478 | rm -f stage && ln -s stage1 stage |
479 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new | |
fecd2382 | 480 | $(MAKE) stage2 |
3256c4b5 KR |
481 | rm -f stage && ln -s stage2 stage |
482 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new | |
da0b2bff | 483 | $(MAKE) comparison against=stage2 |
fecd2382 RP |
484 | |
485 | bootstrap3: force | |
3256c4b5 KR |
486 | rm -f stage && ln -s stage2 stage |
487 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new | |
a01bf1fb | 488 | $(MAKE) comparison against=stage2 |
fecd2382 RP |
489 | |
490 | # Copy the object files from a particular stage into a subdirectory. | |
491 | stage1: force | |
492 | -mkdir stage1 | |
493 | -mv $(STAGESTUFF) stage1 | |
81f73963 | 494 | if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; ln -s as.new as) ; fi |
fecd2382 RP |
495 | |
496 | stage2: force | |
497 | -mkdir stage2 | |
498 | -mv $(STAGESTUFF) stage2 | |
81f73963 | 499 | if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; ln -s as.new as) ; fi |
fecd2382 RP |
500 | |
501 | stage3: force | |
502 | -mkdir stage3 | |
6a3958b2 | 503 | -mv $(STAGESTUFF) stage3 |
81f73963 | 504 | if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; ln -s as.new as) ; fi |
fecd2382 | 505 | |
a01bf1fb RP |
506 | against=stage2 |
507 | ||
f2889110 KR |
508 | # This rule is derived from corresponding code in the Makefile.in for gcc. |
509 | # The "tail +16c" is to bypass headers which may include timestamps or | |
510 | # temporary assembly file names. | |
a01bf1fb | 511 | comparison: force |
f2889110 | 512 | x=0 ; \ |
6b0a6eaa | 513 | for file in *.o ; do \ |
f2889110 KR |
514 | tail +16c ./$$file > tmp-foo1; \ |
515 | if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \ | |
516 | if cmp tmp-foo1 tmp-foo2 ; then \ | |
517 | true ; \ | |
518 | else \ | |
519 | echo $$file differs ; \ | |
520 | x=1 ; \ | |
521 | fi ; \ | |
522 | else true; fi ; \ | |
523 | done ; \ | |
524 | exit $$x | |
525 | -rm -f tmp-foo* | |
a01bf1fb | 526 | |
6a3958b2 | 527 | de-stage1: force |
b3cd8555 | 528 | - (cd stage1 ; rm -f as ; mv -f * ..) |
6a3958b2 RP |
529 | - rmdir stage1 |
530 | ||
531 | de-stage2: force | |
b3cd8555 | 532 | - (cd stage2 ; rm -f as ; mv -f * ..) |
6a3958b2 RP |
533 | - rmdir stage2 |
534 | ||
535 | de-stage3: force | |
b3cd8555 | 536 | - (cd stage3 ; rm -f as ; mv -f * ..) |
6a3958b2 | 537 | - rmdir stage3 |
fecd2382 | 538 | |
fecd2382 | 539 | #In GNU Make, ignore whether `stage*' exists. |
daa7e184 ILT |
540 | .PHONY: stage1 stage2 stage3 stage4 clean mostlyclean realclean distclean |
541 | .PHONY: TAGS bootstrap | |
fecd2382 RP |
542 | |
543 | force: | |
544 | ||
fc00f451 | 545 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) \ |
a1c7c0f3 | 546 | $(srcdir)/configure.in config.status conf.in |
a26878d1 | 547 | $(SHELL) ./config.status |
1df6e266 KR |
548 | .gdbinit: $(srcdir)/gdbinit.in config.status |
549 | $(SHELL) ./config.status |