* ecoff.c (ecoff_setup_ext): Renamed from ecoff_build_ext.
[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, 675 Mass Ave, Cambridge, MA 02139, USA.
19
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
27 srcdir = .
28 srcroot = $(srcdir)/..
29
30 prefix = /usr/local
31
32 program_transform_name =
33 exec_prefix = $(prefix)
34 bindir = $(exec_prefix)/bin
35 libdir = $(exec_prefix)/lib
36 tooldir = $(libdir)/$(target_alias)
37
38 datadir = $(prefix)/lib
39 mandir = $(prefix)/man
40 man1dir = $(mandir)/man1
41 man2dir = $(mandir)/man2
42 man3dir = $(mandir)/man3
43 man4dir = $(mandir)/man4
44 man5dir = $(mandir)/man5
45 man6dir = $(mandir)/man6
46 man7dir = $(mandir)/man7
47 man8dir = $(mandir)/man8
48 man9dir = $(mandir)/man9
49 infodir = $(prefix)/info
50 includedir = $(prefix)/include
51 docdir = $(datadir)/doc
52
53 VERSION=cygnus-2.2.1
54
55 SHELL = /bin/sh
56
57 INSTALL = $${srcroot}/install.sh -c
58 INSTALL_PROGRAM = $(INSTALL)
59 INSTALL_DATA = $(INSTALL)
60 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
61 INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1
62
63 AR = ar
64 AR_FLAGS = qv
65 BISON = bison
66 MAKEINFO = makeinfo
67 TEXI2DVI = texi2dvi
68 RANLIB = ranlib
69 CFLAGS = -g
70
71 MAKEOVERRIDES=
72
73 AS_FOR_TARGET = $${here}/as.new
74
75 CC_FOR_TARGET = ` \
76 if [ -f $${here}/../gcc/Makefile ] ; then \
77 echo $${here}/../gcc/xgcc -B$${here}/../gcc/; \
78 else \
79 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
80 echo $(CC); \
81 else \
82 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
83 fi; \
84 fi`
85
86 NM_FOR_TARGET = ` \
87 if [ -f $${here}/../binutils/Makefile ] ; then \
88 echo $${here}/../binutils/nm ; \
89 else \
90 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
91 echo $(NM); \
92 else \
93 t='$(program_transform_name)'; echo nm | sed -e '' $$t ; \
94 fi; \
95 fi`
96
97 OBJDUMP=objdump
98 OBJDUMP_FOR_TARGET = ` \
99 if [ -f $${here}/../binutils/Makefile ] ; then \
100 echo $${here}/../binutils/objdump ; \
101 else \
102 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
103 echo $(OBJDUMP); \
104 else \
105 t='$(program_transform_name)'; echo objdump | sed -e '' $$t ; \
106 fi; \
107 fi`
108
109 FLAGS_TO_PASS = \
110 "prefix=$(prefix)" \
111 "exec_prefix=$(exec_prefix)" \
112 "tooldir=$(tooldir)" \
113 "AR=$(AR)" \
114 "AR_FLAGS=$(AR_FLAGS)" \
115 "CC=$(CC)" \
116 "CFLAGS=$(CFLAGS)" \
117 "RANLIB=$(RANLIB)" \
118 "LOADLIBES=$(LOADLIBES)" \
119 "LDFLAGS=$(LDFLAGS)" \
120 "BISON=$(BISON)" \
121 "LEX=$(LEX)" \
122 "MAKEINFO=$(MAKEINFO)" \
123 "INSTALL=$(INSTALL)" \
124 "INSTALL_DATA=$(INSTALL_DATA)" \
125 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
126
127 CHECKFLAGS= \
128 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
129 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
130 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
131 "OBJDUMP_FOR_TARGET=$(OBJDUMP_FOR_TARGET)" \
132 "RUNTEST_FLAGS=$(RUNTEST_FLAGS)"
133
134 # Lists of files for various purposes.
135
136 REAL_SOURCES = \
137 $(srcdir)/app.c \
138 $(srcdir)/as.c \
139 $(srcdir)/atof-generic.c \
140 $(srcdir)/bignum-copy.c \
141 $(srcdir)/cond.c \
142 $(srcdir)/expr.c \
143 $(srcdir)/flonum-konst.c \
144 $(srcdir)/flonum-copy.c \
145 $(srcdir)/flonum-mult.c \
146 $(srcdir)/frags.c \
147 $(srcdir)/hash.c \
148 $(srcdir)/hex-value.c \
149 $(srcdir)/input-file.c \
150 $(srcdir)/input-scrub.c \
151 $(srcdir)/messages.c \
152 $(srcdir)/output-file.c \
153 $(srcdir)/read.c \
154 $(srcdir)/subsegs.c \
155 $(srcdir)/symbols.c \
156 $(srcdir)/write.c \
157 $(srcdir)/listing.c \
158 $(srcdir)/ecoff.c \
159 $(srcdir)/xmalloc.c
160
161 # in an expedient order
162 LINKED_SOURCES = \
163 targ-cpu.c \
164 obj-format.c \
165 atof-targ.c
166
167 SOURCES = $(LINKED_SOURCES) $(REAL_SOURCES)
168
169 REAL_HEADERS = \
170 $(srcdir)/as.h \
171 $(srcdir)/bignum.h \
172 $(srcdir)/expr.h \
173 $(srcdir)/flonum.h \
174 $(srcdir)/frags.h \
175 $(srcdir)/hash.h \
176 $(srcdir)/input-file.h \
177 $(srcdir)/listing.h \
178 $(srcdir)/tc.h \
179 $(srcdir)/obj.h \
180 $(srcdir)/read.h \
181 $(srcdir)/struc-symbol.h \
182 $(srcdir)/subsegs.h \
183 $(srcdir)/symbols.h \
184 $(srcdir)/write.h \
185 $(srcdir)/ecoff.h
186
187 LINKED_HEADERS = \
188 a.out.gnu.h \
189 a.out.h \
190 host.h \
191 targ-env.h \
192 targ-cpu.h \
193 obj-format.h \
194 atof-targ.h
195
196 HEADERS = $(LINKED_HEADERS) $(REAL_HEADERS)
197
198 OBJS = \
199 targ-cpu.o \
200 obj-format.o \
201 atof-targ.o \
202 app.o \
203 as.o \
204 atof-generic.o \
205 bignum-copy.o \
206 cond.o \
207 expr.o \
208 flonum-konst.o \
209 flonum-copy.o \
210 flonum-mult.o \
211 frags.o \
212 hash.o \
213 hex-value.o \
214 input-file.o \
215 input-scrub.o \
216 messages.o \
217 output-file.o \
218 read.o \
219 subsegs.o \
220 symbols.o \
221 write.o \
222 listing.o \
223 ecoff.o \
224 xmalloc.o
225
226 #### host, target, and site specific Makefile frags come in here.
227
228 all: as.new
229 @srcroot=`cd $(srcroot); pwd`; export srcroot; \
230 (cd doc ; $(MAKE) $(FLAGS_TO_PASS) all)
231
232 dvi info install-info clean-info:
233 @srcroot=`cd $(srcroot); pwd`; export srcroot; \
234 (cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@)
235
236 # Now figure out from those variables how to compile and link.
237
238 # This is the variable actually used when we compile.
239 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(CROSS) $(CFLAGS) $(HDEFINES) $(TDEFINES) \
240 $(BFDDEF)
241
242 # How to link with both our special library facilities
243 # and the system's installed libraries.
244
245 LIBS = ../opcodes/libopcodes.a $(BFDLIB) $(LOCAL_LOADLIBES) \
246 ../libiberty/libiberty.a
247
248 # Specify the directories to be searched for header files.
249 # Both . and srcdir are used, in that order,
250 # so that tm.h and config.h will be found in the compilation
251 # subdirectory rather than in the source directory.
252 INCLUDES = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(srcdir)/../include
253 SUBDIR_INCLUDES = -I.. -I$(srcdir) -I$(srcdir)/config
254
255 # Always use -I$(srcdir)/config when compiling.
256 .c.o:
257 $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $<
258
259 # This tells GNU make version 3 not to export all the variables
260 # defined in this file into the environment.
261 .NOEXPORT:
262
263 # Files to be copied away after each stage in building.
264 STAGESTUFF = *.o as.new
265
266 as.new: $(OBJS) $(LIBS)
267 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES)
268
269 installcheck:
270 @echo No installcheck target is available yet for the GNU assembler.
271
272 check: as.new
273 @(here=`pwd` ; export here ; \
274 cd testsuite ; $(MAKE) $(FLAGS_TO_PASS) $(CHECKFLAGS) check)
275
276 config.status:
277 @echo You must configure gas. Look at the INSTALL file for details.
278 @false
279
280 config.h: config-stamp ; @true
281 config-stamp: Makefile
282 -rm -f config.new config-stamp
283 echo '#define TARGET_CPU "$(target_cpu)"' > config.new
284 echo '#define TARGET_ALIAS "$(target_alias)"' >> config.new
285 echo '#define TARGET_CANONICAL "$(target_canonical)"' >> config.new
286 echo '#define GAS_VERSION "$(VERSION)"' >> config.new
287 $(srcdir)/../move-if-change config.new config.h
288 touch config-stamp
289
290 # Compiling object files from source files.
291
292 app.o : app.c as.h host.h targ-env.h obj-format.h \
293 targ-cpu.h struc-symbol.h \
294 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
295 as.o : as.c as.h host.h targ-env.h obj-format.h output-file.h \
296 targ-cpu.h struc-symbol.h \
297 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h subsegs.h \
298 tc.h obj.h config.h
299 atof-generic.o : atof-generic.c as.h host.h targ-env.h obj-format.h \
300 targ-cpu.h struc-symbol.h \
301 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
302 bignum-copy.o : bignum-copy.c as.h host.h \
303 targ-env.h obj-format.h \
304 targ-cpu.h struc-symbol.h \
305 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
306 cond.o : cond.c as.h host.h targ-env.h obj-format.h \
307 targ-cpu.h struc-symbol.h \
308 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
309
310 debug.o : debug.c as.h host.h targ-env.h obj-format.h \
311 targ-cpu.h struc-symbol.h \
312 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
313 subsegs.h
314 expr.o : expr.c as.h host.h targ-env.h obj-format.h \
315 targ-cpu.h struc-symbol.h \
316 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
317
318 flonum-konst.o : flonum-konst.c flonum.h bignum.h
319 flonum-copy.o : flonum-copy.c as.h host.h targ-env.h obj-format.h \
320 targ-cpu.h struc-symbol.h \
321 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
322 flonum-mult.o : flonum-mult.c flonum.h bignum.h
323 frags.o : frags.c as.h host.h targ-env.h obj-format.h \
324 targ-cpu.h struc-symbol.h \
325 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
326 subsegs.h
327 hash.o : hash.c as.h host.h targ-env.h obj-format.h \
328 targ-cpu.h struc-symbol.h \
329 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
330 hex-value.o : hex-value.c
331 input-file.o : input-file.c as.h host.h \
332 targ-env.h obj-format.h targ-cpu.h \
333 struc-symbol.h write.h flonum.h bignum.h expr.h \
334 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
335 input-scrub.o : input-scrub.c /usr/include/errno.h /usr/include/sys/errno.h \
336 as.h host.h targ-env.h obj-format.h \
337 targ-cpu.h struc-symbol.h \
338 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
339 input-file.h
340 listing.o : listing.c as.h host.h targ-env.h flonum.h bignum.h \
341 listing.h obj-format.h targ-cpu.h struc-symbol.h write.h expr.h \
342 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
343 messages.o : messages.c as.h host.h targ-env.h obj-format.h \
344 targ-cpu.h struc-symbol.h \
345 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
346 output-file.o : output-file.c as.h host.h targ-env.h obj-format.h \
347 targ-cpu.h struc-symbol.h \
348 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
349 output-file.h
350 read.o : read.c as.h host.h targ-env.h obj-format.h \
351 targ-cpu.h struc-symbol.h \
352 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
353 subsegs.o : subsegs.c as.h host.h targ-env.h obj-format.h \
354 targ-cpu.h struc-symbol.h \
355 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
356 subsegs.h
357 symbols.o : symbols.c as.h host.h targ-env.h obj-format.h \
358 targ-cpu.h struc-symbol.h \
359 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
360 subsegs.h
361 write.o : write.c as.h host.h targ-env.h obj-format.h \
362 targ-cpu.h struc-symbol.h \
363 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
364 subsegs.h output-file.h
365 ecoff.o : ecoff.c as.h host.h targ-env.h obj-format.h \
366 targ-cpu.h struc-symbol.h \
367 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
368 ecoff.h $(srcdir)/../include/coff/internal.h \
369 $(srcdir)/../include/coff/sym.h $(srcdir)/../include/coff/ecoff.h \
370 $(srcdir)/../include/coff/symconst.h $(srcdir)/../include/aout/stab_gnu.h
371 xmalloc.o : xmalloc.c
372 atof-targ.o : atof-targ.c as.h host.h targ-env.h obj-format.h \
373 targ-cpu.h struc-symbol.h \
374 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
375 symbols.h tc.h obj.h
376 obj-format.o : obj-format.c as.h host.h targ-env.h obj-format.h \
377 targ-cpu.h struc-symbol.h \
378 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
379 subsegs.h symbols.h tc.h obj.h
380 targ-cpu.o : targ-cpu.c config.h targ-env.h obj-format.h \
381 targ-cpu.h struc-symbol.h \
382 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
383 symbols.h tc.h obj.h $(TARG_CPU_DEPENDENTS)
384
385 # Remake the info files.
386
387 doc: $(srcdir)/as.info
388
389 $(srcdir)/as.info: $(srcdir)/doc/as.texinfo
390 @(cd doc; $(MAKE) $(FLAGS_TO_PASS) as.info; mv as.info $srcdir)
391
392 clean-here:
393 -rm -f $(STAGESTUFF) core
394
395 clean:
396 @cd doc ; $(MAKE) $(FLAGS_TO_PASS) clean
397 @if [ -d testsuite ] ; then \
398 cd testsuite ; $(MAKE) $(FLAGS_TO_PASS) clean ; \
399 else true; fi
400
401 # Like clean but also delete the links made to configure gas.
402 distclean: clean-here
403 @cd doc ; $(MAKE) $(FLAGS_TO_PASS) distclean
404 @if [ -d testsuite ] ; then \
405 cd testsuite ; $(MAKE) $(FLAGS_TO_PASS) distclean ; \
406 else true; fi
407 -rm -f config.status Makefile host.h targ-env.h targ-cpu.h \
408 targ-cpu.c obj-format.h obj-format.c atof-targ.c TAGS \
409 config-stamp config.h
410
411 # Entry points `install', `includes' and `uninstall'.
412
413 # Copy the files into directories where they will be run.
414 install:
415 srcroot=`cd $(srcroot); pwd`; export srcroot; \
416 $(INSTALL_XFORM) as.new $(bindir)/as; \
417 $(INSTALL_XFORM1) $(srcdir)/doc/as.1 $(man1dir)/as.1; \
418 n=`t='$(program_transform_name)'; echo as | sed -e "" $$t`; \
419 if [ -d $(tooldir) ]; then \
420 if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \
421 rm -f $(tooldir)/bin/as; \
422 ln $(bindir)/$$n $(tooldir)/bin/as \
423 || $(INSTALL_PROGRAM) as.new $(tooldir)/bin/as; \
424 else true; fi
425
426 # Cancel installation by deleting the installed files.
427 uninstall:
428 -n=`t='$(program_transform_name)'; echo as | sed -e "" $$t`; \
429 rm -f $(bindir)/$$n; \
430 rm -f $(mandir)/$$n.1
431
432 # These exist for maintenance purposes.
433
434 tags TAGS: force
435 etags $(REAL_HEADERS) $(REAL_SOURCES) $(srcdir)/config/*.[hc] $(srcdir)/README $(srcdir)/Makefile.in
436
437 bootstrap: as.new force
438 $(MAKE) stage1
439 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
440 $(MAKE) stage2
441 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
442 $(MAKE) comparison against=stage2
443
444 bootstrap2: force
445 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
446 $(MAKE) stage2
447 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
448 $(MAKE) comparison against=stage2
449
450 bootstrap3: force
451 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
452 $(MAKE) comparison against=stage2
453
454 # Copy the object files from a particular stage into a subdirectory.
455 stage1: force
456 -mkdir stage1
457 -mv $(STAGESTUFF) stage1
458 if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; ln -s as.new as) ; fi
459
460 stage2: force
461 -mkdir stage2
462 -mv $(STAGESTUFF) stage2
463 if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; ln -s as.new as) ; fi
464
465 stage3: force
466 -mkdir stage3
467 -mv $(STAGESTUFF) stage3
468 if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; ln -s as.new as) ; fi
469
470 against=stage2
471
472 comparison: force
473 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
474
475 de-stage1: force
476 - (cd stage1 ; rm as ; mv -f * ..)
477 - rmdir stage1
478
479 de-stage2: force
480 - (cd stage2 ; rm as ; mv -f * ..)
481 - rmdir stage2
482
483 de-stage3: force
484 - (cd stage3 ; rm as ; mv -f * ..)
485 - rmdir stage3
486
487 #In GNU Make, ignore whether `stage*' exists.
488 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
489
490 force:
491
492 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) \
493 $(srcdir)/configure.in
494 $(SHELL) ./config.status