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