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 1, 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.
30 CFLAGS
= -g
$(XCFLAGS
) -I
$(srcdir)/..
/include
31 INTERNAL_CFLAGS
= $(CROSS
)
39 # on sysV, define this as cp.
41 # These permit overriding just for certain files.
42 INSTALL_PROGRAM
= $(INSTALL
)
43 INSTALL_FILE
= $(INSTALL
)
45 # Define this as & to perform parallel make on a Sequent.
46 # Note that this has some bugs, and it seems currently necessary
47 # to compile all the gen* files first by hand to avoid erroneous results.
50 # How to invoke ranlib.
52 # Test to use to see whether ranlib exists on the system.
53 RANLIB_TEST
= [ -f
/usr
/bin
/ranlib
-o
-f
/bin
/ranlib
]
55 # CFLAGS for use with OLDCC, for compiling gnulib.
56 # NOTE: -O does not work on some Unix systems!
59 # Version of ar to use when compiling gnulib.
62 version
=`awk '{print substr ($$4, 2, length ($$4) - 3); }' $(unsubdir)/../gcc/version.c`
64 # Directory where sources are, from where we are.
66 # Common prefix for installation directories.
67 # NOTE: This directory must exist when you start installation.
69 # Directory in which to put the executable for the command `gcc'
70 bindir = $(destdir
)/H-
$(host_alias
)/T-
$(target_alias
)/bin
71 # Directory in which to put the directories used by the compiler.
72 libdir = $(destdir
)/H-
$(host_alias
)/T-
$(target_alias
)/lib
73 # Directory in which the compiler finds executables, libraries, etc.
74 libsubdir
= $(libdir)/gcc
/$(target
)/$(version
)
75 # Number to put in man-page filename.
77 # Directory in which to put man pages.
78 mandir = $(destdir
)/H-independent
/man
/man
$(manext)
80 # Additional system libraries to link with.
83 # Specify the rule for actually making gnulib.
84 GNULIB
= gnulib.portable
86 # Specify the rule for actually making gnulib2.
87 GNULIB2
= gnulib2.portable
89 # List of extra C and assembler files to add to gnulib.
90 # Assembler files should have names ending in `.asm'.
93 # Program to convert libraries.
96 # Control whether header files are installed.
97 INSTALL_HEADERS
=install-headers
99 # Change this to empty to prevent installing limits.h
102 # Directory to link to, when using the target `maketest'.
105 # For better debugging under COFF, define SEPARATE_AUX_OUTPUT in config.h
106 # and define the following variable as `aux-output2.c' in make-...
109 # Flags to use when cross-building GCC.
110 # Prefix to apply to names of object files when using them
111 # to run on the machine we are compiling on.
113 # Prefix to apply to names of object files when compiling them
114 # to run on the machine we are compiling on.
115 # The default for this variable is chosen to keep these rules
116 # out of the way of the other rules for compiling the same source files.
119 HOST_CFLAGS
=$(ALL_CFLAGS
)
120 HOST_LDFLAGS
=$(LDFLAGS
)
121 HOST_CPPFLAGS
=$(CPPFLAGS
)
123 # Choose the real default target.
126 # End of variables for you to override.
128 # Lists of files for various purposes.
133 $(srcdir)/atof-generic.c \
134 $(srcdir)/bignum-copy.c \
137 $(srcdir)/flonum-const.c \
138 $(srcdir)/flonum-copy.c \
139 $(srcdir)/flonum-mult.c \
142 $(srcdir)/hex-value.c \
143 $(srcdir)/input-file.c \
144 $(srcdir)/input-scrub.c \
145 $(srcdir)/messages.c \
146 $(srcdir)/output-file.c \
149 $(srcdir)/subsegs.c \
150 $(srcdir)/symbols.c \
151 $(srcdir)/version.c \
153 $(srcdir)/xmalloc.c \
156 # in an expedient order
162 SOURCES
= $(LINKED_SOURCES
) $(REAL_SOURCES
)
171 $(srcdir)/input-file.h \
175 $(srcdir)/struc-symbol.h \
176 $(srcdir)/subsegs.h \
177 $(srcdir)/symbols.h \
178 $(srcdir)/syscalls.h \
190 HEADERS
= $(LINKED_HEADERS
) $(REAL_HEADERS
)
221 #### host, target, and site specific Makefile frags come in here.
223 # Definition of `all' is here so that new rules inserted by sed
224 # do not specify the default target.
225 # The real definition is under `all.internal'.
234 # Now figure out from those variables how to compile and link.
236 # This is the variable actually used when we compile.
237 ALL_CFLAGS
= $(INTERNAL_CFLAGS
) $(CFLAGS
) $(HDEFINES
) $(TDEFINES
)
239 # Even if ALLOCA is set, don't use it if compiling with GCC.
240 USE_ALLOCA
= `if [ x"${CC}" = x"${OLDCC}" ] ; then echo ${ALLOCA}; else true; fi`
241 USE_HOST_ALLOCA
= `if [ x"${CC}" = x"${OLDCC}" ] ; then echo ${HOST_PREFIX}${ALLOCA}; else true; fi`
243 # Likewise, for use in the tools that must run on this machine
244 # even if we are cross-building GCC.
245 # We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
246 HOST_LIBDEPS
= $(HOST_PREFIX
)$(OBSTACK
) $(HOST_PREFIX
)$(ALLOCA
) $(HOST_PREFIX
)$(MALLOC
)
248 # How to link with both our special library facilities
249 # and the system's installed libraries.
251 LIBS
= $(LOCAL_LOADLIBES
) $(CLIB
) $(srcdir)/..
/libiberty
`if [ -d $(srcdir)/libiberty.$(target) ] ; then echo .$(target) ; fi`$(subdir
)/libiberty.a
253 # Likewise, for use in the tools that must run on this machine
254 # even if we are cross-building GCC.
255 HOST_LIBS
= $(HOST_PREFIX
)$(OBSTACK
) $(USE_HOST_ALLOCA
) $(HOST_PREFIX
)$(MALLOC
) $(CLIB
)
257 # Specify the directories to be searched for header files.
258 # Both . and srcdir are used, in that order,
259 # so that tm.h and config.h will be found in the compilation
260 # subdirectory rather than in the source directory.
261 INCLUDES
= -I.
-I
$(srcdir) -I
$(srcdir)/config
262 SUBDIR_INCLUDES
= -I..
-I..
/$(srcdir) -I..
/$(srcdir)/config
264 # Always use -I$(srcdir)/config when compiling.
266 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $<
268 # This tells GNU make version 3 not to export all the variables
269 # defined in this file into the environment.
272 # Files to be copied away after each stage in building.
274 STAGESTUFF
= *.o
as.new
276 # The files that "belong" in CONFIG_H are deliberately omitted
277 # because having them there would not be useful in actual practice.
278 # All they would do is cause complete recompilation every time
279 # one of the machine description files is edited.
280 # That may or may not be what one wants to do.
281 # If it is, rm *.o is an easy way to do it.
282 # CONFIG_H = config.h tm.h
285 as.new
: $(OBJS
) $(LIBDEPS
)
287 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
as.new
$(OBJS
) $(LIBS
) $(LOADLIBES
)
292 # This is what is made with the host's compiler if making a cross assembler.
293 native
: config.status
as
296 @echo You must configure gas. Look at the INSTALL file for details.
299 compilations
: ${OBJS}
301 # Compiling object files from source files.
303 app.o
: app.c
as.h host.h targ-env.h obj-format.h \
304 targ-cpu.h struc-symbol.h \
305 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
306 as.o
: as.c
as.h host.h targ-env.h obj-format.h \
307 targ-cpu.h struc-symbol.h \
308 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
309 atof-generic.o
: atof-generic.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
312 bignum-copy.o
: bignum-copy.c
as.h host.h \
313 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
316 cond.o
: cond.c
as.h host.h targ-env.h obj-format.h \
317 targ-cpu.h struc-symbol.h \
318 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
320 debug.o
: debug.c
as.h host.h targ-env.h obj-format.h \
321 targ-cpu.h struc-symbol.h \
322 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
324 expr.o
: expr.c
as.h host.h targ-env.h obj-format.h \
325 targ-cpu.h struc-symbol.h \
326 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
328 flonum-const.o
: flonum-const.c flonum.h bignum.h
329 flonum-copy.o
: flonum-copy.c
as.h host.h targ-env.h obj-format.h \
330 targ-cpu.h struc-symbol.h \
331 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
332 flonum-mult.o
: flonum-mult.c flonum.h bignum.h
333 frags.o
: frags.c
as.h host.h targ-env.h obj-format.h \
334 targ-cpu.h struc-symbol.h \
335 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
337 hash.o
: hash.c
as.h host.h targ-env.h obj-format.h \
338 targ-cpu.h struc-symbol.h \
339 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
340 hex-value.o
: hex-value.c
341 input-file.o
: input-file.c
as.h host.h \
342 targ-env.h obj-format.h targ-cpu.h \
343 struc-symbol.h write.h flonum.h bignum.h expr.h \
344 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
345 input-scrub.o
: input-scrub.c
/usr
/include/errno.h
/usr
/include/sys
/errno.h \
346 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 messages.o
: messages.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
353 obstack.o
: obstack.c
354 output-file.o
: output-file.c
as.h host.h targ-env.h obj-format.h \
355 targ-cpu.h struc-symbol.h \
356 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
358 read.o
: read.c
as.h host.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 \
363 subsegs.o
: subsegs.c
as.h host.h targ-env.h obj-format.h \
364 targ-cpu.h struc-symbol.h \
365 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
367 symbols.o
: symbols.c
as.h host.h targ-env.h obj-format.h \
368 targ-cpu.h struc-symbol.h \
369 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
371 version.o
: version.c
372 write.o
: write.c
as.h host.h targ-env.h obj-format.h \
373 targ-cpu.h struc-symbol.h \
374 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
375 subsegs.h output-file.h
376 xmalloc.o
: xmalloc.c
377 xrealloc.o
: xrealloc.c
378 atof-targ.o
: atof-targ.c
as.h host.h 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 \
382 obj-format.o
: obj-format.c
as.h host.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 \
386 targ-cpu.o
: targ-cpu.c targ-env.h obj-format.h \
387 targ-cpu.h struc-symbol.h \
388 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
389 symbols.h tc.h obj.h
$(TARG_CPU_DEPENDENTS
)
392 # Compile the libraries to be used by gen*.
393 # If we are not cross-building, gen* use the same .o's that cc1 will use,
394 # and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
395 # with the rules for rtl.o, alloca.o, etc.
396 $(HOST_PREFIX_1
)alloca.o
: alloca.c
397 rm -f
$(HOST_PREFIX
)alloca.c
398 cp
$(srcdir)/alloca.c
$(HOST_PREFIX
)alloca.c
399 $(HOST_CC
) -c
$(HOST_CFLAGS
) $(HOST_CPPFLAGS
) $(INCLUDES
) $(HOST_PREFIX
)alloca.c
401 $(HOST_PREFIX_1
)obstack.o
: obstack.c
402 rm -f
$(HOST_PREFIX
)obstack.c
403 cp
$(srcdir)/obstack.c
$(HOST_PREFIX
)obstack.c
404 $(HOST_CC
) -c
$(HOST_CFLAGS
) $(HOST_CPPFLAGS
) $(INCLUDES
) $(HOST_PREFIX
)obstack.c
406 $(HOST_PREFIX_1
)malloc.o
: malloc.c
407 rm -f
$(HOST_PREFIX
)malloc.c
408 cp
$(srcdir)/malloc.c
$(HOST_PREFIX
)malloc.c
409 $(HOST_CC
) -c
$(HOST_CFLAGS
) $(HOST_CPPFLAGS
) $(INCLUDES
) $(HOST_PREFIX
)malloc.c
411 # Remake the info files.
413 doc
: $(srcdir)/gas.
info
415 $(srcdir)/gas.
info: $(srcdir)/gas.texinfo
416 makeinfo `echo $(srcdir)/gas.texinfo | sed 's,^\./,,'`
419 # Deletion of files made during compilation.
420 # There are three levels of this: `clean', `cleanconfig' and `realclean'.
421 # `clean' deletes what you want to delete ordinarily to save space.
422 # This is most, but not all, of the files made by compilation.
423 # `cleanconfig' also deletes everything depending
424 # on the choice of config files.
425 # `realclean' also deletes everything that could be regenerated automatically.
429 # Delete the temporary source copies for cross compilation.
430 -rm -f
$(HOST_PREFIX_1
)alloca.c
$(HOST_PREFIX_1
)malloc.c
431 -rm -f
$(HOST_PREFIX_1
)obstack.c
432 # Delete the stamp files except stamp-gnulib2.
435 # Like clean but also delete the links made to configure gas.
437 -rm -f config.status Makefile host.h targ-env.h
438 -rm -f targ-cpu.h targ-cpu.c
439 -rm -f obj-format.h obj-format.c
442 # Get rid of every file that's generated from some other file (except INSTALL).
443 realclean: cleanconfig
444 -rm -f gas.aux gas.cps gas.fns gas.
info gas.kys gas.pgs gas.tps gas.vrs
446 -rm -f gas.
info* gas.?? gas.??s gas.log gas.toc gas.
*aux
449 # Entry points `install', `includes' and `uninstall'.
451 # Copy the files into directories where they will be run.
453 # $(INSTALL_PROGRAM) $(ALL) $(libsubdir)/as
454 cp
$(ALL
) $(bindir)/as.new
455 mv
-f
$(bindir)/as.new
$(bindir)/as
457 # Create the installation directory.
461 -mkdir
$(libdir)/gcc
/$(target
)
462 -mkdir
$(libdir)/gcc
/$(target
)/$(version
)
464 # Install the compiler executables built during cross compilation.
465 install-cross
: native install-dir
466 -if
[ -f cc1
] ; then
$(INSTALL_PROGRAM
) cc1
$(libsubdir
)/cc1
; else true
; fi
467 -if
[ -f cc1plus
] ; then
$(INSTALL_PROGRAM
) cc1plus
$(libsubdir
)/cc1plus
; else true
; fi
468 $(INSTALL_PROGRAM
) cpp $(libsubdir
)/cpp
469 .
/gcc
-dumpspecs
> $(libsubdir
)/specs
470 $(INSTALL_PROGRAM
) gcc
$(bindir)/gcc
472 # Install the man pages.
473 install-man
: install-dir
$(srcdir)/gcc
.1 protoize
.1 unprotoize
.1
474 $(INSTALL_FILE
) $(srcdir)/gcc
.1 $(mandir)/gcc.
$(manext)
475 chmod a-x
$(mandir)/gcc.
$(manext)
476 $(INSTALL_FILE
) $(srcdir)/protoize
.1 $(mandir)/protoize.
$(manext)
477 chmod a-x
$(mandir)/protoize.
$(manext)
478 $(INSTALL_FILE
) $(srcdir)/unprotoize
.1 $(mandir)/unprotoize.
$(manext)
479 chmod a-x
$(mandir)/unprotoize.
$(manext)
481 # Cancel installation by deleting the installed files.
485 -rm -rf
$(mandir)/gas.
$(manext)
488 # These exist for maintenance purposes.
491 etags
$(REAL_SOURCES
) $(REAL_HEADERS
) README Makefile config
/*.
[hc
]
493 bootstrap
: $(ALL
) force
495 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= $(ALL
)
497 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= $(ALL
)
498 $(MAKE
) comparison against
=stage2
501 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= $(ALL
)
503 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= $(ALL
)
504 $(MAKE
) comparison against
=stage2
507 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= $(ALL
)
508 $(MAKE
) comparison against
=stage2
510 # Copy the object files from a particular stage into a subdirectory.
513 -mv
$(STAGESTUFF
) stage1
514 (cd stage1
; ln
as.new
as)
518 -mv
$(STAGESTUFF
) stage2
519 (cd stage2
; ln
as.new
as)
523 -mv
$(STAGESTUFF
) stage3
524 (cd stage3
; ln
as.new
as)
529 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
532 - (cd stage1
; rm as ; mv
-f
* ..
)
536 - (cd stage2
; rm as ; mv
-f
* ..
)
540 - (cd stage3
; rm as ; mv
-f
* ..
)
543 # Copy just the executable files from a particular stage into a subdirectory,
544 # and delete the object files. Use this if you're just verifying a version
545 # that is pretty sure to work, and you are short of disk space.
548 -mv cc1
cpp cccp gcc stage1
550 -cp gnulib stage1
&& $(RANLIB
) stage1
/gnulib
555 -mv cc1
cpp cccp gcc stage2
557 -cp gnulib stage2
&& $(RANLIB
) stage2
/gnulib
562 -mv cc1
cpp cccp gcc stage3
564 -cp gnulib stage3
&& $(RANLIB
) stage3
/gnulib
569 -mv cc1
cpp cccp gcc stage4
571 -cp gnulib stage4
&& $(RANLIB
) stage4
/gnulib
574 #In GNU Make, ignore whether `stage*' exists.
575 .PHONY
: stage1 stage2 stage3 stage4
clean realclean TAGS bootstrap
576 .PHONY
: risky-stage1 risky-stage2 risky-stage3 risky-stage4
580 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
581 $(SHELL
) .
/config.status