f06d0b0de5a82a8d6dc7db0f641672ae4c223dc3
[binutils-gdb.git] / gas / Makefile.in
1 # Makefile for GNU Assembler
2 # Copyright (C) 1987-1992, 1993 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 2, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20 # The targets for external use include:
21 # all, doc, proto, install, uninstall, includes, TAGS,
22 # clean, mostlyclean, distclean, 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
27 VPATH = @srcdir@
28 srcdir = @srcdir@
29 srcroot = $(srcdir)/..
30
31 target_alias = @target_alias@
32 prefix = @prefix@
33
34 program_transform_name = @program_transform_name@
35 exec_prefix = @exec_prefix@
36 bindir = $(exec_prefix)/bin
37 libdir = $(exec_prefix)/lib
38 tooldir = $(exec_prefix)/$(target_alias)
39
40 datadir = $(prefix)/lib
41 mandir = $(prefix)/man
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
51 infodir = $(prefix)/info
52 includedir = $(prefix)/include
53 docdir = $(datadir)/doc
54
55 VERSION=cygnus-2.5.3
56
57 SHELL = /bin/sh
58
59 INSTALL = $${srcroot}/install.sh -c
60 INSTALL_PROGRAM = $(INSTALL)
61 INSTALL_DATA = $(INSTALL)
62 INSTALL_XFORM = $(INSTALL) -t='-e $(program_transform_name)'
63 INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1
64
65 DISTSTUFF= make-gas.com
66
67 AR = ar
68 AR_FLAGS = qv
69 BISON = bison -y
70 MAKEINFO = makeinfo
71 TEXI2DVI = texi2dvi
72 RANLIB = ranlib
73 CC = @CC@
74 CFLAGS = -g
75
76 MAKEOVERRIDES=
77
78 FLAGS_TO_PASS = \
79 "prefix=$(prefix)" \
80 "exec_prefix=$(exec_prefix)" \
81 "tooldir=$(tooldir)" \
82 "AR=$(AR)" \
83 "AR_FLAGS=$(AR_FLAGS)" \
84 "CC=$(CC)" \
85 "CFLAGS=$(CFLAGS)" \
86 "RANLIB=$(RANLIB)" \
87 "LOADLIBES=$(LOADLIBES)" \
88 "LDFLAGS=$(LDFLAGS)" \
89 "BISON=$(BISON)" \
90 "LEX=$(LEX)" \
91 "MAKEINFO=$(MAKEINFO)" \
92 "INSTALL=$(INSTALL)" \
93 "INSTALL_DATA=$(INSTALL_DATA)" \
94 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
95
96 RUNTEST = `if [ -f ${srcdir}/../dejagnu/runtest ] ; then \
97 echo ${srcdir}/../dejagnu/runtest ; else echo runtest; \
98 fi`
99 RUNTESTFLAGS=
100 CHECKFLAGS= \
101 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
102 "RUNTEST=$(RUNTEST)"
103
104 # Lists of files for various purposes.
105
106 REAL_SOURCES = \
107 $(srcdir)/app.c \
108 $(srcdir)/as.c \
109 $(srcdir)/atof-generic.c \
110 $(srcdir)/bignum-copy.c \
111 $(srcdir)/cond.c \
112 $(srcdir)/expr.c \
113 $(srcdir)/flonum-konst.c \
114 $(srcdir)/flonum-copy.c \
115 $(srcdir)/flonum-mult.c \
116 $(srcdir)/frags.c \
117 $(srcdir)/hash.c \
118 $(srcdir)/input-file.c \
119 $(srcdir)/input-scrub.c \
120 $(srcdir)/literal.c \
121 $(srcdir)/messages.c \
122 $(srcdir)/output-file.c \
123 $(srcdir)/read.c \
124 $(srcdir)/subsegs.c \
125 $(srcdir)/symbols.c \
126 $(srcdir)/write.c \
127 $(srcdir)/listing.c \
128 $(srcdir)/ecoff.c \
129 $(srcdir)/stabs.c
130
131 # in an expedient order
132 LINKED_SOURCES = \
133 targ-cpu.c \
134 obj-format.c \
135 atof-targ.c
136
137 SOURCES = $(LINKED_SOURCES) $(REAL_SOURCES)
138
139 REAL_HEADERS = \
140 $(srcdir)/as.h \
141 $(srcdir)/bignum.h \
142 $(srcdir)/expr.h \
143 $(srcdir)/flonum.h \
144 $(srcdir)/frags.h \
145 $(srcdir)/hash.h \
146 $(srcdir)/input-file.h \
147 $(srcdir)/listing.h \
148 $(srcdir)/tc.h \
149 $(srcdir)/obj.h \
150 $(srcdir)/read.h \
151 $(srcdir)/struc-symbol.h \
152 $(srcdir)/subsegs.h \
153 $(srcdir)/symbols.h \
154 $(srcdir)/write.h \
155 $(srcdir)/ecoff.h
156
157 LINKED_HEADERS = \
158 targ-env.h \
159 targ-cpu.h \
160 obj-format.h \
161 atof-targ.h
162
163 HEADERS = $(LINKED_HEADERS) $(REAL_HEADERS)
164
165 # @target_frag@
166
167 OBJS = \
168 targ-cpu.o \
169 obj-format.o \
170 atof-targ.o \
171 app.o \
172 as.o \
173 atof-generic.o \
174 bignum-copy.o \
175 cond.o \
176 expr.o \
177 flonum-konst.o \
178 flonum-copy.o \
179 flonum-mult.o \
180 frags.o \
181 hash.o \
182 input-file.o \
183 input-scrub.o \
184 literal.o \
185 messages.o \
186 output-file.o \
187 read.o \
188 subsegs.o \
189 symbols.o \
190 write.o \
191 listing.o \
192 ecoff.o \
193 stabs.o \
194 @extra_objects@ \
195 $(TE_OBJS)
196
197 all: .gdbinit as.new gasp.new
198 @srcroot=`cd $(srcroot); pwd`; export srcroot; \
199 (cd doc ; $(MAKE) $(FLAGS_TO_PASS) all)
200
201 dvi info install-info clean-info:
202 @srcroot=`cd $(srcroot); pwd`; export srcroot; \
203 (cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@)
204
205 make-gas.com: stamp-mk.com
206 stamp-mk.com: vmsconf.sh Makefile
207 sh $(srcdir)/vmsconf.sh $(OBJS) > new-make.com
208 $(srcdir)/../move-if-change new-make.com $(srcdir)/make-gas.com
209 touch stamp-mk.com
210
211 # Now figure out from those variables how to compile and link.
212
213 # This is the variable actually used when we compile.
214 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(CROSS) $(CFLAGS) $(HDEFINES) $(TDEFINES)
215
216 # How to link with both our special library facilities
217 # and the system's installed libraries.
218
219 LIBS = @OPCODES_LIB@ @BFDLIB@ $(LOCAL_LOADLIBES) ../libiberty/libiberty.a
220
221 # Specify the directories to be searched for header files.
222 # Both . and srcdir are used, in that order,
223 # so that tm.h and config.h will be found in the compilation
224 # subdirectory rather than in the source directory.
225 INCLUDES = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(srcdir)/../include -I$(srcdir)/.. -I$(srcdir)/../bfd
226
227 # Always use -I$(srcdir)/config when compiling.
228 .c.o:
229 $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $<
230
231 # This tells GNU make version 3 not to export all the variables
232 # defined in this file into the environment.
233 .NOEXPORT:
234
235 # Files to be copied away after each stage in building.
236 STAGESTUFF = *.o as.new gasp.new
237
238 $(OBJS): @ALL_OBJ_DEPS@
239
240 as.new: $(OBJS) $(LIBS)
241 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES)
242
243 $(OBJS): config.h as.h targ-env.h obj-format.h targ-cpu.h flonum.h expr.h \
244 struc-symbol.h write.h frags.h hash.h read.h symbols.h tc.h obj.h \
245 listing.h bignum.h
246
247 gasp.new: gasp.o
248 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o gasp.new gasp.o $(LIBS) $(LOADLIBES)
249
250 installcheck:
251 @echo No installcheck target is available yet for the GNU assembler.
252
253 check:
254 @(here=`pwd` ; export here ; \
255 cd testsuite ; $(MAKE) $(FLAGS_TO_PASS) $(CHECKFLAGS) check)
256
257 config.status: configure
258 if [ -r config.status ]; then \
259 sh ./config.status --recheck ; \
260 else \
261 echo You must configure gas. Look at the INSTALL file for details. ; \
262 exit 1 ; \
263 fi
264
265 config.h: config-stamp ; @true
266 config-stamp: Makefile conf
267 -rm -f config.new config-stamp
268 echo '/* config.h. Generated automatically by make. */' > config.new
269 echo '#ifndef GAS_VERSION' >> config.new
270 echo '#define GAS_VERSION "$(VERSION)"' >> config.new
271 echo '' >> config.new
272 cat conf >> config.new
273 echo '#endif /* GAS_VERSION */' >> config.new
274 $(srcdir)/../move-if-change config.new config.h
275 touch config-stamp
276
277 # Compiling object files from source files.
278
279 TARG_CPU_DEP_a29k =
280 TARG_CPU_DEP_alpha =
281 # start-sanitize-arc
282 TARG_CPU_DEP_arc = $(srcdir)/../include/opcode/arc.h
283 # end-sanitize-arc
284 TARG_CPU_DEP_arm =
285 TARG_CPU_DEP_generic =
286 TARG_CPU_DEP_h8300 = $(srcdir)/../include/opcode/h8300.h
287 TARG_CPU_DEP_h8500 = $(srcdir)/../opcodes/h8500-opc.h
288 TARG_CPU_DEP_hppa =
289 TARG_CPU_DEP_i386 = $(srcdir)/../include/opcode/i386.h
290 TARG_CPU_DEP_i860 =
291 TARG_CPU_DEP_i960 =
292 TARG_CPU_DEP_m68k = $(srcdir)/../include/opcode/m68k.h
293 TARG_CPU_DEP_m88k = $(srcdir)/config/m88k-opcode.h
294 TARG_CPU_DEP_mips = $(srcdir)/../include/opcode/mips.h
295 TARG_CPU_DEP_ns32k =
296 TARG_CPU_DEP_ppc =
297 # start-sanitize-rce
298 TARG_CPU_DEP_rce = $(srcdir)/../opcodes/rce-opc.h
299 # end-sanitize-rce
300 TARG_CPU_DEP_sh = $(srcdir)/../opcodes/sh-opc.h
301 TARG_CPU_DEP_sparc =
302 TARG_CPU_DEP_tahoe =
303 TARG_CPU_DEP_vax =
304 TARG_CPU_DEP_w65 = $(srcdir)/../opcodes/w65-opc.h
305 TARG_CPU_DEP_z8k = $(srcdir)/../opcodes/z8k-opc.h
306
307 gasp.o : gasp.c config.h
308 app.o : app.c write.h
309 as.o : as.c output-file.h write.h subsegs.h
310 atof-generic.o : atof-generic.c
311 bignum-copy.o : bignum-copy.c
312 cond.o : cond.c
313 debug.o : debug.c subsegs.h
314 expr.o : expr.c
315 flonum-konst.o : flonum-konst.c
316 flonum-copy.o : flonum-copy.c
317 flonum-mult.o : flonum-mult.c
318 frags.o : frags.c subsegs.h
319 hash.o : hash.c
320 input-file.o : input-file.c input-file.h
321 input-scrub.o : input-scrub.c input-file.h
322 listing.o : listing.c input-file.h subsegs.h
323 literal.o : literal.c subsegs.h
324 messages.o : messages.c
325 output-file.o : output-file.c output-file.h
326 read.o : read.c
327 subsegs.o : subsegs.c subsegs.h
328 symbols.o : symbols.c subsegs.h
329 write.o : write.c subsegs.h output-file.h
330 ecoff.o : ecoff.c ecoff.h \
331 $(srcdir)/../include/coff/internal.h $(srcdir)/../include/coff/sym.h \
332 $(srcdir)/../include/coff/ecoff.h \
333 $(srcdir)/../include/coff/symconst.h \
334 $(srcdir)/../include/aout/stab_gnu.h
335 stabs.o : stabs.c subsegs.h $(srcdir)/../include/aout/stab_gnu.h
336 atof-targ.o : atof-targ.c
337 obj-format.o : obj-format.c
338 targ-cpu.o : targ-cpu.c $(TARG_CPU_DEP_@cpu_type@)
339
340 obj-elf.o : $(srcdir)/config/obj-elf.c
341 $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-elf.c
342 obj-ecoff.o : $(srcdir)/config/obj-ecoff.c
343 $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-ecoff.c
344
345 e-mipself.o : $(srcdir)/config/e-mipself.c
346 $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-mipself.c
347 e-mipsecoff.o : $(srcdir)/config/e-mipsecoff.c
348 $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-mipsecoff.c
349
350 # Remake the info files.
351
352 doc: $(srcdir)/as.info
353
354 $(srcdir)/as.info: $(srcdir)/doc/as.texinfo
355 @(cd doc; $(MAKE) $(FLAGS_TO_PASS) as.info; mv as.info $srcdir)
356
357 diststuff: $(DISTSTUFF)
358
359 clean-here:
360 -rm -f $(STAGESTUFF) core stamp-mk.com
361
362 clean mostlyclean: clean-here
363 @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@
364 @if [ -d testsuite ] ; then \
365 cd testsuite ; $(MAKE) $(FLAGS_TO_PASS) $@ ; \
366 else true; fi
367
368 # Like clean but also delete the links made to configure gas.
369 distclean: clean-here
370 @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@
371 @if [ -d testsuite ] ; then \
372 cd testsuite ; $(MAKE) $(FLAGS_TO_PASS) $@ ; \
373 else true; fi
374 -rm -f config.status Makefile targ-env.h targ-cpu.h \
375 targ-cpu.c obj-format.h obj-format.c atof-targ.c TAGS \
376 config-stamp config.h conf config.log config.cache .gdbinit
377 realclean: clean distclean
378 -rm -rf $(DISTSTUFF)
379
380 # Entry points `install', `includes' and `uninstall'.
381
382 # Copy the files into directories where they will be run.
383 install:
384 srcroot=`cd $(srcroot); pwd`; export srcroot; \
385 $(INSTALL_XFORM) as.new $(bindir)/as; \
386 $(INSTALL_XFORM1) $(srcdir)/doc/as.1 $(man1dir)/as.1; \
387 n=`echo as | sed '$(program_transform_name)'`; \
388 if [ -d $(tooldir) ]; then \
389 if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \
390 rm -f $(tooldir)/bin/as; \
391 ln $(bindir)/$$n $(tooldir)/bin/as >/dev/null 2>/dev/null \
392 || $(INSTALL_PROGRAM) as.new $(tooldir)/bin/as; \
393 else true; fi
394 srcroot=`cd $(srcroot); pwd`; export srcroot; \
395 $(INSTALL_XFORM) gasp.new $(bindir)/gasp; \
396 n=`echo gasp | sed '$(program_transform_name)' `; \
397 if [ -d $(tooldir) ]; then \
398 if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \
399 rm -f $(tooldir)/bin/gasp; \
400 ln $(bindir)/$$n $(tooldir)/bin/gasp >/dev/null 2>/dev/null \
401 || $(INSTALL_PROGRAM) gasp.new $(tooldir)/bin/gasp; \
402 else true; fi
403
404 # Cancel installation by deleting the installed files.
405 uninstall:
406 -n=`t='$(program_transform_name)'; echo as | sed $$t`; \
407 rm -f $(bindir)/$$n; \
408 rm -f $(mandir)/$$n.1
409 -n=`t='$(program_transform_name)'; echo gasp | sed $$t`; \
410 rm -f $(bindir)/$$n; \
411
412 # These exist for maintenance purposes.
413
414 tags TAGS: force
415 etags $(REAL_HEADERS) $(REAL_SOURCES) $(srcdir)/config/*.[hc] $(srcdir)/README $(srcdir)/Makefile.in
416
417 bootstrap: as.new force
418 $(MAKE) stage1
419 rm -f stage && ln -s stage1 stage
420 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
421 $(MAKE) stage2
422 rm -f stage && ln -s stage2 stage
423 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
424 $(MAKE) comparison against=stage2
425
426 bootstrap2: force
427 rm -f stage && ln -s stage1 stage
428 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
429 $(MAKE) stage2
430 rm -f stage && ln -s stage2 stage
431 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
432 $(MAKE) comparison against=stage2
433
434 bootstrap3: force
435 rm -f stage && ln -s stage2 stage
436 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
437 $(MAKE) comparison against=stage2
438
439 # Copy the object files from a particular stage into a subdirectory.
440 stage1: force
441 -mkdir stage1
442 -mv $(STAGESTUFF) stage1
443 if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; ln -s as.new as) ; fi
444
445 stage2: force
446 -mkdir stage2
447 -mv $(STAGESTUFF) stage2
448 if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; ln -s as.new as) ; fi
449
450 stage3: force
451 -mkdir stage3
452 -mv $(STAGESTUFF) stage3
453 if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; ln -s as.new as) ; fi
454
455 against=stage2
456
457 # This rule is derived from corresponding code in the Makefile.in for gcc.
458 # The "tail +16c" is to bypass headers which may include timestamps or
459 # temporary assembly file names.
460 comparison: force
461 x=0 ; \
462 for file in $(STAGESTUFF) ; do \
463 tail +16c ./$$file > tmp-foo1; \
464 if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
465 if cmp tmp-foo1 tmp-foo2 ; then \
466 true ; \
467 else \
468 echo $$file differs ; \
469 x=1 ; \
470 fi ; \
471 else true; fi ; \
472 done ; \
473 exit $$x
474 -rm -f tmp-foo*
475
476 de-stage1: force
477 - (cd stage1 ; rm -f as ; mv -f * ..)
478 - rmdir stage1
479
480 de-stage2: force
481 - (cd stage2 ; rm -f as ; mv -f * ..)
482 - rmdir stage2
483
484 de-stage3: force
485 - (cd stage3 ; rm -f as ; mv -f * ..)
486 - rmdir stage3
487
488 #In GNU Make, ignore whether `stage*' exists.
489 .PHONY: stage1 stage2 stage3 stage4 clean mostlyclean realclean distclean
490 .PHONY: TAGS bootstrap
491
492 force:
493
494 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) \
495 $(srcdir)/configure.in config.status
496 $(SHELL) ./config.status
497 .gdbinit: $(srcdir)/gdbinit.in config.status
498 $(SHELL) ./config.status