2 # Makefile for GNU Assembler
3 # Copyright (C) 1987-1992, 1993 Free Software Foundation, Inc.
5 # This file is part of GNU GAS.
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)
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.
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.
21 # The targets for external use include:
22 # all, doc, proto, install, uninstall, includes, TAGS,
23 # clean, mostlyclean, distclean, realclean, stage1, stage2, stage3, stage4.
25 # Variables that exist for you to override.
26 # See below for how to change them for certain systems.
30 srcroot
= $(srcdir)/..
32 target_alias
= @target_alias@
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
)
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
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
66 DISTSTUFF
= make-gas.com
81 "exec_prefix=$(exec_prefix)" \
82 "tooldir=$(tooldir)" \
84 "AR_FLAGS=$(AR_FLAGS)" \
88 "LOADLIBES=$(LOADLIBES)" \
89 "LDFLAGS=$(LDFLAGS)" \
92 "MAKEINFO=$(MAKEINFO)" \
93 "INSTALL=$(INSTALL)" \
94 "INSTALL_DATA=$(INSTALL_DATA)" \
95 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
99 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
102 # Lists of files for various purposes.
107 $(srcdir)/atof-generic.c \
108 $(srcdir)/bignum-copy.c \
111 $(srcdir)/flonum-konst.c \
112 $(srcdir)/flonum-copy.c \
113 $(srcdir)/flonum-mult.c \
116 $(srcdir)/hex-value.c \
117 $(srcdir)/input-file.c \
118 $(srcdir)/input-scrub.c \
119 $(srcdir)/literal.c \
120 $(srcdir)/messages.c \
121 $(srcdir)/output-file.c \
123 $(srcdir)/subsegs.c \
124 $(srcdir)/symbols.c \
126 $(srcdir)/listing.c \
130 # in an expedient order
136 SOURCES
= $(LINKED_SOURCES
) $(REAL_SOURCES
)
145 $(srcdir)/input-file.h \
146 $(srcdir)/listing.h \
150 $(srcdir)/struc-symbol.h \
151 $(srcdir)/subsegs.h \
152 $(srcdir)/symbols.h \
162 HEADERS
= $(LINKED_HEADERS
) $(REAL_HEADERS
)
196 # These are objects we know we'll be pulling in from other directories.
197 # For VMS, we have to build them explicitly.
199 ..
/libiberty
/xmalloc.o \
200 ..
/libiberty
/xexit.o \
201 ..
/libiberty
/obstack.o \
202 ..
/libiberty
/strdup.o \
203 ..
/libiberty
/strncasecmp.o \
204 ..
/libiberty
/concat.o \
205 ..
/libiberty
/getopt.o \
206 ..
/libiberty
/getopt1.o \
207 ..
/libiberty
/getruntime.o
209 all: .gdbinit
as.new gasp.new
210 @srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
211 (cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) all)
213 dvi info install-info clean-info
:
214 @srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
215 (cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
)
217 make-gas.com
: stamp-mk.com
218 stamp-mk.com
: vmsconf.sh Makefile
219 sh
$(srcdir)/vmsconf.sh
$(OBJS
) $(VMS_OTHER_OBJS
) > new-make.com
220 $(srcdir)/..
/move-if-change new-make.com
$(srcdir)/make-gas.com
223 # Now figure out from those variables how to compile and link.
225 # This is the variable actually used when we compile.
226 ALL_CFLAGS
= $(INTERNAL_CFLAGS
) $(CROSS
) $(CFLAGS
) $(HDEFINES
) $(TDEFINES
)
228 # How to link with both our special library facilities
229 # and the system's installed libraries.
231 LIBS
= @OPCODES_LIB@ @BFDLIB@
$(LOCAL_LOADLIBES
) ..
/libiberty
/libiberty.a
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.
237 INCLUDES
= -I.
-I
$(srcdir) -I..
/bfd
-I
$(srcdir)/config
-I
$(srcdir)/..
/include -I
$(srcdir)/..
239 # Always use -I$(srcdir)/config when compiling.
241 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $<
243 # This tells GNU make version 3 not to export all the variables
244 # defined in this file into the environment.
247 # Files to be copied away after each stage in building.
248 STAGESTUFF
= *.o
as.new gasp.new
250 $(OBJS
): @ALL_OBJ_DEPS@
252 as.new
: $(OBJS
) $(LIBS
)
253 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
as.new
$(OBJS
) $(LIBS
) $(LOADLIBES
)
258 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o gasp.new gasp.o
$(LIBS
) $(LOADLIBES
)
261 @echo No
installcheck target is available yet for the GNU assembler.
264 @
(here
=`pwd` ; export here
; \
265 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $(CHECKFLAGS
) check)
267 config.status
: configure
268 if
[ -r config.status
]; then \
269 sh .
/config.status
--recheck
; \
271 echo You must configure gas. Look at the INSTALL file for details.
; \
275 config.h
: config-stamp
; @true
276 config-stamp
: Makefile conf
277 -rm -f config.new config-stamp
278 echo
'/* config.h. Generated automatically by make. */' > config.new
279 echo
'#ifndef GAS_VERSION' >> config.new
280 echo
'#define GAS_VERSION "$(VERSION)"' >> config.new
281 echo
'' >> config.new
282 cat conf
>> config.new
283 echo
'#endif /* GAS_VERSION */' >> config.new
284 $(srcdir)/..
/move-if-change config.new config.h
287 # Compiling object files from source files.
289 gasp.o
: gasp.c config.h
290 app.o
: app.c
as.h targ-env.h obj-format.h \
291 targ-cpu.h struc-symbol.h \
292 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
293 as.o
: as.c
as.h targ-env.h obj-format.h output-file.h \
294 targ-cpu.h struc-symbol.h \
295 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h subsegs.h \
297 atof-generic.o
: atof-generic.c
as.h targ-env.h obj-format.h \
298 targ-cpu.h struc-symbol.h \
299 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
300 bignum-copy.o
: bignum-copy.c
as.h \
301 targ-env.h obj-format.h \
302 targ-cpu.h struc-symbol.h \
303 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
304 cond.o
: cond.c
as.h targ-env.h obj-format.h \
305 targ-cpu.h struc-symbol.h \
306 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
308 debug.o
: debug.c
as.h targ-env.h obj-format.h \
309 targ-cpu.h struc-symbol.h \
310 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
312 expr.o
: expr.c
as.h targ-env.h obj-format.h \
313 targ-cpu.h struc-symbol.h \
314 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
316 flonum-konst.o
: flonum-konst.c flonum.h bignum.h
317 flonum-copy.o
: flonum-copy.c
as.h targ-env.h obj-format.h \
318 targ-cpu.h struc-symbol.h \
319 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
320 flonum-mult.o
: flonum-mult.c flonum.h bignum.h
321 frags.o
: frags.c
as.h targ-env.h obj-format.h \
322 targ-cpu.h struc-symbol.h \
323 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
325 hash.o
: hash.c
as.h targ-env.h obj-format.h \
326 targ-cpu.h struc-symbol.h \
327 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
328 hex-value.o
: hex-value.c
329 input-file.o
: input-file.c
as.h \
330 targ-env.h obj-format.h targ-cpu.h \
331 struc-symbol.h write.h flonum.h bignum.h expr.h \
332 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
333 input-scrub.o
: input-scrub.c
/usr
/include/errno.h
/usr
/include/sys
/errno.h \
334 as.h targ-env.h obj-format.h \
335 targ-cpu.h struc-symbol.h \
336 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
338 listing.o
: listing.c
as.h targ-env.h flonum.h bignum.h \
339 listing.h obj-format.h targ-cpu.h struc-symbol.h write.h expr.h \
340 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h subsegs.h
341 literal.o
: literal.c subsegs.h
as.h targ-env.h obj-format.h \
342 targ-cpu.h struc-symbol.h \
343 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
344 messages.o
: messages.c
as.h targ-env.h obj-format.h \
345 targ-cpu.h struc-symbol.h \
346 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
347 output-file.o
: output-file.c
as.h targ-env.h obj-format.h \
348 targ-cpu.h struc-symbol.h \
349 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
351 read.o
: read.c
as.h targ-env.h obj-format.h \
352 targ-cpu.h struc-symbol.h \
353 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
354 subsegs.o
: subsegs.c
as.h targ-env.h obj-format.h \
355 targ-cpu.h struc-symbol.h \
356 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
358 symbols.o
: symbols.c
as.h targ-env.h obj-format.h \
359 targ-cpu.h struc-symbol.h \
360 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
362 write.o
: write.c
as.h targ-env.h obj-format.h \
363 targ-cpu.h struc-symbol.h \
364 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
365 subsegs.h output-file.h
366 ecoff.o
: ecoff.c
as.h targ-env.h obj-format.h \
367 targ-cpu.h struc-symbol.h \
368 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
369 ecoff.h
$(srcdir)/..
/include/coff
/internal.h \
370 $(srcdir)/..
/include/coff
/sym.h
$(srcdir)/..
/include/coff
/ecoff.h \
371 $(srcdir)/..
/include/coff
/symconst.h
$(srcdir)/..
/include/aout
/stab_gnu.h
372 stabs.o
: stabs.c
as.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 symbols.h tc.h obj.h \
375 subsegs.h
$(srcdir)/..
/include/aout
/stab_gnu.h
376 atof-targ.o
: atof-targ.c
as.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 \
380 obj-format.o
: obj-format.c
as.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 subsegs.h symbols.h tc.h obj.h
384 targ-cpu.o
: targ-cpu.c config.h targ-env.h obj-format.h \
385 targ-cpu.h struc-symbol.h \
386 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
387 symbols.h tc.h obj.h
$(TARG_CPU_DEPENDENTS
)
389 # Remake the info files.
391 doc
: $(srcdir)/as.
info
393 $(srcdir)/as.
info: $(srcdir)/doc
/as.texinfo
394 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) as.
info; mv
as.
info $srcdir)
396 diststuff
: $(DISTSTUFF
)
399 -rm -f
$(STAGESTUFF
) core stamp-mk.com
401 clean mostlyclean: clean-here
402 @cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
403 @if
[ -d testsuite
] ; then \
404 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $@
; \
407 # Like clean but also delete the links made to configure gas.
408 distclean: clean-here
409 @cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
410 @if
[ -d testsuite
] ; then \
411 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $@
; \
413 -rm -f config.status Makefile targ-env.h targ-cpu.h \
414 targ-cpu.c obj-format.h obj-format.c atof-targ.c TAGS \
415 config-stamp config.h conf config.log config.cache .gdbinit
416 realclean: clean distclean
419 # Entry points `install', `includes' and `uninstall'.
421 # Copy the files into directories where they will be run.
423 srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
424 $(INSTALL_XFORM
) as.new
$(bindir)/as; \
425 $(INSTALL_XFORM1
) $(srcdir)/doc
/as.1 $(man1dir)/as.1; \
426 n
=`echo as | sed '$(program_transform_name)'`; \
427 if
[ -d
$(tooldir
) ]; then \
428 if
[ -d
$(tooldir
)/bin
] ; then true
; else mkdir
$(tooldir
)/bin
; fi
; \
429 rm -f
$(tooldir
)/bin
/as; \
430 ln
$(bindir)/$$n $(tooldir
)/bin
/as >/dev
/null
2>/dev
/null \
431 ||
$(INSTALL_PROGRAM
) as.new
$(tooldir
)/bin
/as; \
433 srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
434 $(INSTALL_XFORM
) gasp.new
$(bindir)/gasp
; \
435 n
=`echo gasp | sed '$(program_transform_name)' `; \
436 if
[ -d
$(tooldir
) ]; then \
437 if
[ -d
$(tooldir
)/bin
] ; then true
; else mkdir
$(tooldir
)/bin
; fi
; \
438 rm -f
$(tooldir
)/bin
/gasp
; \
439 ln
$(bindir)/$$n $(tooldir
)/bin
/gasp
>/dev
/null
2>/dev
/null \
440 ||
$(INSTALL_PROGRAM
) gasp.new
$(tooldir
)/bin
/gasp
; \
443 # Cancel installation by deleting the installed files.
445 -n
=`t='$(program_transform_name)'; echo as | sed $$t`; \
446 rm -f
$(bindir)/$$n; \
447 rm -f
$(mandir)/$$n.1
448 -n
=`t='$(program_transform_name)'; echo gasp | sed $$t`; \
449 rm -f
$(bindir)/$$n; \
451 # These exist for maintenance purposes.
454 etags
$(REAL_HEADERS
) $(REAL_SOURCES
) $(srcdir)/config
/*.
[hc
] $(srcdir)/README
$(srcdir)/Makefile.in
456 bootstrap
: as.new
force
458 rm -f stage
&& ln
-s stage1 stage
459 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
461 rm -f stage
&& ln
-s stage2 stage
462 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
463 $(MAKE
) comparison against
=stage2
466 rm -f stage
&& ln
-s stage1 stage
467 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
469 rm -f stage
&& ln
-s stage2 stage
470 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
471 $(MAKE
) comparison against
=stage2
474 rm -f stage
&& ln
-s stage2 stage
475 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
476 $(MAKE
) comparison against
=stage2
478 # Copy the object files from a particular stage into a subdirectory.
481 -mv
$(STAGESTUFF
) stage1
482 if
[ -f stage1
/as.new
-a
! -f stage1
/as ] ; then
(cd stage1
; ln
-s
as.new
as) ; fi
486 -mv
$(STAGESTUFF
) stage2
487 if
[ -f stage2
/as.new
-a
! -f stage2
/as ] ; then
(cd stage2
; ln
-s
as.new
as) ; fi
491 -mv
$(STAGESTUFF
) stage3
492 if
[ -f stage3
/as.new
-a
! -f stage3
/as ] ; then
(cd stage3
; ln
-s
as.new
as) ; fi
496 # This rule is derived from corresponding code in the Makefile.in for gcc.
497 # The "tail +16c" is to bypass headers which may include timestamps or
498 # temporary assembly file names.
501 for file in
$(STAGESTUFF
) ; do \
502 tail
+16c .
/$$file > tmp-foo1
; \
503 if tail
+16c
${against}/$$file > tmp-foo2
2>/dev
/null
; then \
504 if cmp tmp-foo1 tmp-foo2
; then \
507 echo
$$file differs
; \
516 - (cd stage1
; rm -f
as ; mv
-f
* ..
)
520 - (cd stage2
; rm -f
as ; mv
-f
* ..
)
524 - (cd stage3
; rm -f
as ; mv
-f
* ..
)
527 #In GNU Make, ignore whether `stage*' exists.
528 .PHONY
: stage1 stage2 stage3 stage4
clean mostlyclean realclean distclean
529 .PHONY
: TAGS bootstrap
533 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
) \
534 $(srcdir)/configure.in config.status
535 $(SHELL
) .
/config.status
536 .gdbinit
: $(srcdir)/gdbinit.in config.status
537 $(SHELL
) .
/config.status