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
80 "exec_prefix=$(exec_prefix)" \
81 "tooldir=$(tooldir)" \
83 "AR_FLAGS=$(AR_FLAGS)" \
87 "LOADLIBES=$(LOADLIBES)" \
88 "LDFLAGS=$(LDFLAGS)" \
91 "MAKEINFO=$(MAKEINFO)" \
92 "INSTALL=$(INSTALL)" \
93 "INSTALL_DATA=$(INSTALL_DATA)" \
94 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
96 RUNTEST
= `if [ -f ${srcdir}/../dejagnu/runtest ] ; then \
97 echo ${srcdir}/../dejagnu/runtest ; else echo runtest; \
101 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
104 # Lists of files for various purposes.
109 $(srcdir)/atof-generic.c \
110 $(srcdir)/bignum-copy.c \
113 $(srcdir)/flonum-konst.c \
114 $(srcdir)/flonum-copy.c \
115 $(srcdir)/flonum-mult.c \
118 $(srcdir)/input-file.c \
119 $(srcdir)/input-scrub.c \
120 $(srcdir)/literal.c \
121 $(srcdir)/messages.c \
122 $(srcdir)/output-file.c \
124 $(srcdir)/subsegs.c \
125 $(srcdir)/symbols.c \
127 $(srcdir)/listing.c \
131 # in an expedient order
137 SOURCES
= $(LINKED_SOURCES
) $(REAL_SOURCES
)
146 $(srcdir)/input-file.h \
147 $(srcdir)/listing.h \
151 $(srcdir)/struc-symbol.h \
152 $(srcdir)/subsegs.h \
153 $(srcdir)/symbols.h \
163 HEADERS
= $(LINKED_HEADERS
) $(REAL_HEADERS
)
197 all: .gdbinit
as.new gasp.new
198 @srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
199 (cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) all)
201 dvi info install-info clean-info
:
202 @srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
203 (cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
)
205 make-gas.com
: stamp-mk.com
206 stamp-mk.com
: vmsconf.sh Makefile
207 sh
$(srcdir)/vmsconf.sh
$(OBJS
) > new-make.com
208 $(srcdir)/..
/move-if-change new-make.com
$(srcdir)/make-gas.com
211 # Now figure out from those variables how to compile and link.
213 # This is the variable actually used when we compile.
214 ALL_CFLAGS
= $(INTERNAL_CFLAGS
) $(CROSS
) $(CFLAGS
) $(HDEFINES
) $(TDEFINES
)
216 # How to link with both our special library facilities
217 # and the system's installed libraries.
219 LIBS
= @OPCODES_LIB@ @BFDLIB@
$(LOCAL_LOADLIBES
) ..
/libiberty
/libiberty.a
221 # Specify the directories to be searched for header files.
222 # Both . and srcdir are used, in that order,
223 # so that tm.h and config.h will be found in the compilation
224 # subdirectory rather than in the source directory.
225 INCLUDES
= -I.
-I
$(srcdir) -I..
/bfd
-I
$(srcdir)/config
-I
$(srcdir)/..
/include -I
$(srcdir)/..
-I
$(srcdir)/..
/bfd
227 # Always use -I$(srcdir)/config when compiling.
229 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $<
231 # This tells GNU make version 3 not to export all the variables
232 # defined in this file into the environment.
235 # Files to be copied away after each stage in building.
236 STAGESTUFF
= *.o
as.new gasp.new
238 $(OBJS
): @ALL_OBJ_DEPS@
240 as.new
: $(OBJS
) $(LIBS
)
241 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
as.new
$(OBJS
) $(LIBS
) $(LOADLIBES
)
243 $(OBJS
): config.h
as.h targ-env.h obj-format.h targ-cpu.h flonum.h expr.h \
244 struc-symbol.h write.h frags.h hash.h read.h symbols.h tc.h obj.h \
248 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o gasp.new gasp.o
$(LIBS
) $(LOADLIBES
)
251 @echo No
installcheck target is available yet for the GNU assembler.
254 @
(here
=`pwd` ; export here
; \
255 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $(CHECKFLAGS
) check)
257 config.status
: configure
258 if
[ -r config.status
]; then \
259 sh .
/config.status
--recheck
; \
261 echo You must configure gas. Look at the INSTALL file for details.
; \
265 config.h
: config-stamp
; @true
266 config-stamp
: Makefile conf
267 -rm -f config.new config-stamp
268 echo
'/* config.h. Generated automatically by make. */' > config.new
269 echo
'#ifndef GAS_VERSION' >> config.new
270 echo
'#define GAS_VERSION "$(VERSION)"' >> config.new
271 echo
'' >> config.new
272 cat conf
>> config.new
273 echo
'#endif /* GAS_VERSION */' >> config.new
274 $(srcdir)/..
/move-if-change config.new config.h
277 # Compiling object files from source files.
282 TARG_CPU_DEP_arc
= $(srcdir)/..
/include/opcode
/arc.h
285 TARG_CPU_DEP_generic
=
286 TARG_CPU_DEP_h8300
= $(srcdir)/..
/include/opcode
/h8300.h
287 TARG_CPU_DEP_h8500
= $(srcdir)/..
/opcodes
/h8500-opc.h
289 TARG_CPU_DEP_i386
= $(srcdir)/..
/include/opcode
/i386.h
292 TARG_CPU_DEP_m68k
= $(srcdir)/..
/include/opcode
/m68k.h
293 TARG_CPU_DEP_m88k
= $(srcdir)/config
/m88k-opcode.h
294 TARG_CPU_DEP_mips
= $(srcdir)/..
/include/opcode
/mips.h
298 TARG_CPU_DEP_rce
= $(srcdir)/..
/opcodes
/rce-opc.h
300 TARG_CPU_DEP_sh
= $(srcdir)/..
/opcodes
/sh-opc.h
304 TARG_CPU_DEP_w65
= $(srcdir)/..
/opcodes
/w65-opc.h
305 TARG_CPU_DEP_z8k
= $(srcdir)/..
/opcodes
/z8k-opc.h
307 gasp.o
: gasp.c config.h
308 app.o
: app.c write.h
309 as.o
: as.c output-file.h write.h subsegs.h
310 atof-generic.o
: atof-generic.c
311 bignum-copy.o
: bignum-copy.c
313 debug.o
: debug.c subsegs.h
315 flonum-konst.o
: flonum-konst.c
316 flonum-copy.o
: flonum-copy.c
317 flonum-mult.o
: flonum-mult.c
318 frags.o
: frags.c subsegs.h
320 input-file.o
: input-file.c input-file.h
321 input-scrub.o
: input-scrub.c input-file.h
322 listing.o
: listing.c input-file.h subsegs.h
323 literal.o
: literal.c subsegs.h
324 messages.o
: messages.c
325 output-file.o
: output-file.c output-file.h
327 subsegs.o
: subsegs.c subsegs.h
328 symbols.o
: symbols.c subsegs.h
329 write.o
: write.c subsegs.h output-file.h
330 ecoff.o
: ecoff.c ecoff.h \
331 $(srcdir)/..
/include/coff
/internal.h
$(srcdir)/..
/include/coff
/sym.h \
332 $(srcdir)/..
/include/coff
/ecoff.h \
333 $(srcdir)/..
/include/coff
/symconst.h \
334 $(srcdir)/..
/include/aout
/stab_gnu.h
335 stabs.o
: stabs.c subsegs.h
$(srcdir)/..
/include/aout
/stab_gnu.h
336 atof-targ.o
: atof-targ.c
337 obj-format.o
: obj-format.c
338 targ-cpu.o
: targ-cpu.c
$(TARG_CPU_DEP_@cpu_type@
)
340 obj-elf.o
: $(srcdir)/config
/obj-elf.c
341 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $(srcdir)/config
/obj-elf.c
342 obj-ecoff.o
: $(srcdir)/config
/obj-ecoff.c
343 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $(srcdir)/config
/obj-ecoff.c
345 e-mipself.o
: $(srcdir)/config
/e-mipself.c
346 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $(srcdir)/config
/e-mipself.c
347 e-mipsecoff.o
: $(srcdir)/config
/e-mipsecoff.c
348 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $(srcdir)/config
/e-mipsecoff.c
350 # Remake the info files.
352 doc
: $(srcdir)/as.
info
354 $(srcdir)/as.
info: $(srcdir)/doc
/as.texinfo
355 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) as.
info; mv
as.
info $srcdir)
357 diststuff
: $(DISTSTUFF
)
360 -rm -f
$(STAGESTUFF
) core stamp-mk.com
362 clean mostlyclean: clean-here
363 @cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
364 @if
[ -d testsuite
] ; then \
365 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $@
; \
368 # Like clean but also delete the links made to configure gas.
369 distclean: clean-here
370 @cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
371 @if
[ -d testsuite
] ; then \
372 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $@
; \
374 -rm -f config.status Makefile targ-env.h targ-cpu.h \
375 targ-cpu.c obj-format.h obj-format.c atof-targ.c TAGS \
376 config-stamp config.h conf config.log config.cache .gdbinit
377 realclean: clean distclean
380 # Entry points `install', `includes' and `uninstall'.
382 # Copy the files into directories where they will be run.
384 srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
385 $(INSTALL_XFORM
) as.new
$(bindir)/as; \
386 $(INSTALL_XFORM1
) $(srcdir)/doc
/as.1 $(man1dir)/as.1; \
387 n
=`echo as | sed '$(program_transform_name)'`; \
388 if
[ -d
$(tooldir
) ]; then \
389 if
[ -d
$(tooldir
)/bin
] ; then true
; else mkdir
$(tooldir
)/bin
; fi
; \
390 rm -f
$(tooldir
)/bin
/as; \
391 ln
$(bindir)/$$n $(tooldir
)/bin
/as >/dev
/null
2>/dev
/null \
392 ||
$(INSTALL_PROGRAM
) as.new
$(tooldir
)/bin
/as; \
394 srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
395 $(INSTALL_XFORM
) gasp.new
$(bindir)/gasp
; \
396 n
=`echo gasp | sed '$(program_transform_name)' `; \
397 if
[ -d
$(tooldir
) ]; then \
398 if
[ -d
$(tooldir
)/bin
] ; then true
; else mkdir
$(tooldir
)/bin
; fi
; \
399 rm -f
$(tooldir
)/bin
/gasp
; \
400 ln
$(bindir)/$$n $(tooldir
)/bin
/gasp
>/dev
/null
2>/dev
/null \
401 ||
$(INSTALL_PROGRAM
) gasp.new
$(tooldir
)/bin
/gasp
; \
404 # Cancel installation by deleting the installed files.
406 -n
=`t='$(program_transform_name)'; echo as | sed $$t`; \
407 rm -f
$(bindir)/$$n; \
408 rm -f
$(mandir)/$$n.1
409 -n
=`t='$(program_transform_name)'; echo gasp | sed $$t`; \
410 rm -f
$(bindir)/$$n; \
412 # These exist for maintenance purposes.
415 etags
$(REAL_HEADERS
) $(REAL_SOURCES
) $(srcdir)/config
/*.
[hc
] $(srcdir)/README
$(srcdir)/Makefile.in
417 bootstrap
: as.new
force
419 rm -f stage
&& ln
-s stage1 stage
420 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
422 rm -f stage
&& ln
-s stage2 stage
423 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
424 $(MAKE
) comparison against
=stage2
427 rm -f stage
&& ln
-s stage1 stage
428 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
430 rm -f stage
&& ln
-s stage2 stage
431 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
432 $(MAKE
) comparison against
=stage2
435 rm -f stage
&& ln
-s stage2 stage
436 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
437 $(MAKE
) comparison against
=stage2
439 # Copy the object files from a particular stage into a subdirectory.
442 -mv
$(STAGESTUFF
) stage1
443 if
[ -f stage1
/as.new
-a
! -f stage1
/as ] ; then
(cd stage1
; ln
-s
as.new
as) ; fi
447 -mv
$(STAGESTUFF
) stage2
448 if
[ -f stage2
/as.new
-a
! -f stage2
/as ] ; then
(cd stage2
; ln
-s
as.new
as) ; fi
452 -mv
$(STAGESTUFF
) stage3
453 if
[ -f stage3
/as.new
-a
! -f stage3
/as ] ; then
(cd stage3
; ln
-s
as.new
as) ; fi
457 # This rule is derived from corresponding code in the Makefile.in for gcc.
458 # The "tail +16c" is to bypass headers which may include timestamps or
459 # temporary assembly file names.
462 for file in
$(STAGESTUFF
) ; do \
463 tail
+16c .
/$$file > tmp-foo1
; \
464 if tail
+16c
${against}/$$file > tmp-foo2
2>/dev
/null
; then \
465 if cmp tmp-foo1 tmp-foo2
; then \
468 echo
$$file differs
; \
477 - (cd stage1
; rm -f
as ; mv
-f
* ..
)
481 - (cd stage2
; rm -f
as ; mv
-f
* ..
)
485 - (cd stage3
; rm -f
as ; mv
-f
* ..
)
488 #In GNU Make, ignore whether `stage*' exists.
489 .PHONY
: stage1 stage2 stage3 stage4
clean mostlyclean realclean distclean
490 .PHONY
: TAGS bootstrap
494 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
) \
495 $(srcdir)/configure.in config.status
496 $(SHELL
) .
/config.status
497 .gdbinit
: $(srcdir)/gdbinit.in config.status
498 $(SHELL
) .
/config.status