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
= $(libdir)/$(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
79 AS_FOR_TARGET
= $${here}/as.new
82 if [ -f $${here}/../gcc/Makefile ] ; then \
83 echo $${here}/../gcc/xgcc -B$${here}/../gcc/; \
85 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
88 echo gcc | sed '$(program_transform_name)'; \
94 if [ -f $${here}/../binutils/Makefile ] ; then \
95 echo $${here}/../binutils/nm ; \
97 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
100 echo nm | sed '$(program_transform_name)' ; \
105 OBJDUMP_FOR_TARGET
= ` \
106 if [ -f $${here}/../binutils/Makefile ] ; then \
107 echo $${here}/../binutils/objdump ; \
109 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
112 echo objdump | sed '$(program_transform_name)' ; \
118 "exec_prefix=$(exec_prefix)" \
119 "tooldir=$(tooldir)" \
121 "AR_FLAGS=$(AR_FLAGS)" \
125 "LOADLIBES=$(LOADLIBES)" \
126 "LDFLAGS=$(LDFLAGS)" \
129 "MAKEINFO=$(MAKEINFO)" \
130 "INSTALL=$(INSTALL)" \
131 "INSTALL_DATA=$(INSTALL_DATA)" \
132 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
136 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
137 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
138 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
139 "OBJDUMP_FOR_TARGET=$(OBJDUMP_FOR_TARGET)" \
140 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
143 # Lists of files for various purposes.
148 $(srcdir)/atof-generic.c \
149 $(srcdir)/bignum-copy.c \
152 $(srcdir)/flonum-konst.c \
153 $(srcdir)/flonum-copy.c \
154 $(srcdir)/flonum-mult.c \
157 $(srcdir)/hex-value.c \
158 $(srcdir)/input-file.c \
159 $(srcdir)/input-scrub.c \
160 $(srcdir)/literal.c \
161 $(srcdir)/messages.c \
162 $(srcdir)/output-file.c \
164 $(srcdir)/subsegs.c \
165 $(srcdir)/symbols.c \
167 $(srcdir)/listing.c \
172 # in an expedient order
178 SOURCES
= $(LINKED_SOURCES
) $(REAL_SOURCES
)
187 $(srcdir)/input-file.h \
188 $(srcdir)/listing.h \
192 $(srcdir)/struc-symbol.h \
193 $(srcdir)/subsegs.h \
194 $(srcdir)/symbols.h \
204 HEADERS
= $(LINKED_HEADERS
) $(REAL_HEADERS
)
239 # These are objects we know we'll be pulling in from other directories.
240 # For VMS, we have to build them explicitly.
242 ..
/libiberty
/obstack.o \
243 ..
/libiberty
/strdup.o \
244 ..
/libiberty
/strncasecmp.o \
245 ..
/libiberty
/concat.o \
246 ..
/libiberty
/getopt.o \
247 ..
/libiberty
/getopt1.o \
248 ..
/libiberty
/getruntime.o
250 all: .gdbinit
as.new gasp.new
251 @srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
252 (cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) all)
254 dvi info install-info clean-info
:
255 @srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
256 (cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
)
258 make-gas.com
: stamp-mk.com
259 stamp-mk.com
: vmsconf.sh Makefile
260 sh
$(srcdir)/vmsconf.sh
$(OBJS
) $(VMS_OTHER_OBJS
) > new-make.com
261 $(srcdir)/..
/move-if-change new-make.com
$(srcdir)/make-gas.com
264 # Now figure out from those variables how to compile and link.
266 # This is the variable actually used when we compile.
267 ALL_CFLAGS
= $(INTERNAL_CFLAGS
) $(CROSS
) $(CFLAGS
) $(HDEFINES
) $(TDEFINES
)
269 # How to link with both our special library facilities
270 # and the system's installed libraries.
272 LIBS
= @OPCODES_LIB@ @BFDLIB@
$(LOCAL_LOADLIBES
) ..
/libiberty
/libiberty.a
274 # Specify the directories to be searched for header files.
275 # Both . and srcdir are used, in that order,
276 # so that tm.h and config.h will be found in the compilation
277 # subdirectory rather than in the source directory.
278 INCLUDES
= -I.
-I
$(srcdir) -I..
/bfd
-I
$(srcdir)/config
-I
$(srcdir)/..
/include -I
$(srcdir)/..
279 SUBDIR_INCLUDES
= -I..
-I
$(srcdir) -I
$(srcdir)/config
281 # Always use -I$(srcdir)/config when compiling.
283 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $<
285 # This tells GNU make version 3 not to export all the variables
286 # defined in this file into the environment.
289 # Files to be copied away after each stage in building.
290 STAGESTUFF
= *.o
as.new gasp.new
292 $(OBJS
): @ALL_OBJ_DEPS@
294 as.new
: $(OBJS
) $(LIBS
)
295 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
as.new
$(OBJS
) $(LIBS
) $(LOADLIBES
)
300 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o gasp.new gasp.o
$(LIBS
) $(LOADLIBES
)
303 @echo No
installcheck target is available yet for the GNU assembler.
306 @
(here
=`pwd` ; export here
; \
307 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $(CHECKFLAGS
) check)
309 config.status
: configure
310 if
[ -r config.status
]; then \
311 sh .
/config.status
--recheck
; \
313 echo You must configure gas. Look at the INSTALL file for details.
; \
317 config.h
: config-stamp
; @true
318 config-stamp
: Makefile conf
319 -rm -f config.new config-stamp
320 echo
'/* config.h. Generated automatically by make. */' > config.new
321 echo
'#ifndef GAS_VERSION' >> config.new
322 echo
'#define GAS_VERSION "$(VERSION)"' >> config.new
323 echo
'' >> config.new
324 cat conf
>> config.new
325 echo
'#endif /* GAS_VERSION */' >> config.new
326 $(srcdir)/..
/move-if-change config.new config.h
329 # Compiling object files from source files.
331 gasp.o
: gasp.c config.h
332 app.o
: app.c
as.h targ-env.h obj-format.h \
333 targ-cpu.h struc-symbol.h \
334 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
335 as.o
: as.c
as.h targ-env.h obj-format.h output-file.h \
336 targ-cpu.h struc-symbol.h \
337 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h subsegs.h \
339 atof-generic.o
: atof-generic.c
as.h targ-env.h obj-format.h \
340 targ-cpu.h struc-symbol.h \
341 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
342 bignum-copy.o
: bignum-copy.c
as.h \
343 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 cond.o
: cond.c
as.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
350 debug.o
: debug.c
as.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 \
354 expr.o
: expr.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 flonum-konst.o
: flonum-konst.c flonum.h bignum.h
359 flonum-copy.o
: flonum-copy.c
as.h targ-env.h obj-format.h \
360 targ-cpu.h struc-symbol.h \
361 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
362 flonum-mult.o
: flonum-mult.c flonum.h bignum.h
363 frags.o
: frags.c
as.h targ-env.h obj-format.h \
364 targ-cpu.h struc-symbol.h \
365 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
367 hash.o
: hash.c
as.h targ-env.h obj-format.h \
368 targ-cpu.h struc-symbol.h \
369 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
370 hex-value.o
: hex-value.c
371 input-file.o
: input-file.c
as.h \
372 targ-env.h obj-format.h targ-cpu.h \
373 struc-symbol.h write.h flonum.h bignum.h expr.h \
374 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
375 input-scrub.o
: input-scrub.c
/usr
/include/errno.h
/usr
/include/sys
/errno.h \
376 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 symbols.h tc.h obj.h \
380 listing.o
: listing.c
as.h targ-env.h flonum.h bignum.h \
381 listing.h obj-format.h targ-cpu.h struc-symbol.h write.h expr.h \
382 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h subsegs.h
383 literal.o
: literal.c subsegs.h
as.h targ-env.h obj-format.h \
384 targ-cpu.h struc-symbol.h \
385 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
386 messages.o
: messages.c
as.h targ-env.h obj-format.h \
387 targ-cpu.h struc-symbol.h \
388 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
389 output-file.o
: output-file.c
as.h targ-env.h obj-format.h \
390 targ-cpu.h struc-symbol.h \
391 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
393 read.o
: read.c
as.h targ-env.h obj-format.h \
394 targ-cpu.h struc-symbol.h \
395 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
396 subsegs.o
: subsegs.c
as.h targ-env.h obj-format.h \
397 targ-cpu.h struc-symbol.h \
398 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
400 symbols.o
: symbols.c
as.h targ-env.h obj-format.h \
401 targ-cpu.h struc-symbol.h \
402 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
404 write.o
: write.c
as.h targ-env.h obj-format.h \
405 targ-cpu.h struc-symbol.h \
406 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
407 subsegs.h output-file.h
408 ecoff.o
: ecoff.c
as.h targ-env.h obj-format.h \
409 targ-cpu.h struc-symbol.h \
410 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
411 ecoff.h
$(srcdir)/..
/include/coff
/internal.h \
412 $(srcdir)/..
/include/coff
/sym.h
$(srcdir)/..
/include/coff
/ecoff.h \
413 $(srcdir)/..
/include/coff
/symconst.h
$(srcdir)/..
/include/aout
/stab_gnu.h
414 stabs.o
: stabs.c
as.h targ-env.h obj-format.h \
415 targ-cpu.h struc-symbol.h \
416 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
417 subsegs.h
$(srcdir)/..
/include/aout
/stab_gnu.h
418 xmalloc.o
: xmalloc.c
419 atof-targ.o
: atof-targ.c
as.h targ-env.h obj-format.h \
420 targ-cpu.h struc-symbol.h \
421 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
423 obj-format.o
: obj-format.c
as.h targ-env.h obj-format.h \
424 targ-cpu.h struc-symbol.h \
425 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
426 subsegs.h symbols.h tc.h obj.h
427 targ-cpu.o
: targ-cpu.c config.h targ-env.h obj-format.h \
428 targ-cpu.h struc-symbol.h \
429 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
430 symbols.h tc.h obj.h
$(TARG_CPU_DEPENDENTS
)
432 # Remake the info files.
434 doc
: $(srcdir)/as.
info
436 $(srcdir)/as.
info: $(srcdir)/doc
/as.texinfo
437 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) as.
info; mv
as.
info $srcdir)
439 diststuff
: $(DISTSTUFF
)
442 -rm -f
$(STAGESTUFF
) core stamp-mk.com
444 clean mostlyclean: clean-here
445 @cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
446 @if
[ -d testsuite
] ; then \
447 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $@
; \
450 # Like clean but also delete the links made to configure gas.
451 distclean: clean-here
452 @cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
453 @if
[ -d testsuite
] ; then \
454 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $@
; \
456 -rm -f config.status Makefile targ-env.h targ-cpu.h \
457 targ-cpu.c obj-format.h obj-format.c atof-targ.c TAGS \
458 config-stamp config.h conf config.log config.cache .gdbinit
459 realclean: clean distclean
462 # Entry points `install', `includes' and `uninstall'.
464 # Copy the files into directories where they will be run.
466 srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
467 $(INSTALL_XFORM
) as.new
$(bindir)/as; \
468 $(INSTALL_XFORM1
) $(srcdir)/doc
/as.1 $(man1dir)/as.1; \
469 n
=`echo as | sed '$(program_transform_name)'`; \
470 if
[ -d
$(tooldir
) ]; then \
471 if
[ -d
$(tooldir
)/bin
] ; then true
; else mkdir
$(tooldir
)/bin
; fi
; \
472 rm -f
$(tooldir
)/bin
/as; \
473 ln
$(bindir)/$$n $(tooldir
)/bin
/as >/dev
/null
2>/dev
/null \
474 ||
$(INSTALL_PROGRAM
) as.new
$(tooldir
)/bin
/as; \
476 srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
477 $(INSTALL_XFORM
) gasp.new
$(bindir)/gasp
; \
478 n
=`echo gasp | sed '$(program_transform_name)' `; \
479 if
[ -d
$(tooldir
) ]; then \
480 if
[ -d
$(tooldir
)/bin
] ; then true
; else mkdir
$(tooldir
)/bin
; fi
; \
481 rm -f
$(tooldir
)/bin
/gasp
; \
482 ln
$(bindir)/$$n $(tooldir
)/bin
/gasp
>/dev
/null
2>/dev
/null \
483 ||
$(INSTALL_PROGRAM
) gasp.new
$(tooldir
)/bin
/gasp
; \
486 # Cancel installation by deleting the installed files.
488 -n
=`t='$(program_transform_name)'; echo as | sed $$t`; \
489 rm -f
$(bindir)/$$n; \
490 rm -f
$(mandir)/$$n.1
491 -n
=`t='$(program_transform_name)'; echo gasp | sed $$t`; \
492 rm -f
$(bindir)/$$n; \
494 # These exist for maintenance purposes.
497 etags
$(REAL_HEADERS
) $(REAL_SOURCES
) $(srcdir)/config
/*.
[hc
] $(srcdir)/README
$(srcdir)/Makefile.in
499 bootstrap
: as.new
force
501 rm -f stage
&& ln
-s stage1 stage
502 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
504 rm -f stage
&& ln
-s stage2 stage
505 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
506 $(MAKE
) comparison against
=stage2
509 rm -f stage
&& ln
-s stage1 stage
510 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
512 rm -f stage
&& ln
-s stage2 stage
513 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
514 $(MAKE
) comparison against
=stage2
517 rm -f stage
&& ln
-s stage2 stage
518 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
519 $(MAKE
) comparison against
=stage2
521 # Copy the object files from a particular stage into a subdirectory.
524 -mv
$(STAGESTUFF
) stage1
525 if
[ -f stage1
/as.new
-a
! -f stage1
/as ] ; then
(cd stage1
; ln
-s
as.new
as) ; fi
529 -mv
$(STAGESTUFF
) stage2
530 if
[ -f stage2
/as.new
-a
! -f stage2
/as ] ; then
(cd stage2
; ln
-s
as.new
as) ; fi
534 -mv
$(STAGESTUFF
) stage3
535 if
[ -f stage3
/as.new
-a
! -f stage3
/as ] ; then
(cd stage3
; ln
-s
as.new
as) ; fi
539 # This rule is derived from corresponding code in the Makefile.in for gcc.
540 # The "tail +16c" is to bypass headers which may include timestamps or
541 # temporary assembly file names.
544 for file in
$(STAGESTUFF
) ; do \
545 tail
+16c .
/$$file > tmp-foo1
; \
546 if tail
+16c
${against}/$$file > tmp-foo2
2>/dev
/null
; then \
547 if cmp tmp-foo1 tmp-foo2
; then \
550 echo
$$file differs
; \
559 - (cd stage1
; rm -f
as ; mv
-f
* ..
)
563 - (cd stage2
; rm -f
as ; mv
-f
* ..
)
567 - (cd stage3
; rm -f
as ; mv
-f
* ..
)
570 #In GNU Make, ignore whether `stage*' exists.
571 .PHONY
: stage1 stage2 stage3 stage4
clean mostlyclean realclean distclean
572 .PHONY
: TAGS bootstrap
576 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
) \
577 $(srcdir)/configure.in config.status
578 $(SHELL
) .
/config.status
579 .gdbinit
: $(srcdir)/gdbinit.in config.status
580 $(SHELL
) .
/config.status