1 # Makefile for GNU Assembler
2 # Copyright (C) 1987, 1988, 1990, 1991 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.
22 # The targets for external use include:
23 # all, doc, proto, install, uninstall, includes, TAGS,
24 # clean, cleanconfig, realclean, stage1, stage2, stage3, stage4.
26 # Variables that exist for you to override.
27 # See below for how to change them for certain systems.
33 bindir = $(prefix)/bin
34 datadir = $(prefix)/lib
35 libdir = $(prefix)/lib
36 mandir = $(datadir)/man
37 man1dir = $(mandir)/man1
38 man2dir = $(mandir)/man2
39 man3dir = $(mandir)/man3
40 man4dir = $(mandir)/man4
41 man5dir = $(mandir)/man5
42 man6dir = $(mandir)/man6
43 man7dir = $(mandir)/man7
44 man8dir = $(mandir)/man8
45 man9dir = $(mandir)/man9
46 infodir = $(datadir)/info
47 includedir = $(prefix)/include
48 docdir
= $(datadir)/doc
53 INSTALL_PROGRAM
= $(INSTALL
)
54 INSTALL_DATA
= $(INSTALL
)
62 # Version of ar to use when compiling gnulib.
65 # Additional system libraries to link with.
68 # Specify the rule for actually making gnulib.
69 GNULIB
= gnulib.portable
71 # Specify the rule for actually making gnulib2.
72 GNULIB2
= gnulib2.portable
74 # List of extra C and assembler files to add to gnulib.
75 # Assembler files should have names ending in `.asm'.
78 # Program to convert libraries.
81 # Control whether header files are installed.
82 INSTALL_HEADERS
=install-headers
84 # Change this to empty to prevent installing limits.h
87 # Directory to link to, when using the target `maketest'.
90 # For better debugging under COFF, define SEPARATE_AUX_OUTPUT in config.h
91 # and define the following variable as `aux-output2.c' in make-...
94 # Flags to use when cross-building GCC.
95 # Prefix to apply to names of object files when using them
96 # to run on the machine we are compiling on.
98 # Prefix to apply to names of object files when compiling them
99 # to run on the machine we are compiling on.
100 # The default for this variable is chosen to keep these rules
101 # out of the way of the other rules for compiling the same source files.
104 HOST_CFLAGS
=$(ALL_CFLAGS
)
105 HOST_LDFLAGS
=$(LDFLAGS
)
106 HOST_CPPFLAGS
=$(CPPFLAGS
)
108 # Choose the real default target.
111 # End of variables for you to override.
113 # Lists of files for various purposes.
118 $(srcdir)/atof-generic.c \
119 $(srcdir)/bignum-copy.c \
122 $(srcdir)/flonum-const.c \
123 $(srcdir)/flonum-copy.c \
124 $(srcdir)/flonum-mult.c \
127 $(srcdir)/hex-value.c \
128 $(srcdir)/input-file.c \
129 $(srcdir)/input-scrub.c \
130 $(srcdir)/messages.c \
131 $(srcdir)/output-file.c \
134 $(srcdir)/subsegs.c \
135 $(srcdir)/symbols.c \
136 $(srcdir)/version.c \
138 $(srcdir)/listing.c \
139 $(srcdir)/xmalloc.c \
142 # in an expedient order
148 SOURCES
= $(LINKED_SOURCES
) $(REAL_SOURCES
)
157 $(srcdir)/input-file.h \
161 $(srcdir)/struc-symbol.h \
162 $(srcdir)/subsegs.h \
163 $(srcdir)/symbols.h \
164 $(srcdir)/syscalls.h \
176 HEADERS
= $(LINKED_HEADERS
) $(REAL_HEADERS
)
208 #### host, target, and site specific Makefile frags come in here.
210 # Definition of `all' is here so that new rules inserted by sed
211 # do not specify the default target.
212 # The real definition is under `all.internal'.
221 cp .
/fake-as .
/as.new
223 # Now figure out from those variables how to compile and link.
225 # This is the variable actually used when we compile.
226 ALL_CFLAGS
= -g
$(INTERNAL_CFLAGS
) $(CFLAGS
) $(HDEFINES
) $(TDEFINES
)
228 # Even if ALLOCA is set, don't use it if compiling with GCC.
229 USE_ALLOCA
= `if [ x"${CC}" = x"${OLDCC}" ] ; then echo ${ALLOCA}; else true; fi`
230 USE_HOST_ALLOCA
= `if [ x"${CC}" = x"${OLDCC}" ] ; then echo ${HOST_PREFIX}${ALLOCA}; else true; fi`
232 # Likewise, for use in the tools that must run on this machine
233 # even if we are cross-building GCC.
234 # We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
235 HOST_LIBDEPS
= $(HOST_PREFIX
)$(OBSTACK
) $(HOST_PREFIX
)$(ALLOCA
) $(HOST_PREFIX
)$(MALLOC
)
237 # How to link with both our special library facilities
238 # and the system's installed libraries.
240 LIBS
= $(LOCAL_LOADLIBES
) $(CLIB
) $(unsubdir
)/..
/libiberty
$(subdir
)/libiberty.a
242 # Likewise, for use in the tools that must run on this machine
243 # even if we are cross-building GCC.
244 HOST_LIBS
= $(HOST_PREFIX
)$(OBSTACK
) $(USE_HOST_ALLOCA
) $(HOST_PREFIX
)$(MALLOC
) $(CLIB
)
246 # Specify the directories to be searched for header files.
247 # Both . and srcdir are used, in that order,
248 # so that tm.h and config.h will be found in the compilation
249 # subdirectory rather than in the source directory.
250 INCLUDES
= -I.
-I
$(srcdir) -I
$(srcdir)/config
-I
$(srcdir)/..
/include
251 SUBDIR_INCLUDES
= -I..
-I
$(srcdir) -I
$(srcdir)/config
253 # Always use -I$(srcdir)/config when compiling.
255 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $<
257 # This tells GNU make version 3 not to export all the variables
258 # defined in this file into the environment.
261 # Files to be copied away after each stage in building.
263 STAGESTUFF
= *.o
as.new
265 # The files that "belong" in CONFIG_H are deliberately omitted
266 # because having them there would not be useful in actual practice.
267 # All they would do is cause complete recompilation every time
268 # one of the machine description files is edited.
269 # That may or may not be what one wants to do.
270 # If it is, rm *.o is an easy way to do it.
271 # CONFIG_H = config.h tm.h
274 as.new
: $(OBJS
) $(LIBDEPS
)
276 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
as.new
$(OBJS
) $(LIBS
) $(LOADLIBES
)
281 # This is what is made with the host's compiler if making a cross assembler.
282 native
: config.status
as
285 @echo You must configure gas. Look at the INSTALL file for details.
288 compilations
: ${OBJS}
290 # Compiling object files from source files.
292 app.o
: app.c
as.h host.h targ-env.h obj-format.h \
293 targ-cpu.h struc-symbol.h \
294 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
295 as.o
: as.c
as.h host.h targ-env.h obj-format.h \
296 targ-cpu.h struc-symbol.h \
297 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
298 atof-generic.o
: atof-generic.c
as.h host.h targ-env.h obj-format.h \
299 targ-cpu.h struc-symbol.h \
300 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
301 bignum-copy.o
: bignum-copy.c
as.h host.h \
302 targ-env.h obj-format.h \
303 targ-cpu.h struc-symbol.h \
304 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
305 cond.o
: cond.c
as.h host.h 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 \
309 debug.o
: debug.c
as.h host.h targ-env.h obj-format.h \
310 targ-cpu.h struc-symbol.h \
311 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
313 expr.o
: expr.c
as.h host.h targ-env.h obj-format.h \
314 targ-cpu.h struc-symbol.h \
315 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
317 flonum-const.o
: flonum-const.c flonum.h bignum.h
318 flonum-copy.o
: flonum-copy.c
as.h host.h targ-env.h obj-format.h \
319 targ-cpu.h struc-symbol.h \
320 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
321 flonum-mult.o
: flonum-mult.c flonum.h bignum.h
322 frags.o
: frags.c
as.h host.h targ-env.h obj-format.h \
323 targ-cpu.h struc-symbol.h \
324 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
326 hash.o
: hash.c
as.h host.h targ-env.h obj-format.h \
327 targ-cpu.h struc-symbol.h \
328 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
329 hex-value.o
: hex-value.c
330 input-file.o
: input-file.c
as.h host.h \
331 targ-env.h obj-format.h targ-cpu.h \
332 struc-symbol.h write.h flonum.h bignum.h expr.h \
333 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
334 input-scrub.o
: input-scrub.c
/usr
/include/errno.h
/usr
/include/sys
/errno.h \
335 as.h host.h targ-env.h obj-format.h \
336 targ-cpu.h struc-symbol.h \
337 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
339 listing.o
: listing.c
as.h host.h targ-env.h flonum.h bignum.h \
340 listing.h obj-format.h targ-cpu.h struc-symbol.h write.h expr.h \
341 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
342 messages.o
: messages.c
as.h host.h 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 obstack.o
: obstack.c
346 output-file.o
: output-file.c
as.h host.h targ-env.h obj-format.h \
347 targ-cpu.h struc-symbol.h \
348 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
350 read.o
: read.c
as.h host.h targ-env.h obj-format.h \
351 targ-cpu.h struc-symbol.h \
352 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 version.o
: version.c
364 write.o
: write.c
as.h host.h targ-env.h obj-format.h \
365 targ-cpu.h struc-symbol.h \
366 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
367 subsegs.h output-file.h
368 xmalloc.o
: xmalloc.c
369 xrealloc.o
: xrealloc.c
370 atof-targ.o
: atof-targ.c
as.h host.h targ-env.h obj-format.h \
371 targ-cpu.h struc-symbol.h \
372 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
374 obj-format.o
: obj-format.c
as.h host.h targ-env.h obj-format.h \
375 targ-cpu.h struc-symbol.h \
376 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
378 targ-cpu.o
: targ-cpu.c 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 \
381 symbols.h tc.h obj.h
$(TARG_CPU_DEPENDENTS
)
384 # Compile the libraries to be used by gen*.
385 # If we are not cross-building, gen* use the same .o's that cc1 will use,
386 # and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
387 # with the rules for rtl.o, alloca.o, etc.
388 $(HOST_PREFIX_1
)alloca.o
: alloca.c
389 rm -f
$(HOST_PREFIX
)alloca.c
390 cp
$(srcdir)/alloca.c
$(HOST_PREFIX
)alloca.c
391 $(HOST_CC
) -c
$(HOST_CFLAGS
) $(HOST_CPPFLAGS
) $(INCLUDES
) $(HOST_PREFIX
)alloca.c
393 $(HOST_PREFIX_1
)obstack.o
: obstack.c
394 rm -f
$(HOST_PREFIX
)obstack.c
395 cp
$(srcdir)/obstack.c
$(HOST_PREFIX
)obstack.c
396 $(HOST_CC
) -c
$(HOST_CFLAGS
) $(HOST_CPPFLAGS
) $(INCLUDES
) $(HOST_PREFIX
)obstack.c
398 $(HOST_PREFIX_1
)malloc.o
: malloc.c
399 rm -f
$(HOST_PREFIX
)malloc.c
400 cp
$(srcdir)/malloc.c
$(HOST_PREFIX
)malloc.c
401 $(HOST_CC
) -c
$(HOST_CFLAGS
) $(HOST_CPPFLAGS
) $(INCLUDES
) $(HOST_PREFIX
)malloc.c
403 # Remake the info files.
405 doc
: $(srcdir)/as.
info
407 $(srcdir)/as.
info: $(srcdir)/doc
/as.texinfo
408 (cd doc
; make
as.
info; mv
as.
info $srcdir)
411 # Deletion of files made during compilation.
412 # There are three levels of this: `clean', `cleanconfig' and `realclean'.
413 # `clean' deletes what you want to delete ordinarily to save space.
414 # This is most, but not all, of the files made by compilation.
415 # `cleanconfig' also deletes everything depending
416 # on the choice of config files.
417 # `realclean' also deletes everything that could be regenerated automatically.
420 -rm -f
$(STAGESTUFF
) $(HOST_PREFIX_1
)alloca.c
$(HOST_PREFIX_1
)malloc.c
$(HOST_PREFIX_1
)obstack.c core
422 # Like clean but also delete the links made to configure gas.
424 -rm -f config.status Makefile host.h targ-env.h
425 -rm -f targ-cpu.h targ-cpu.c
426 -rm -f obj-format.h obj-format.c
429 # Get rid of every file that's generated from some other file (except INSTALL).
430 realclean: cleanconfig
431 -rm -f gas.aux gas.cps gas.fns gas.
info gas.kys gas.pgs gas.tps gas.vrs
433 -rm -f gas.
info* gas.?? gas.??s gas.log gas.toc gas.
*aux
436 # Entry points `install', `includes' and `uninstall'.
438 # Copy the files into directories where they will be run.
440 $(INSTALL_PROGRAM
) $(ALL
) $(bindir)/as
442 # Create the installation directory.
446 -mkdir
$(libdir)/gcc
/$(target
)
447 -mkdir
$(libdir)/gcc
/$(target
)/$(version
)
449 # Install the compiler executables built during cross compilation.
450 install-cross
: native install-dir
451 -if
[ -f cc1
] ; then
$(INSTALL_PROGRAM
) cc1
$(libsubdir
)/cc1
; else true
; fi
452 -if
[ -f cc1plus
] ; then
$(INSTALL_PROGRAM
) cc1plus
$(libsubdir
)/cc1plus
; else true
; fi
453 $(INSTALL_PROGRAM
) cpp $(libsubdir
)/cpp
454 .
/gcc
-dumpspecs
> $(libsubdir
)/specs
455 $(INSTALL_PROGRAM
) gcc
$(bindir)/gcc
457 # Install the man pages.
458 install-man
: install-dir
$(srcdir)/gcc
.1 protoize
.1 unprotoize
.1
459 $(INSTALL_FILE
) $(srcdir)/gcc
.1 $(mandir)/gcc.
$(manext)
460 chmod a-x
$(mandir)/gcc.
$(manext)
461 $(INSTALL_FILE
) $(srcdir)/protoize
.1 $(mandir)/protoize.
$(manext)
462 chmod a-x
$(mandir)/protoize.
$(manext)
463 $(INSTALL_FILE
) $(srcdir)/unprotoize
.1 $(mandir)/unprotoize.
$(manext)
464 chmod a-x
$(mandir)/unprotoize.
$(manext)
466 # Cancel installation by deleting the installed files.
470 -rm -rf
$(mandir)/gas.
$(manext)
473 # These exist for maintenance purposes.
476 etags
$(REAL_SOURCES
) $(REAL_HEADERS
) $(srcdir)/README
$(srcdir)/Makefile
$(srcdir)/config
/*.
[hc
]
478 bootstrap
: $(ALL
) force
480 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= $(ALL
)
482 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= $(ALL
)
483 $(MAKE
) comparison against
=stage2
486 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= $(ALL
)
488 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= $(ALL
)
489 $(MAKE
) comparison against
=stage2
492 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= $(ALL
)
493 $(MAKE
) comparison against
=stage2
495 # Copy the object files from a particular stage into a subdirectory.
498 -mv
$(STAGESTUFF
) stage1
499 if
[ -f stage1
/as.new
-a
! -f stage1
/as ] ; then
(cd stage1
; ln
-s
as.new
as) ; fi
503 -mv
$(STAGESTUFF
) stage2
504 if
[ -f stage2
/as.new
-a
! -f stage2
/as ] ; then
(cd stage2
; ln
-s
as.new
as) ; fi
508 -mv
$(STAGESTUFF
) stage3
509 if
[ -f stage3
/as.new
-a
! -f stage3
/as ] ; then
(cd stage3
; ln
-s
as.new
as) ; fi
514 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
517 - (cd stage1
; rm as ; mv
-f
* ..
)
521 - (cd stage2
; rm as ; mv
-f
* ..
)
525 - (cd stage3
; rm as ; mv
-f
* ..
)
528 # Copy just the executable files from a particular stage into a subdirectory,
529 # and delete the object files. Use this if you're just verifying a version
530 # that is pretty sure to work, and you are short of disk space.
533 -mv cc1
cpp cccp gcc stage1
535 -cp gnulib stage1
&& $(RANLIB
) stage1
/gnulib
540 -mv cc1
cpp cccp gcc stage2
542 -cp gnulib stage2
&& $(RANLIB
) stage2
/gnulib
547 -mv cc1
cpp cccp gcc stage3
549 -cp gnulib stage3
&& $(RANLIB
) stage3
/gnulib
554 -mv cc1
cpp cccp gcc stage4
556 -cp gnulib stage4
&& $(RANLIB
) stage4
/gnulib
559 #In GNU Make, ignore whether `stage*' exists.
560 .PHONY
: stage1 stage2 stage3 stage4
clean realclean TAGS bootstrap
561 .PHONY
: risky-stage1 risky-stage2 risky-stage3 risky-stage4
565 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
566 $(SHELL
) .
/config.status