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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 # The targets for external use include:
21 # all, doc, proto, install, uninstall, includes, TAGS,
22 # clean, mostlyclean, distclean, realclean, stage1, stage2, stage3, stage4.
24 # Variables that exist for you to override.
25 # See below for how to change them for certain systems.
29 srcroot
= $(srcdir)/..
31 target_alias
= @target_alias@
34 program_transform_name
= @program_transform_name@
35 exec_prefix = @
exec_prefix@
36 bindir = $(exec_prefix)/bin
37 libdir = $(exec_prefix)/lib
38 tooldir
= $(exec_prefix)/$(target_alias
)
40 datadir = $(prefix)/lib
41 mandir = $(prefix)/man
42 man1dir = $(mandir)/man1
43 man2dir = $(mandir)/man2
44 man3dir = $(mandir)/man3
45 man4dir = $(mandir)/man4
46 man5dir = $(mandir)/man5
47 man6dir = $(mandir)/man6
48 man7dir = $(mandir)/man7
49 man8dir = $(mandir)/man8
50 man9dir = $(mandir)/man9
51 infodir = $(prefix)/info
52 includedir = $(prefix)/include
53 docdir
= $(datadir)/doc
59 INSTALL
= $${srcroot}/install.sh
-c
60 INSTALL_PROGRAM
= $(INSTALL
)
61 INSTALL_DATA
= $(INSTALL
)
62 INSTALL_XFORM
= $(INSTALL
) -t
='-e $(program_transform_name)'
63 INSTALL_XFORM1
= $(INSTALL_XFORM
) -b
=.1
65 DISTSTUFF
= make-gas.com m68k-parse.c
69 BISON
= `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
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)"
97 RUNTEST
= `if [ -f ${srcdir}/../dejagnu/runtest ] ; then \
98 echo ${srcdir}/../dejagnu/runtest ; else echo runtest; \
102 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
105 # Lists of files for various purposes.
110 $(srcdir)/atof-generic.c \
111 $(srcdir)/bignum-copy.c \
114 $(srcdir)/flonum-konst.c \
115 $(srcdir)/flonum-copy.c \
116 $(srcdir)/flonum-mult.c \
119 $(srcdir)/input-file.c \
120 $(srcdir)/input-scrub.c \
121 $(srcdir)/literal.c \
122 $(srcdir)/messages.c \
123 $(srcdir)/output-file.c \
125 $(srcdir)/subsegs.c \
126 $(srcdir)/symbols.c \
128 $(srcdir)/listing.c \
132 # in an expedient order
138 SOURCES
= $(LINKED_SOURCES
) $(REAL_SOURCES
)
147 $(srcdir)/input-file.h \
148 $(srcdir)/listing.h \
152 $(srcdir)/struc-symbol.h \
153 $(srcdir)/subsegs.h \
154 $(srcdir)/symbols.h \
164 HEADERS
= $(LINKED_HEADERS
) $(REAL_HEADERS
)
208 all: .gdbinit
as.new gasp.new
209 @srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
210 (cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) all)
212 dvi info install-info clean-info
:
213 @srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
214 (cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
)
216 make-gas.com
: stamp-mk.com
217 stamp-mk.com
: vmsconf.sh Makefile
218 sh
$(srcdir)/vmsconf.sh
$(OBJS
) > new-make.com
219 $(srcdir)/..
/move-if-change new-make.com
$(srcdir)/make-gas.com
222 # Now figure out from those variables how to compile and link.
224 # This is the variable actually used when we compile.
225 ALL_CFLAGS
= $(INTERNAL_CFLAGS
) $(CROSS
) $(CFLAGS
) $(HDEFINES
) $(TDEFINES
)
227 # How to link with both our special library facilities
228 # and the system's installed libraries.
230 LIBS
= @OPCODES_LIB@ @BFDLIB@
$(LOCAL_LOADLIBES
) ..
/libiberty
/libiberty.a
232 # Specify the directories to be searched for header files.
233 # Both . and srcdir are used, in that order,
234 # so that tm.h and config.h will be found in the compilation
235 # subdirectory rather than in the source directory.
236 INCLUDES
= -I.
-I
$(srcdir) -I..
/bfd
-I
$(srcdir)/config
-I
$(srcdir)/..
/include -I
$(srcdir)/..
-I
$(srcdir)/..
/bfd
238 # Always use -I$(srcdir)/config when compiling.
240 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $<
242 # This tells GNU make version 3 not to export all the variables
243 # defined in this file into the environment.
246 # Files to be copied away after each stage in building.
247 STAGESTUFF
= *.o
as.new gasp.new
249 $(OBJS
): @ALL_OBJ_DEPS@
251 as.new
: $(OBJS
) $(LIBS
)
252 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
as.new
$(OBJS
) $(LIBS
) $(LOADLIBES
)
254 $(OBJS
): config.h
as.h targ-env.h obj-format.h targ-cpu.h flonum.h expr.h \
255 struc-symbol.h write.h frags.h hash.h read.h symbols.h tc.h obj.h \
258 gasp.new
: $(GASPOBJS
)
259 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o gasp.new
$(GASPOBJS
) $(LIBS
) $(LOADLIBES
)
262 @echo No
installcheck target is available yet for the GNU assembler.
265 @
(here
=`pwd` ; export here
; \
266 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $(CHECKFLAGS
) check)
268 config.status
: configure
269 if
[ -r config.status
]; then \
270 sh .
/config.status
--recheck
; \
272 echo You must configure gas. Look at the INSTALL file for details.
; \
276 config.h
: config-stamp
; @true
277 config-stamp
: Makefile conf
278 -rm -f config.new config-stamp
279 echo
'/* config.h. Generated automatically by make. */' > config.new
280 echo
'#ifndef GAS_VERSION' >> config.new
281 echo
'#define GAS_VERSION "$(VERSION)"' >> config.new
282 echo
'' >> config.new
283 cat conf
>> config.new
284 echo
'#endif /* GAS_VERSION */' >> config.new
285 $(srcdir)/..
/move-if-change config.new config.h
288 # Compiling object files from source files.
293 TARG_CPU_DEP_arc
= $(srcdir)/..
/include/opcode
/arc.h
296 TARG_CPU_DEP_generic
=
297 TARG_CPU_DEP_h8300
= $(srcdir)/..
/include/opcode
/h8300.h
298 TARG_CPU_DEP_h8500
= $(srcdir)/..
/opcodes
/h8500-opc.h
300 TARG_CPU_DEP_i386
= $(srcdir)/..
/include/opcode
/i386.h
303 TARG_CPU_DEP_m68k
= $(srcdir)/..
/include/opcode
/m68k.h \
304 $(srcdir)/config
/m68k-parse.h subsegs.h
305 TARG_CPU_DEP_m88k
= $(srcdir)/config
/m88k-opcode.h
306 TARG_CPU_DEP_mips
= $(srcdir)/..
/include/opcode
/mips.h
310 TARG_CPU_DEP_rce
= $(srcdir)/..
/opcodes
/rce-opc.h
312 TARG_CPU_DEP_sh
= $(srcdir)/..
/opcodes
/sh-opc.h
316 TARG_CPU_DEP_w65
= $(srcdir)/..
/opcodes
/w65-opc.h
317 TARG_CPU_DEP_z8k
= $(srcdir)/..
/opcodes
/z8k-opc.h
319 gasp.o
: gasp.c sb.h macro.h config.h
320 sb.o
: sb.c sb.h config.h
321 macro.o
: macro.c macro.h sb.h hash.h config.h
322 app.o
: app.c write.h
323 as.o
: as.c output-file.h write.h subsegs.h sb.h macro.h
324 atof-generic.o
: atof-generic.c
325 bignum-copy.o
: bignum-copy.c
327 debug.o
: debug.c subsegs.h
329 flonum-konst.o
: flonum-konst.c
330 flonum-copy.o
: flonum-copy.c
331 flonum-mult.o
: flonum-mult.c
332 frags.o
: frags.c subsegs.h
334 input-file.o
: input-file.c input-file.h
335 input-scrub.o
: input-scrub.c input-file.h sb.h
336 listing.o
: listing.c input-file.h subsegs.h
337 literal.o
: literal.c subsegs.h
338 messages.o
: messages.c
339 output-file.o
: output-file.c output-file.h
340 read.o
: read.c sb.h macro.h
341 subsegs.o
: subsegs.c subsegs.h
342 symbols.o
: symbols.c subsegs.h
343 write.o
: write.c subsegs.h output-file.h
344 ecoff.o
: ecoff.c ecoff.h \
345 $(srcdir)/..
/include/coff
/internal.h
$(srcdir)/..
/include/coff
/sym.h \
346 $(srcdir)/..
/include/coff
/ecoff.h \
347 $(srcdir)/..
/include/coff
/symconst.h \
348 $(srcdir)/..
/include/aout
/stab_gnu.h
349 stabs.o
: stabs.c subsegs.h
$(srcdir)/..
/include/aout
/stab_gnu.h
350 atof-targ.o
: atof-targ.c
351 obj-format.o
: obj-format.c
352 targ-cpu.o
: targ-cpu.c
$(TARG_CPU_DEP_@target_cpu_type@
)
354 obj-elf.o
: $(srcdir)/config
/obj-elf.c
355 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $(srcdir)/config
/obj-elf.c
356 obj-ecoff.o
: $(srcdir)/config
/obj-ecoff.c
357 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $(srcdir)/config
/obj-ecoff.c
359 e-mipself.o
: $(srcdir)/config
/e-mipself.c
360 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $(srcdir)/config
/e-mipself.c
361 e-mipsecoff.o
: $(srcdir)/config
/e-mipsecoff.c
362 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $(srcdir)/config
/e-mipsecoff.c
364 # The m68k operand parser.
366 m68k-parse.c
: $(srcdir)/config
/m68k-parse.y
367 $(BISON
) $(BISONFLAGS
) $(srcdir)/config
/m68k-parse.y
368 mv
-f y.tab.c m68k-parse.c
369 m68k-parse.o
: m68k-parse.c
$(srcdir)/config
/m68k-parse.h
371 # Remake the info files.
373 doc
: $(srcdir)/as.
info
375 $(srcdir)/as.
info: $(srcdir)/doc
/as.texinfo
376 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) as.
info; mv
as.
info $srcdir)
378 diststuff
: $(DISTSTUFF
)
381 -rm -f
$(STAGESTUFF
) core stamp-mk.com
383 clean mostlyclean: clean-here
384 @cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
385 @if
[ -d testsuite
] ; then \
386 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $@
; \
389 # Like clean but also delete the links made to configure gas.
390 distclean: clean-here
391 @cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
392 @if
[ -d testsuite
] ; then \
393 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $@
; \
395 -rm -f config.status Makefile targ-env.h targ-cpu.h \
396 targ-cpu.c obj-format.h obj-format.c atof-targ.c TAGS \
397 config-stamp config.h conf config.log config.cache .gdbinit
398 realclean: clean distclean
401 # Entry points `install', `includes' and `uninstall'.
403 # Copy the files into directories where they will be run.
405 srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
406 $(INSTALL_XFORM
) as.new
$(bindir)/as; \
407 $(INSTALL_XFORM1
) $(srcdir)/doc
/as.1 $(man1dir)/as.1; \
408 n
=`echo as | sed '$(program_transform_name)'`; \
409 if
[ -d
$(tooldir
) ]; then \
410 if
[ -d
$(tooldir
)/bin
] ; then true
; else mkdir
$(tooldir
)/bin
; fi
; \
411 rm -f
$(tooldir
)/bin
/as; \
412 ln
$(bindir)/$$n $(tooldir
)/bin
/as >/dev
/null
2>/dev
/null \
413 ||
$(INSTALL_PROGRAM
) as.new
$(tooldir
)/bin
/as; \
415 srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
416 $(INSTALL_XFORM
) gasp.new
$(bindir)/gasp
; \
417 n
=`echo gasp | sed '$(program_transform_name)' `; \
418 if
[ -d
$(tooldir
) ]; then \
419 if
[ -d
$(tooldir
)/bin
] ; then true
; else mkdir
$(tooldir
)/bin
; fi
; \
420 rm -f
$(tooldir
)/bin
/gasp
; \
421 ln
$(bindir)/$$n $(tooldir
)/bin
/gasp
>/dev
/null
2>/dev
/null \
422 ||
$(INSTALL_PROGRAM
) gasp.new
$(tooldir
)/bin
/gasp
; \
425 # Cancel installation by deleting the installed files.
427 -n
=`t='$(program_transform_name)'; echo as | sed $$t`; \
428 rm -f
$(bindir)/$$n; \
429 rm -f
$(mandir)/$$n.1
430 -n
=`t='$(program_transform_name)'; echo gasp | sed $$t`; \
431 rm -f
$(bindir)/$$n; \
433 # These exist for maintenance purposes.
436 etags
$(REAL_HEADERS
) $(REAL_SOURCES
) $(srcdir)/config
/*.
[hc
] $(srcdir)/README
$(srcdir)/Makefile.in
438 bootstrap
: as.new
force
440 rm -f stage
&& ln
-s stage1 stage
441 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
443 rm -f stage
&& ln
-s stage2 stage
444 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
445 $(MAKE
) comparison against
=stage2
448 rm -f stage
&& ln
-s stage1 stage
449 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
451 rm -f stage
&& ln
-s stage2 stage
452 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
453 $(MAKE
) comparison against
=stage2
456 rm -f stage
&& ln
-s stage2 stage
457 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.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
478 # This rule is derived from corresponding code in the Makefile.in for gcc.
479 # The "tail +16c" is to bypass headers which may include timestamps or
480 # temporary assembly file names.
483 for file in
$(STAGESTUFF
) ; do \
484 tail
+16c .
/$$file > tmp-foo1
; \
485 if tail
+16c
${against}/$$file > tmp-foo2
2>/dev
/null
; then \
486 if cmp tmp-foo1 tmp-foo2
; then \
489 echo
$$file differs
; \
498 - (cd stage1
; rm -f
as ; mv
-f
* ..
)
502 - (cd stage2
; rm -f
as ; mv
-f
* ..
)
506 - (cd stage3
; rm -f
as ; mv
-f
* ..
)
509 #In GNU Make, ignore whether `stage*' exists.
510 .PHONY
: stage1 stage2 stage3 stage4
clean mostlyclean realclean distclean
511 .PHONY
: TAGS bootstrap
515 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
) \
516 $(srcdir)/configure.in config.status conf.in
517 $(SHELL
) .
/config.status
518 .gdbinit
: $(srcdir)/gdbinit.in config.status
519 $(SHELL
) .
/config.status