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
77 AS_FOR_TARGET
= $${here}/as.new
80 if [ -f $${here}/../gcc/Makefile ] ; then \
81 echo $${here}/../gcc/xgcc -B$${here}/../gcc/; \
83 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
86 echo gcc | sed '$(program_transform_name)'; \
92 if [ -f $${here}/../binutils/Makefile ] ; then \
93 echo $${here}/../binutils/nm ; \
95 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
98 echo nm | sed '$(program_transform_name)' ; \
103 OBJDUMP_FOR_TARGET
= ` \
104 if [ -f $${here}/../binutils/Makefile ] ; then \
105 echo $${here}/../binutils/objdump ; \
107 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
110 echo objdump | sed '$(program_transform_name)' ; \
116 "exec_prefix=$(exec_prefix)" \
117 "tooldir=$(tooldir)" \
119 "AR_FLAGS=$(AR_FLAGS)" \
123 "LOADLIBES=$(LOADLIBES)" \
124 "LDFLAGS=$(LDFLAGS)" \
127 "MAKEINFO=$(MAKEINFO)" \
128 "INSTALL=$(INSTALL)" \
129 "INSTALL_DATA=$(INSTALL_DATA)" \
130 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
134 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
135 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
136 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
137 "OBJDUMP_FOR_TARGET=$(OBJDUMP_FOR_TARGET)" \
138 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
141 # Lists of files for various purposes.
146 $(srcdir)/atof-generic.c \
147 $(srcdir)/bignum-copy.c \
150 $(srcdir)/flonum-konst.c \
151 $(srcdir)/flonum-copy.c \
152 $(srcdir)/flonum-mult.c \
155 $(srcdir)/hex-value.c \
156 $(srcdir)/input-file.c \
157 $(srcdir)/input-scrub.c \
158 $(srcdir)/literal.c \
159 $(srcdir)/messages.c \
160 $(srcdir)/output-file.c \
162 $(srcdir)/subsegs.c \
163 $(srcdir)/symbols.c \
165 $(srcdir)/listing.c \
170 # in an expedient order
176 SOURCES
= $(LINKED_SOURCES
) $(REAL_SOURCES
)
185 $(srcdir)/input-file.h \
186 $(srcdir)/listing.h \
190 $(srcdir)/struc-symbol.h \
191 $(srcdir)/subsegs.h \
192 $(srcdir)/symbols.h \
202 HEADERS
= $(LINKED_HEADERS
) $(REAL_HEADERS
)
237 # These are objects we know we'll be pulling in from other directories.
238 # For VMS, we have to build them explicitly.
240 ..
/libiberty
/obstack.o \
241 ..
/libiberty
/strdup.o \
242 ..
/libiberty
/strncasecmp.o \
243 ..
/libiberty
/getruntime.o
246 @srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
247 (cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) all)
249 dvi info install-info clean-info
:
250 @srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
251 (cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
)
253 make-gas.com
: stamp-mk.com
254 stamp-mk.com
: vmsconf.sh Makefile
255 sh
$(srcdir)/vmsconf.sh
$(OBJS
) $(VMS_OTHER_OBJS
) > new-make.com
256 $(srcdir)/..
/move-if-change new-make.com
$(srcdir)/make-gas.com
259 # Now figure out from those variables how to compile and link.
261 # This is the variable actually used when we compile.
262 ALL_CFLAGS
= $(INTERNAL_CFLAGS
) $(CROSS
) $(CFLAGS
) $(HDEFINES
) $(TDEFINES
)
264 # How to link with both our special library facilities
265 # and the system's installed libraries.
267 LIBS
= @OPCODES_LIB@ @BFDLIB@
$(LOCAL_LOADLIBES
) ..
/libiberty
/libiberty.a
269 # Specify the directories to be searched for header files.
270 # Both . and srcdir are used, in that order,
271 # so that tm.h and config.h will be found in the compilation
272 # subdirectory rather than in the source directory.
273 INCLUDES
= -I.
-I
$(srcdir) -I..
/bfd
-I
$(srcdir)/config
-I
$(srcdir)/..
/include -I
$(srcdir)/..
274 SUBDIR_INCLUDES
= -I..
-I
$(srcdir) -I
$(srcdir)/config
276 # Always use -I$(srcdir)/config when compiling.
278 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $<
280 # This tells GNU make version 3 not to export all the variables
281 # defined in this file into the environment.
284 # Files to be copied away after each stage in building.
285 STAGESTUFF
= *.o
as.new gasp.new
287 $(OBJS
): @ALL_OBJ_DEPS@
289 as.new
: $(OBJS
) $(LIBS
)
290 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
as.new
$(OBJS
) $(LIBS
) $(LOADLIBES
)
295 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o gasp.new gasp.o
$(LIBS
) $(LOADLIBES
)
298 @echo No
installcheck target is available yet for the GNU assembler.
301 @
(here
=`pwd` ; export here
; \
302 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $(CHECKFLAGS
) check)
304 config.status
: configure
305 if
[ -r config.status
]; then \
306 sh .
/config.status
--recheck
; \
308 echo You must configure gas. Look at the INSTALL file for details.
; \
312 config.h
: config-stamp
; @true
313 config-stamp
: Makefile conf
314 -rm -f config.new config-stamp
315 echo
'/* config.h. Generated automatically by make. */' > config.new
316 echo
'#ifndef GAS_VERSION' >> config.new
317 echo
'#define GAS_VERSION "$(VERSION)"' >> config.new
318 echo
'' >> config.new
319 cat conf
>> config.new
320 echo
'#endif /* GAS_VERSION */' >> config.new
321 $(srcdir)/..
/move-if-change config.new config.h
324 # Compiling object files from source files.
327 app.o
: app.c
as.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 as.o
: as.c
as.h targ-env.h obj-format.h output-file.h \
331 targ-cpu.h struc-symbol.h \
332 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h subsegs.h \
334 atof-generic.o
: atof-generic.c
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
337 bignum-copy.o
: bignum-copy.c
as.h \
338 targ-env.h obj-format.h \
339 targ-cpu.h struc-symbol.h \
340 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
341 cond.o
: cond.c
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
345 debug.o
: debug.c
as.h targ-env.h obj-format.h \
346 targ-cpu.h struc-symbol.h \
347 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
349 expr.o
: expr.c
as.h targ-env.h obj-format.h \
350 targ-cpu.h struc-symbol.h \
351 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
353 flonum-konst.o
: flonum-konst.c flonum.h bignum.h
354 flonum-copy.o
: flonum-copy.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
357 flonum-mult.o
: flonum-mult.c flonum.h bignum.h
358 frags.o
: frags.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 hash.o
: hash.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 hex-value.o
: hex-value.c
366 input-file.o
: input-file.c
as.h \
367 targ-env.h obj-format.h targ-cpu.h \
368 struc-symbol.h write.h flonum.h bignum.h expr.h \
369 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
370 input-scrub.o
: input-scrub.c
/usr
/include/errno.h
/usr
/include/sys
/errno.h \
371 as.h targ-env.h obj-format.h \
372 targ-cpu.h struc-symbol.h \
373 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
375 listing.o
: listing.c
as.h targ-env.h flonum.h bignum.h \
376 listing.h obj-format.h targ-cpu.h struc-symbol.h write.h expr.h \
377 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h subsegs.h
378 literal.o
: literal.c subsegs.h
as.h targ-env.h obj-format.h \
379 targ-cpu.h struc-symbol.h \
380 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
381 messages.o
: messages.c
as.h targ-env.h obj-format.h \
382 targ-cpu.h struc-symbol.h \
383 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
384 output-file.o
: output-file.c
as.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 symbols.h tc.h obj.h \
388 read.o
: read.c
as.h targ-env.h obj-format.h \
389 targ-cpu.h struc-symbol.h \
390 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
391 subsegs.o
: subsegs.c
as.h targ-env.h obj-format.h \
392 targ-cpu.h struc-symbol.h \
393 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
395 symbols.o
: symbols.c
as.h targ-env.h obj-format.h \
396 targ-cpu.h struc-symbol.h \
397 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
399 write.o
: write.c
as.h targ-env.h obj-format.h \
400 targ-cpu.h struc-symbol.h \
401 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
402 subsegs.h output-file.h
403 ecoff.o
: ecoff.c
as.h targ-env.h obj-format.h \
404 targ-cpu.h struc-symbol.h \
405 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
406 ecoff.h
$(srcdir)/..
/include/coff
/internal.h \
407 $(srcdir)/..
/include/coff
/sym.h
$(srcdir)/..
/include/coff
/ecoff.h \
408 $(srcdir)/..
/include/coff
/symconst.h
$(srcdir)/..
/include/aout
/stab_gnu.h
409 stabs.o
: stabs.c
as.h targ-env.h obj-format.h \
410 targ-cpu.h struc-symbol.h \
411 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
412 subsegs.h
$(srcdir)/..
/include/aout
/stab_gnu.h
413 xmalloc.o
: xmalloc.c
414 atof-targ.o
: atof-targ.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 \
418 obj-format.o
: obj-format.c
as.h targ-env.h obj-format.h \
419 targ-cpu.h struc-symbol.h \
420 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
421 subsegs.h symbols.h tc.h obj.h
422 targ-cpu.o
: targ-cpu.c config.h targ-env.h obj-format.h \
423 targ-cpu.h struc-symbol.h \
424 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
425 symbols.h tc.h obj.h
$(TARG_CPU_DEPENDENTS
)
427 # Remake the info files.
429 doc
: $(srcdir)/as.
info
431 $(srcdir)/as.
info: $(srcdir)/doc
/as.texinfo
432 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) as.
info; mv
as.
info $srcdir)
435 -rm -f
$(STAGESTUFF
) core
437 clean mostlyclean: clean-here
438 @cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
439 @if
[ -d testsuite
] ; then \
440 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $@
; \
443 # Like clean but also delete the links made to configure gas.
444 distclean realclean: clean-here
445 @cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
446 @if
[ -d testsuite
] ; then \
447 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $@
; \
449 -rm -f config.status Makefile targ-env.h targ-cpu.h \
450 targ-cpu.c obj-format.h obj-format.c atof-targ.c TAGS \
451 config-stamp config.h conf config.log config.cache
453 # Entry points `install', `includes' and `uninstall'.
455 # Copy the files into directories where they will be run.
457 srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
458 $(INSTALL_XFORM
) as.new
$(bindir)/as; \
459 $(INSTALL_XFORM1
) $(srcdir)/doc
/as.1 $(man1dir)/as.1; \
460 n
=`echo as | sed '$(program_transform_name)'`; \
461 if
[ -d
$(tooldir
) ]; then \
462 if
[ -d
$(tooldir
)/bin
] ; then true
; else mkdir
$(tooldir
)/bin
; fi
; \
463 rm -f
$(tooldir
)/bin
/as; \
464 ln
$(bindir)/$$n $(tooldir
)/bin
/as >/dev
/null
2>/dev
/null \
465 ||
$(INSTALL_PROGRAM
) as.new
$(tooldir
)/bin
/as; \
467 srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
468 $(INSTALL_XFORM
) gasp.new
$(bindir)/gasp
; \
469 n
=`echo gasp | 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
/gasp
; \
473 ln
$(bindir)/$$n $(tooldir
)/bin
/gasp
>/dev
/null
2>/dev
/null \
474 ||
$(INSTALL_PROGRAM
) gasp.new
$(tooldir
)/bin
/gasp
; \
477 # Cancel installation by deleting the installed files.
479 -n
=`t='$(program_transform_name)'; echo as | sed $$t`; \
480 rm -f
$(bindir)/$$n; \
481 rm -f
$(mandir)/$$n.1
482 -n
=`t='$(program_transform_name)'; echo gasp | sed $$t`; \
483 rm -f
$(bindir)/$$n; \
485 # These exist for maintenance purposes.
488 etags
$(REAL_HEADERS
) $(REAL_SOURCES
) $(srcdir)/config
/*.
[hc
] $(srcdir)/README
$(srcdir)/Makefile.in
490 bootstrap
: as.new
force
492 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
494 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
495 $(MAKE
) comparison against
=stage2
498 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
500 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
501 $(MAKE
) comparison against
=stage2
504 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
505 $(MAKE
) comparison against
=stage2
507 # Copy the object files from a particular stage into a subdirectory.
510 -mv
$(STAGESTUFF
) stage1
511 if
[ -f stage1
/as.new
-a
! -f stage1
/as ] ; then
(cd stage1
; ln
-s
as.new
as) ; fi
515 -mv
$(STAGESTUFF
) stage2
516 if
[ -f stage2
/as.new
-a
! -f stage2
/as ] ; then
(cd stage2
; ln
-s
as.new
as) ; fi
520 -mv
$(STAGESTUFF
) stage3
521 if
[ -f stage3
/as.new
-a
! -f stage3
/as ] ; then
(cd stage3
; ln
-s
as.new
as) ; fi
526 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
529 - (cd stage1
; rm -f
as ; mv
-f
* ..
)
533 - (cd stage2
; rm -f
as ; mv
-f
* ..
)
537 - (cd stage3
; rm -f
as ; mv
-f
* ..
)
540 #In GNU Make, ignore whether `stage*' exists.
541 .PHONY
: stage1 stage2 stage3 stage4
clean mostlyclean realclean distclean
542 .PHONY
: TAGS bootstrap
546 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
) \
547 $(srcdir)/configure.in config.status
548 $(SHELL
) .
/config.status