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, 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
= $(libdir)/$(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
='$(program_transform_name)'
63 INSTALL_XFORM1
= $(INSTALL_XFORM
) -b
=.1
76 AS_FOR_TARGET
= $${here}/as.new
79 if [ -f $${here}/../gcc/Makefile ] ; then \
80 echo $${here}/../gcc/xgcc -B$${here}/../gcc/; \
82 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
85 t='$(program_transform_name)'; echo gcc | sed $$t; \
90 if [ -f $${here}/../binutils/Makefile ] ; then \
91 echo $${here}/../binutils/nm ; \
93 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
96 t='$(program_transform_name)'; echo nm | sed $$t ; \
101 OBJDUMP_FOR_TARGET
= ` \
102 if [ -f $${here}/../binutils/Makefile ] ; then \
103 echo $${here}/../binutils/objdump ; \
105 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
108 t='$(program_transform_name)'; echo objdump | sed $$t ; \
114 "exec_prefix=$(exec_prefix)" \
115 "tooldir=$(tooldir)" \
117 "AR_FLAGS=$(AR_FLAGS)" \
121 "LOADLIBES=$(LOADLIBES)" \
122 "LDFLAGS=$(LDFLAGS)" \
125 "MAKEINFO=$(MAKEINFO)" \
126 "INSTALL=$(INSTALL)" \
127 "INSTALL_DATA=$(INSTALL_DATA)" \
128 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
132 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
133 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
134 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
135 "OBJDUMP_FOR_TARGET=$(OBJDUMP_FOR_TARGET)" \
136 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
139 # Lists of files for various purposes.
144 $(srcdir)/atof-generic.c \
145 $(srcdir)/bignum-copy.c \
148 $(srcdir)/flonum-konst.c \
149 $(srcdir)/flonum-copy.c \
150 $(srcdir)/flonum-mult.c \
153 $(srcdir)/hex-value.c \
154 $(srcdir)/input-file.c \
155 $(srcdir)/input-scrub.c \
156 $(srcdir)/literal.c \
157 $(srcdir)/messages.c \
158 $(srcdir)/output-file.c \
160 $(srcdir)/subsegs.c \
161 $(srcdir)/symbols.c \
163 $(srcdir)/listing.c \
168 # in an expedient order
174 SOURCES
= $(LINKED_SOURCES
) $(REAL_SOURCES
)
183 $(srcdir)/input-file.h \
184 $(srcdir)/listing.h \
188 $(srcdir)/struc-symbol.h \
189 $(srcdir)/subsegs.h \
190 $(srcdir)/symbols.h \
200 HEADERS
= $(LINKED_HEADERS
) $(REAL_HEADERS
)
235 # These are objects we know we'll be pulling in from other directories.
236 # For VMS, we have to build them explicitly.
238 ..
/libiberty
/obstack.o \
239 ..
/libiberty
/strdup.o \
240 ..
/libiberty
/strncasecmp.o \
241 ..
/libiberty
/getruntime.o
244 @srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
245 (cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) all)
247 dvi info install-info clean-info
:
248 @srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
249 (cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
)
251 make-gas.com
: stamp-mk.com
252 stamp-mk.com
: vmsconf.sh Makefile
253 sh
$(srcdir)/vmsconf.sh
$(OBJS
) $(VMS_OTHER_OBJS
) > new-make.com
254 $(srcdir)/..
/move-if-change new-make.com
$(srcdir)/make-gas.com
257 # Now figure out from those variables how to compile and link.
259 # This is the variable actually used when we compile.
260 ALL_CFLAGS
= $(INTERNAL_CFLAGS
) $(CROSS
) $(CFLAGS
) $(HDEFINES
) $(TDEFINES
)
262 # How to link with both our special library facilities
263 # and the system's installed libraries.
265 LIBS
= @OPCODES_LIB@ @BFDLIB@
$(LOCAL_LOADLIBES
) ..
/libiberty
/libiberty.a
267 # Specify the directories to be searched for header files.
268 # Both . and srcdir are used, in that order,
269 # so that tm.h and config.h will be found in the compilation
270 # subdirectory rather than in the source directory.
271 INCLUDES
= -I.
-I
$(srcdir) -I..
/bfd
-I
$(srcdir)/config
-I
$(srcdir)/..
/include -I
$(srcdir)/..
272 SUBDIR_INCLUDES
= -I..
-I
$(srcdir) -I
$(srcdir)/config
274 # Always use -I$(srcdir)/config when compiling.
276 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $<
278 # This tells GNU make version 3 not to export all the variables
279 # defined in this file into the environment.
282 # Files to be copied away after each stage in building.
283 STAGESTUFF
= *.o
as.new gasp.new
285 $(OBJS
): @ALL_OBJ_DEPS@
287 as.new
: $(OBJS
) $(LIBS
)
288 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
as.new
$(OBJS
) $(LIBS
) $(LOADLIBES
)
293 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o gasp.new gasp.o
$(LIBS
) $(LOADLIBES
)
296 @echo No
installcheck target is available yet for the GNU assembler.
299 @
(here
=`pwd` ; export here
; \
300 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $(CHECKFLAGS
) check)
302 config.status
: configure
303 if
[ -r config.status
]; then \
304 sh .
/config.status
--recheck
; \
306 echo You must configure gas. Look at the INSTALL file for details.
; \
310 configure
: configure.in aclocal.m4 acconfig.h
312 autoheader configure.in
> conf-in.h
&& \
313 ..
/move-if-change conf-in.h conf.in
)
314 (cd
${srcdir} && autoconf
)
316 config.h
: config-stamp
; @true
317 config-stamp
: Makefile conf
318 -rm -f config.new config-stamp
319 echo
'/* config.h. Generated automatically by make. */' > config.new
320 echo
'#ifndef GAS_VERSION' >> config.new
321 echo
'#define GAS_VERSION "$(VERSION)"' >> config.new
322 echo
'' >> config.new
323 cat conf
>> config.new
324 echo
'#endif /* GAS_VERSION */' >> config.new
325 $(srcdir)/..
/move-if-change config.new config.h
328 # Compiling object files from source files.
331 app.o
: app.c
as.h targ-env.h obj-format.h \
332 targ-cpu.h struc-symbol.h \
333 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
334 as.o
: as.c
as.h targ-env.h obj-format.h output-file.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 subsegs.h \
338 atof-generic.o
: atof-generic.c
as.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
341 bignum-copy.o
: bignum-copy.c
as.h \
342 targ-env.h obj-format.h \
343 targ-cpu.h struc-symbol.h \
344 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
345 cond.o
: cond.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 debug.o
: debug.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 expr.o
: expr.c
as.h targ-env.h obj-format.h \
354 targ-cpu.h struc-symbol.h \
355 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
357 flonum-konst.o
: flonum-konst.c flonum.h bignum.h
358 flonum-copy.o
: flonum-copy.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
361 flonum-mult.o
: flonum-mult.c flonum.h bignum.h
362 frags.o
: frags.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 \
366 hash.o
: hash.c
as.h targ-env.h obj-format.h \
367 targ-cpu.h struc-symbol.h \
368 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
369 hex-value.o
: hex-value.c
370 input-file.o
: input-file.c
as.h \
371 targ-env.h obj-format.h targ-cpu.h \
372 struc-symbol.h write.h flonum.h bignum.h expr.h \
373 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
374 input-scrub.o
: input-scrub.c
/usr
/include/errno.h
/usr
/include/sys
/errno.h \
375 as.h targ-env.h obj-format.h \
376 targ-cpu.h struc-symbol.h \
377 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
379 listing.o
: listing.c
as.h targ-env.h flonum.h bignum.h \
380 listing.h obj-format.h targ-cpu.h struc-symbol.h write.h expr.h \
381 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h subsegs.h
382 literal.o
: literal.c subsegs.h
as.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 symbols.h tc.h obj.h
385 messages.o
: messages.c
as.h targ-env.h obj-format.h \
386 targ-cpu.h struc-symbol.h \
387 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
388 output-file.o
: output-file.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 \
392 read.o
: read.c
as.h targ-env.h obj-format.h \
393 targ-cpu.h struc-symbol.h \
394 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
395 subsegs.o
: subsegs.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 symbols.o
: symbols.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 \
403 write.o
: write.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 subsegs.h output-file.h
407 ecoff.o
: ecoff.c
as.h targ-env.h obj-format.h \
408 targ-cpu.h struc-symbol.h \
409 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
410 ecoff.h
$(srcdir)/..
/include/coff
/internal.h \
411 $(srcdir)/..
/include/coff
/sym.h
$(srcdir)/..
/include/coff
/ecoff.h \
412 $(srcdir)/..
/include/coff
/symconst.h
$(srcdir)/..
/include/aout
/stab_gnu.h
413 stabs.o
: stabs.c
as.h targ-env.h obj-format.h \
414 targ-cpu.h struc-symbol.h \
415 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
416 subsegs.h
$(srcdir)/..
/include/aout
/stab_gnu.h
417 xmalloc.o
: xmalloc.c
418 atof-targ.o
: atof-targ.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 \
422 obj-format.o
: obj-format.c
as.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 subsegs.h symbols.h tc.h obj.h
426 targ-cpu.o
: targ-cpu.c config.h targ-env.h obj-format.h \
427 targ-cpu.h struc-symbol.h \
428 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
429 symbols.h tc.h obj.h
$(TARG_CPU_DEPENDENTS
)
431 # Remake the info files.
433 doc
: $(srcdir)/as.
info
435 $(srcdir)/as.
info: $(srcdir)/doc
/as.texinfo
436 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) as.
info; mv
as.
info $srcdir)
439 -rm -f
$(STAGESTUFF
) core
441 clean mostlyclean: clean-here
442 @cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
443 @if
[ -d testsuite
] ; then \
444 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $@
; \
447 # Like clean but also delete the links made to configure gas.
448 distclean realclean: clean-here
449 @cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) $@
450 @if
[ -d testsuite
] ; then \
451 cd testsuite
; $(MAKE
) $(FLAGS_TO_PASS
) $@
; \
453 -rm -f config.status Makefile targ-env.h targ-cpu.h \
454 targ-cpu.c obj-format.h obj-format.c atof-targ.c TAGS \
455 config-stamp config.h conf config.log config.cache
457 # Entry points `install', `includes' and `uninstall'.
459 # Copy the files into directories where they will be run.
461 srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
462 $(INSTALL_XFORM
) as.new
$(bindir)/as; \
463 $(INSTALL_XFORM1
) $(srcdir)/doc
/as.1 $(man1dir)/as.1; \
464 n
=`t='$(program_transform_name)'; echo as | sed $$t`; \
465 if
[ -d
$(tooldir
) ]; then \
466 if
[ -d
$(tooldir
)/bin
] ; then true
; else mkdir
$(tooldir
)/bin
; fi
; \
467 rm -f
$(tooldir
)/bin
/as; \
468 ln
$(bindir)/$$n $(tooldir
)/bin
/as >/dev
/null
2>/dev
/null \
469 ||
$(INSTALL_PROGRAM
) as.new
$(tooldir
)/bin
/as; \
471 srcroot
=`cd $(srcroot); pwd`; export srcroot
; \
472 $(INSTALL_XFORM
) gasp.new
$(bindir)/gasp
; \
473 n
=`t='$(program_transform_name)'; echo gasp | sed $$t`; \
474 if
[ -d
$(tooldir
) ]; then \
475 if
[ -d
$(tooldir
)/bin
] ; then true
; else mkdir
$(tooldir
)/bin
; fi
; \
476 rm -f
$(tooldir
)/bin
/gasp
; \
477 ln
$(bindir)/$$n $(tooldir
)/bin
/gasp
>/dev
/null
2>/dev
/null \
478 ||
$(INSTALL_PROGRAM
) gasp.new
$(tooldir
)/bin
/gasp
; \
481 # Cancel installation by deleting the installed files.
483 -n
=`t='$(program_transform_name)'; echo as | sed $$t`; \
484 rm -f
$(bindir)/$$n; \
485 rm -f
$(mandir)/$$n.1
486 -n
=`t='$(program_transform_name)'; echo gasp | sed $$t`; \
487 rm -f
$(bindir)/$$n; \
489 # These exist for maintenance purposes.
492 etags
$(REAL_HEADERS
) $(REAL_SOURCES
) $(srcdir)/config
/*.
[hc
] $(srcdir)/README
$(srcdir)/Makefile.in
494 bootstrap
: as.new
force
496 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
498 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
499 $(MAKE
) comparison against
=stage2
502 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
504 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
505 $(MAKE
) comparison against
=stage2
508 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new gasp.new
509 $(MAKE
) comparison against
=stage2
511 # Copy the object files from a particular stage into a subdirectory.
514 -mv
$(STAGESTUFF
) stage1
515 if
[ -f stage1
/as.new
-a
! -f stage1
/as ] ; then
(cd stage1
; ln
-s
as.new
as) ; fi
519 -mv
$(STAGESTUFF
) stage2
520 if
[ -f stage2
/as.new
-a
! -f stage2
/as ] ; then
(cd stage2
; ln
-s
as.new
as) ; fi
524 -mv
$(STAGESTUFF
) stage3
525 if
[ -f stage3
/as.new
-a
! -f stage3
/as ] ; then
(cd stage3
; ln
-s
as.new
as) ; fi
530 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
533 - (cd stage1
; rm -f
as ; mv
-f
* ..
)
537 - (cd stage2
; rm -f
as ; mv
-f
* ..
)
541 - (cd stage3
; rm -f
as ; mv
-f
* ..
)
544 #In GNU Make, ignore whether `stage*' exists.
545 .PHONY
: stage1 stage2 stage3 stage4
clean mostlyclean realclean distclean
546 .PHONY
: TAGS bootstrap
550 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
) \
551 $(srcdir)/configure.in config.status
552 $(SHELL
) .
/config.status