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
= $(exec_prefix)/$(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
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
)
197 # These are objects we know we'll be pulling in from other directories.
198 # For VMS, we have to build them explicitly.
200 ..
/libiberty
/xmalloc.o \
201 ..
/libiberty
/xexit.o \
202 ..
/libiberty
/obstack.o \
203 ..
/libiberty
/strdup.o \
204 ..
/libiberty
/strncasecmp.o \
205 ..
/libiberty
/concat.o \
206 ..
/libiberty
/getopt.o \
207 ..
/libiberty
/getopt1.o \
208 ..
/libiberty
/getruntime.o \
211 all: .gdbinit
as.new gasp.new
212 @srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
213 (cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) all)
215 dvi info install-info clean-info
:
216 @srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
217 (cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
)
219 make-gas.com
: stamp-mk.com
220 stamp-mk.com
: vmsconf.sh Makefile
221 sh
$(srcdir)/vmsconf.sh
$(OBJS
) $(VMS_OTHER_OBJS
) > new-make.com
222 $(srcdir)/..
/move-if-change new-make.com
$(srcdir)/make-gas.com
225 # Now figure out from those variables how to compile and link.
227 # This is the variable actually used when we compile.
228 ALL_CFLAGS
= $(INTERNAL_CFLAGS
) $(CROSS
) $(CFLAGS
) $(HDEFINES
) $(TDEFINES
)
230 # How to link with both our special library facilities
231 # and the system's installed libraries.
233 LIBS
= @OPCODES_LIB@ @BFDLIB@
$(LOCAL_LOADLIBES
) ..
/libiberty
/libiberty.a
235 # Specify the directories to be searched for header files.
236 # Both . and srcdir are used, in that order,
237 # so that tm.h and config.h will be found in the compilation
238 # subdirectory rather than in the source directory.
239 INCLUDES
= -I.
-I
$(srcdir) -I..
/bfd
-I
$(srcdir)/config
-I
$(srcdir)/..
/include -I
$(srcdir)/..
241 # Always use -I$(srcdir)/config when compiling.
243 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $<
245 # This tells GNU make version 3 not to export all the variables
246 # defined in this file into the environment.
249 # Files to be copied away after each stage in building.
250 STAGESTUFF
= *.o
as.new gasp.new
252 $(OBJS
): @ALL_OBJ_DEPS@
254 as.new
: $(OBJS
) $(LIBS
)
255 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
as.new
$(OBJS
) $(LIBS
) $(LOADLIBES
)
257 $(OBJS
): config.h
as.h targ-env.h obj-format.h targ-cpu.h flonum.h expr.h \
258 struc-symbol.h write.h frags.h hash.h read.h symbols.h tc.h obj.h \
262 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o gasp.new gasp.o
$(LIBS
) $(LOADLIBES
)
265 @echo No
installcheck target is available yet for the GNU assembler.
268 @
(here
=`pwd` ; export here
; \
269 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $(CHECKFLAGS
) check)
271 config.status
: configure
272 if
[ -r config.status
]; then \
273 sh .
/config.status
--recheck
; \
275 echo You must configure gas. Look at the INSTALL file for details.
; \
279 config.h
: config-stamp
; @true
280 config-stamp
: Makefile conf
281 -rm -f config.new config-stamp
282 echo
'/* config.h. Generated automatically by make. */' > config.new
283 echo
'#ifndef GAS_VERSION' >> config.new
284 echo
'#define GAS_VERSION "$(VERSION)"' >> config.new
285 echo
'' >> config.new
286 cat conf
>> config.new
287 echo
'#endif /* GAS_VERSION */' >> config.new
288 $(srcdir)/..
/move-if-change config.new config.h
291 # Compiling object files from source files.
296 TARG_CPU_DEP_arc
= $(srcdir)/..
/include/opcode
/arc.h
299 TARG_CPU_DEP_generic
=
300 TARG_CPU_DEP_h8300
= $(srcdir)/..
/include/opcode
/h8300.h
301 TARG_CPU_DEP_h8500
= $(srcdir)/..
/opcodes
/h8500-opc.h
303 TARG_CPU_DEP_i386
= $(srcdir)/..
/include/opcode
/i386.h
306 TARG_CPU_DEP_m68k
= $(srcdir)/..
/include/opcode
/m68k.h
307 TARG_CPU_DEP_m88k
= $(srcdir)/config
/m88k-opcode.h
308 TARG_CPU_DEP_mips
= $(srcdir)/..
/include/opcode
/mips.h
312 TARG_CPU_DEP_rce
= $(srcdir)/..
/opcodes
/rce-opc.h
314 TARG_CPU_DEP_sh
= $(srcdir)/..
/opcodes
/sh-opc.h
318 TARG_CPU_DEP_w65
= $(srcdir)/..
/opcodes
/w65-opc.h
319 TARG_CPU_DEP_z8k
= $(srcdir)/..
/opcodes
/z8k-opc.h
321 gasp.o
: gasp.c config.h
322 app.o
: app.c write.h
323 as.o
: as.c output-file.h write.h subsegs.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
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
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_@cpu_type@
)
354 # Remake the info files.
356 doc
: $(srcdir)/as.
info
358 $(srcdir)/as.
info: $(srcdir)/doc
/as.texinfo
359 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) as.
info; mv
as.
info $srcdir)
361 diststuff
: $(DISTSTUFF
)
364 -rm -f
$(STAGESTUFF
) core stamp-mk.com
366 clean mostlyclean: clean-here
367 @cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
368 @if
[ -d testsuite
] ; then \
369 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $@
; \
372 # Like clean but also delete the links made to configure gas.
373 distclean: clean-here
374 @cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
375 @if
[ -d testsuite
] ; then \
376 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $@
; \
378 -rm -f config.status Makefile targ-env.h targ-cpu.h \
379 targ-cpu.c obj-format.h obj-format.c atof-targ.c TAGS \
380 config-stamp config.h conf config.log config.cache .gdbinit
381 realclean: clean distclean
384 # Entry points `install', `includes' and `uninstall'.
386 # Copy the files into directories where they will be run.
388 srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
389 $(INSTALL_XFORM
) as.new
$(bindir)/as; \
390 $(INSTALL_XFORM1
) $(srcdir)/doc
/as.1 $(man1dir)/as.1; \
391 n
=`echo as | sed '$(program_transform_name)'`; \
392 if
[ -d
$(tooldir
) ]; then \
393 if
[ -d
$(tooldir
)/bin
] ; then true
; else mkdir
$(tooldir
)/bin
; fi
; \
394 rm -f
$(tooldir
)/bin
/as; \
395 ln
$(bindir)/$$n $(tooldir
)/bin
/as >/dev
/null
2>/dev
/null \
396 ||
$(INSTALL_PROGRAM
) as.new
$(tooldir
)/bin
/as; \
398 srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
399 $(INSTALL_XFORM
) gasp.new
$(bindir)/gasp
; \
400 n
=`echo gasp | sed '$(program_transform_name)' `; \
401 if
[ -d
$(tooldir
) ]; then \
402 if
[ -d
$(tooldir
)/bin
] ; then true
; else mkdir
$(tooldir
)/bin
; fi
; \
403 rm -f
$(tooldir
)/bin
/gasp
; \
404 ln
$(bindir)/$$n $(tooldir
)/bin
/gasp
>/dev
/null
2>/dev
/null \
405 ||
$(INSTALL_PROGRAM
) gasp.new
$(tooldir
)/bin
/gasp
; \
408 # Cancel installation by deleting the installed files.
410 -n
=`t='$(program_transform_name)'; echo as | sed $$t`; \
411 rm -f
$(bindir)/$$n; \
412 rm -f
$(mandir)/$$n.1
413 -n
=`t='$(program_transform_name)'; echo gasp | sed $$t`; \
414 rm -f
$(bindir)/$$n; \
416 # These exist for maintenance purposes.
419 etags
$(REAL_HEADERS
) $(REAL_SOURCES
) $(srcdir)/config
/*.
[hc
] $(srcdir)/README
$(srcdir)/Makefile.in
421 bootstrap
: as.new
force
423 rm -f stage
&& ln
-s stage1 stage
424 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
426 rm -f stage
&& ln
-s stage2 stage
427 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
428 $(MAKE
) comparison against
=stage2
431 rm -f stage
&& ln
-s stage1 stage
432 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
434 rm -f stage
&& ln
-s stage2 stage
435 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
436 $(MAKE
) comparison against
=stage2
439 rm -f stage
&& ln
-s stage2 stage
440 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
441 $(MAKE
) comparison against
=stage2
443 # Copy the object files from a particular stage into a subdirectory.
446 -mv
$(STAGESTUFF
) stage1
447 if
[ -f stage1
/as.new
-a
! -f stage1
/as ] ; then
(cd stage1
; ln
-s
as.new
as) ; fi
451 -mv
$(STAGESTUFF
) stage2
452 if
[ -f stage2
/as.new
-a
! -f stage2
/as ] ; then
(cd stage2
; ln
-s
as.new
as) ; fi
456 -mv
$(STAGESTUFF
) stage3
457 if
[ -f stage3
/as.new
-a
! -f stage3
/as ] ; then
(cd stage3
; ln
-s
as.new
as) ; fi
461 # This rule is derived from corresponding code in the Makefile.in for gcc.
462 # The "tail +16c" is to bypass headers which may include timestamps or
463 # temporary assembly file names.
466 for file in
$(STAGESTUFF
) ; do \
467 tail
+16c .
/$$file > tmp-foo1
; \
468 if tail
+16c
${against}/$$file > tmp-foo2
2>/dev
/null
; then \
469 if cmp tmp-foo1 tmp-foo2
; then \
472 echo
$$file differs
; \
481 - (cd stage1
; rm -f
as ; mv
-f
* ..
)
485 - (cd stage2
; rm -f
as ; mv
-f
* ..
)
489 - (cd stage3
; rm -f
as ; mv
-f
* ..
)
492 #In GNU Make, ignore whether `stage*' exists.
493 .PHONY
: stage1 stage2 stage3 stage4
clean mostlyclean realclean distclean
494 .PHONY
: TAGS bootstrap
498 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
) \
499 $(srcdir)/configure.in config.status
500 $(SHELL
) .
/config.status
501 .gdbinit
: $(srcdir)/gdbinit.in config.status
502 $(SHELL
) .
/config.status