1 # Makefile for GNU Assembler
2 # Copyright (C) 1987-1992, 1993 Free Software Foundation, Inc.
4 # This file is part of GNU GAS.
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)
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.
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.
20 # The targets for external use include:
21 # all, doc, proto, install, uninstall, includes, TAGS,
22 # clean, cleanconfig, realclean, stage1, stage2, stage3, stage4.
24 # Variables that exist for you to override.
25 # See below for how to change them for certain systems.
28 srcroot
= $(srcdir)/..
32 program_transform_name
=
33 exec_prefix = $(prefix)
34 bindir = $(exec_prefix)/bin
35 libdir = $(exec_prefix)/lib
36 tooldir
= $(libdir)/$(target_alias
)
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
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
73 AS_FOR_TARGET
= $${here}/as.new
76 if [ -f $${here}/../gcc/Makefile ] ; then \
77 echo $${here}/../gcc/xgcc -B$${here}/../gcc/; \
79 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
82 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
87 if [ -f $${here}/../binutils/Makefile ] ; then \
88 echo $${here}/../binutils/nm ; \
90 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
93 t='$(program_transform_name)'; echo nm | sed -e '' $$t ; \
98 OBJDUMP_FOR_TARGET
= ` \
99 if [ -f $${here}/../binutils/Makefile ] ; then \
100 echo $${here}/../binutils/objdump ; \
102 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
105 t='$(program_transform_name)'; echo objdump | sed -e '' $$t ; \
111 "exec_prefix=$(exec_prefix)" \
112 "tooldir=$(tooldir)" \
114 "AR_FLAGS=$(AR_FLAGS)" \
118 "LOADLIBES=$(LOADLIBES)" \
119 "LDFLAGS=$(LDFLAGS)" \
122 "MAKEINFO=$(MAKEINFO)" \
123 "INSTALL=$(INSTALL)" \
124 "INSTALL_DATA=$(INSTALL_DATA)" \
125 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
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)"
134 # Lists of files for various purposes.
139 $(srcdir)/atof-generic.c \
140 $(srcdir)/bignum-copy.c \
143 $(srcdir)/flonum-konst.c \
144 $(srcdir)/flonum-copy.c \
145 $(srcdir)/flonum-mult.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 \
154 $(srcdir)/subsegs.c \
155 $(srcdir)/symbols.c \
157 $(srcdir)/listing.c \
162 # in an expedient order
168 SOURCES
= $(LINKED_SOURCES
) $(REAL_SOURCES
)
177 $(srcdir)/input-file.h \
178 $(srcdir)/listing.h \
182 $(srcdir)/struc-symbol.h \
183 $(srcdir)/subsegs.h \
184 $(srcdir)/symbols.h \
197 HEADERS
= $(LINKED_HEADERS
) $(REAL_HEADERS
)
228 #### host, target, and site specific Makefile frags come in here.
231 @srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
232 (cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) all)
234 dvi info install-info clean-info
:
235 @srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
236 (cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
)
238 # Now figure out from those variables how to compile and link.
240 # This is the variable actually used when we compile.
241 ALL_CFLAGS
= $(INTERNAL_CFLAGS
) $(CROSS
) $(CFLAGS
) $(HDEFINES
) $(TDEFINES
) \
244 # How to link with both our special library facilities
245 # and the system's installed libraries.
247 LIBS
= ..
/opcodes
/libopcodes.a
$(BFDLIB
) $(LOCAL_LOADLIBES
) \
248 ..
/libiberty
/libiberty.a
250 # Specify the directories to be searched for header files.
251 # Both . and srcdir are used, in that order,
252 # so that tm.h and config.h will be found in the compilation
253 # subdirectory rather than in the source directory.
254 INCLUDES
= -I.
-I
$(srcdir) -I..
/bfd
-I
$(srcdir)/config
-I
$(srcdir)/..
/include
255 SUBDIR_INCLUDES
= -I..
-I
$(srcdir) -I
$(srcdir)/config
257 # Always use -I$(srcdir)/config when compiling.
259 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $<
261 # This tells GNU make version 3 not to export all the variables
262 # defined in this file into the environment.
265 # Files to be copied away after each stage in building.
266 STAGESTUFF
= *.o
as.new
268 as.new
: $(OBJS
) $(LIBS
)
269 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
as.new
$(OBJS
) $(LIBS
) $(LOADLIBES
)
272 @echo No
installcheck target is available yet for the GNU assembler.
275 @
(here
=`pwd` ; export here
; \
276 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $(CHECKFLAGS
) check)
279 @echo You must configure gas. Look at the INSTALL file for details.
282 config.h
: config-stamp
; @true
283 config-stamp
: Makefile
284 -rm -f config.new config-stamp
285 echo
'#define TARGET_CPU "$(target_cpu)"' > config.new
286 echo
'#define TARGET_ALIAS "$(target_alias)"' >> config.new
287 echo
'#define TARGET_CANONICAL "$(target_canonical)"' >> config.new
288 echo
'#define GAS_VERSION "$(VERSION)"' >> config.new
289 $(srcdir)/..
/move-if-change config.new config.h
292 # Compiling object files from source files.
294 app.o
: app.c
as.h host.h targ-env.h obj-format.h \
295 targ-cpu.h struc-symbol.h \
296 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
297 as.o
: as.c
as.h host.h targ-env.h obj-format.h output-file.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 subsegs.h \
301 atof-generic.o
: atof-generic.c
as.h host.h 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 bignum-copy.o
: bignum-copy.c
as.h host.h \
305 targ-env.h obj-format.h \
306 targ-cpu.h struc-symbol.h \
307 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
308 cond.o
: cond.c
as.h host.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 debug.o
: debug.c
as.h host.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 expr.o
: expr.c
as.h host.h targ-env.h obj-format.h \
317 targ-cpu.h struc-symbol.h \
318 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
320 flonum-konst.o
: flonum-konst.c flonum.h bignum.h
321 flonum-copy.o
: flonum-copy.c
as.h host.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
324 flonum-mult.o
: flonum-mult.c flonum.h bignum.h
325 frags.o
: frags.c
as.h host.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 \
329 hash.o
: hash.c
as.h host.h targ-env.h obj-format.h \
330 targ-cpu.h struc-symbol.h \
331 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
332 hex-value.o
: hex-value.c
333 input-file.o
: input-file.c
as.h host.h \
334 targ-env.h obj-format.h targ-cpu.h \
335 struc-symbol.h write.h flonum.h bignum.h expr.h \
336 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
337 input-scrub.o
: input-scrub.c
/usr
/include/errno.h
/usr
/include/sys
/errno.h \
338 as.h host.h 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 \
342 listing.o
: listing.c
as.h host.h targ-env.h flonum.h bignum.h \
343 listing.h obj-format.h targ-cpu.h struc-symbol.h write.h expr.h \
344 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
345 messages.o
: messages.c
as.h host.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
348 output-file.o
: output-file.c
as.h host.h targ-env.h obj-format.h \
349 targ-cpu.h struc-symbol.h \
350 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
352 read.o
: read.c
as.h host.h targ-env.h obj-format.h \
353 targ-cpu.h struc-symbol.h \
354 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
355 subsegs.o
: subsegs.c
as.h host.h targ-env.h obj-format.h \
356 targ-cpu.h struc-symbol.h \
357 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
359 symbols.o
: symbols.c
as.h host.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 \
363 write.o
: write.c
as.h host.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 \
366 subsegs.h output-file.h
367 ecoff.o
: ecoff.c
as.h host.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 ecoff.h
$(srcdir)/..
/include/coff
/internal.h \
371 $(srcdir)/..
/include/coff
/sym.h
$(srcdir)/..
/include/coff
/ecoff.h \
372 $(srcdir)/..
/include/coff
/symconst.h
$(srcdir)/..
/include/aout
/stab_gnu.h
373 stabs.o
: stabs.c
as.h host.h targ-env.h obj-format.h \
374 targ-cpu.h struc-symbol.h \
375 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
376 subsegs.h
$(srcdir)/..
/include/aout
/stab_gnu.h
377 xmalloc.o
: xmalloc.c
378 atof-targ.o
: atof-targ.c
as.h host.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 \
382 obj-format.o
: obj-format.c
as.h host.h targ-env.h obj-format.h \
383 targ-cpu.h struc-symbol.h \
384 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
385 subsegs.h symbols.h tc.h obj.h
386 targ-cpu.o
: targ-cpu.c config.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 \
389 symbols.h tc.h obj.h
$(TARG_CPU_DEPENDENTS
)
391 # Remake the info files.
393 doc
: $(srcdir)/as.
info
395 $(srcdir)/as.
info: $(srcdir)/doc
/as.texinfo
396 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) as.
info; mv
as.
info $srcdir)
399 -rm -f
$(STAGESTUFF
) core
402 @cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) clean
403 @if
[ -d testsuite
] ; then \
404 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) clean ; \
407 # Like clean but also delete the links made to configure gas.
408 distclean: clean-here
409 @cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) distclean
410 @if
[ -d testsuite
] ; then \
411 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) distclean ; \
413 -rm -f config.status Makefile host.h 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
417 # Entry points `install', `includes' and `uninstall'.
419 # Copy the files into directories where they will be run.
421 srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
422 $(INSTALL_XFORM
) as.new
$(bindir)/as; \
423 $(INSTALL_XFORM1
) $(srcdir)/doc
/as.1 $(man1dir)/as.1; \
424 n
=`t='$(program_transform_name)'; echo as | sed -e "" $$t`; \
425 if
[ -d
$(tooldir
) ]; then \
426 if
[ -d
$(tooldir
)/bin
] ; then true
; else mkdir
$(tooldir
)/bin
; fi
; \
427 rm -f
$(tooldir
)/bin
/as; \
428 ln
$(bindir)/$$n $(tooldir
)/bin
/as \
429 ||
$(INSTALL_PROGRAM
) as.new
$(tooldir
)/bin
/as; \
432 # Cancel installation by deleting the installed files.
434 -n
=`t='$(program_transform_name)'; echo as | sed -e "" $$t`; \
435 rm -f
$(bindir)/$$n; \
436 rm -f
$(mandir)/$$n.1
438 # These exist for maintenance purposes.
441 etags
$(REAL_HEADERS
) $(REAL_SOURCES
) $(srcdir)/config
/*.
[hc
] $(srcdir)/README
$(srcdir)/Makefile.in
443 bootstrap
: as.new
force
445 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
447 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
448 $(MAKE
) comparison against
=stage2
451 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
453 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
454 $(MAKE
) comparison against
=stage2
457 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
458 $(MAKE
) comparison against
=stage2
460 # Copy the object files from a particular stage into a subdirectory.
463 -mv
$(STAGESTUFF
) stage1
464 if
[ -f stage1
/as.new
-a
! -f stage1
/as ] ; then
(cd stage1
; ln
-s
as.new
as) ; fi
468 -mv
$(STAGESTUFF
) stage2
469 if
[ -f stage2
/as.new
-a
! -f stage2
/as ] ; then
(cd stage2
; ln
-s
as.new
as) ; fi
473 -mv
$(STAGESTUFF
) stage3
474 if
[ -f stage3
/as.new
-a
! -f stage3
/as ] ; then
(cd stage3
; ln
-s
as.new
as) ; fi
479 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
482 - (cd stage1
; rm as ; mv
-f
* ..
)
486 - (cd stage2
; rm as ; mv
-f
* ..
)
490 - (cd stage3
; rm as ; mv
-f
* ..
)
493 #In GNU Make, ignore whether `stage*' exists.
494 .PHONY
: stage1 stage2 stage3 stage4
clean realclean TAGS bootstrap
498 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
) \
499 $(srcdir)/configure.in
500 $(SHELL
) .
/config.status