home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / binutils-2.7-src.tgz / tar.out / fsf / binutils / gas / Makefile.in < prev    next >
Makefile  |  1996-09-28  |  16KB  |  554 lines

  1. # Makefile for GNU Assembler
  2. #   Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 1996
  3. #   Free Software Foundation, Inc.
  4.  
  5. # This file is part of GNU GAS.
  6.  
  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)
  10. # any later version.
  11.  
  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.
  16.  
  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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20.  
  21. # The targets for external use include:
  22. # all, doc, proto, install, uninstall, includes, TAGS,
  23. # clean, mostlyclean, distclean, realclean, stage1, stage2, stage3, stage4.
  24.  
  25. # Variables that exist for you to override.
  26. # See below for how to change them for certain systems.
  27.  
  28. VPATH = @srcdir@
  29. srcdir = @srcdir@
  30. srcroot = $(srcdir)/..
  31.  
  32. target_alias = @target_alias@
  33. prefix = @prefix@
  34.  
  35. program_transform_name = @program_transform_name@
  36. exec_prefix = @exec_prefix@
  37. bindir = @bindir@
  38. libdir = @libdir@
  39. tooldir = $(exec_prefix)/$(target_alias)
  40.  
  41. datadir = @datadir@
  42. mandir = @mandir@
  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 = @infodir@
  53. includedir = @includedir@
  54.  
  55. VERSION=2.7
  56.  
  57. SHELL = /bin/sh
  58.  
  59. INSTALL = $${srcroot}/install.sh -c
  60. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  61. INSTALL_DATA = @INSTALL_DATA@
  62. INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
  63. INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1
  64.  
  65. DISTSTUFF= make-gas.com m68k-parse.c
  66.  
  67. AR = ar
  68. AR_FLAGS = qv
  69. BISON = bison -y
  70. BISONFLAGS =
  71. MAKEINFO = makeinfo
  72. TEXI2DVI = texi2dvi
  73. RANLIB = ranlib
  74. CC = @CC@
  75. CFLAGS = @CFLAGS@
  76. SYMLINK = cp
  77. HARDLINK = cp
  78. LDFLAGS =
  79. HLDFLAGS = @HLDFLAGS@
  80. RPATH_ENVVAR = @RPATH_ENVVAR@
  81.  
  82. MAKEOVERRIDES=
  83.  
  84. EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
  85.           echo $${rootme}/../expect/expect ; \
  86.           else echo expect ; fi`
  87.  
  88. FLAGS_TO_PASS = \
  89.     "prefix=$(prefix)" \
  90.     "exec_prefix=$(exec_prefix)" \
  91.     "tooldir=$(tooldir)" \
  92.     "AR=$(AR)" \
  93.     "AR_FLAGS=$(AR_FLAGS)" \
  94.     "CC=$(CC)" \
  95.     "CFLAGS=$(CFLAGS)" \
  96.     "RANLIB=$(RANLIB)" \
  97.     "LOADLIBES=$(LOADLIBES)" \
  98.     "LDFLAGS=$(LDFLAGS)" \
  99.     "BISON=$(BISON)" \
  100.     "LEX=$(LEX)" \
  101.     "MAKEINFO=$(MAKEINFO)" \
  102.     "INSTALL=$(INSTALL)" \
  103.     "INSTALL_DATA=$(INSTALL_DATA)" \
  104.     "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
  105.  
  106. RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
  107.         echo $${srcdir}/../dejagnu/runtest ; else echo runtest; \
  108.        fi`
  109. RUNTESTFLAGS=
  110.  
  111. # Lists of files for various purposes.
  112.  
  113. REAL_SOURCES = \
  114.     $(srcdir)/app.c \
  115.     $(srcdir)/as.c \
  116.     $(srcdir)/atof-generic.c \
  117.     $(srcdir)/bignum-copy.c \
  118.     $(srcdir)/cond.c \
  119.     $(srcdir)/expr.c \
  120.     $(srcdir)/flonum-konst.c \
  121.     $(srcdir)/flonum-copy.c \
  122.     $(srcdir)/flonum-mult.c \
  123.     $(srcdir)/frags.c \
  124.     $(srcdir)/hash.c \
  125.     $(srcdir)/input-file.c \
  126.     $(srcdir)/input-scrub.c \
  127.     $(srcdir)/literal.c \
  128.     $(srcdir)/messages.c \
  129.     $(srcdir)/output-file.c \
  130.     $(srcdir)/read.c \
  131.     $(srcdir)/subsegs.c \
  132.     $(srcdir)/symbols.c \
  133.     $(srcdir)/write.c \
  134.     $(srcdir)/listing.c \
  135.     $(srcdir)/ecoff.c \
  136.     $(srcdir)/stabs.c
  137.  
  138. # in an expedient order
  139. LINKED_SOURCES = \
  140.     targ-cpu.c \
  141.     obj-format.c \
  142.     atof-targ.c
  143.  
  144. SOURCES = $(LINKED_SOURCES) $(REAL_SOURCES)
  145.  
  146. REAL_HEADERS = \
  147.     $(srcdir)/as.h \
  148.     $(srcdir)/bignum.h \
  149.     $(srcdir)/expr.h \
  150.     $(srcdir)/flonum.h \
  151.     $(srcdir)/frags.h \
  152.     $(srcdir)/hash.h \
  153.     $(srcdir)/input-file.h \
  154.     $(srcdir)/listing.h \
  155.     $(srcdir)/tc.h \
  156.     $(srcdir)/obj.h \
  157.     $(srcdir)/read.h \
  158.     $(srcdir)/struc-symbol.h \
  159.     $(srcdir)/subsegs.h \
  160.     $(srcdir)/symbols.h \
  161.     $(srcdir)/write.h \
  162.     $(srcdir)/ecoff.h
  163.  
  164. LINKED_HEADERS = \
  165.     targ-env.h \
  166.     targ-cpu.h \
  167.     obj-format.h \
  168.     atof-targ.h
  169.  
  170. HEADERS = $(LINKED_HEADERS) $(REAL_HEADERS)
  171.  
  172. TE_OBJS=
  173.  
  174. # @target_frag@
  175.  
  176. OBJS = \
  177.     targ-cpu.o \
  178.     obj-format.o \
  179.     atof-targ.o \
  180.     app.o \
  181.     as.o \
  182.     atof-generic.o \
  183.     bignum-copy.o \
  184.     cond.o \
  185.     expr.o \
  186.     flonum-konst.o \
  187.     flonum-copy.o \
  188.     flonum-mult.o \
  189.     frags.o \
  190.     hash.o \
  191.     input-file.o \
  192.     input-scrub.o \
  193.     literal.o \
  194.     messages.o \
  195.     output-file.o \
  196.     read.o \
  197.     subsegs.o \
  198.     symbols.o \
  199.     write.o \
  200.     listing.o \
  201.     ecoff.o \
  202.     stabs.o \
  203.     sb.o \
  204.     macro.o \
  205.     @extra_objects@ \
  206.     $(TE_OBJS)
  207.  
  208. GASPOBJS = \
  209.     gasp.o \
  210.     macro.o \
  211.     sb.o \
  212.     hash.o
  213.  
  214. all: .gdbinit as.new gasp.new
  215.     @srcroot=`cd $(srcroot); pwd`; export srcroot; \
  216.     (cd doc ; $(MAKE) $(FLAGS_TO_PASS) all)
  217.  
  218. dvi info install-info clean-info:
  219.     @srcroot=`cd $(srcroot); pwd`; export srcroot; \
  220.     (cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@)
  221.  
  222. make-gas.com: stamp-mk.com
  223. stamp-mk.com: vmsconf.sh Makefile
  224.     sh $(srcdir)/vmsconf.sh $(OBJS) > new-make.com
  225.     $(srcdir)/../move-if-change new-make.com $(srcdir)/make-gas.com
  226.     touch stamp-mk.com
  227.  
  228. # Now figure out from those variables how to compile and link.
  229.  
  230. # This is the variable actually used when we compile.
  231. ALL_CFLAGS = $(INTERNAL_CFLAGS) $(CROSS) $(CFLAGS) $(HDEFINES) $(TDEFINES)
  232.  
  233. # How to link with both our special library facilities
  234. # and the system's installed libraries.
  235.  
  236. LIBDEPS = @OPCODES_DEP@ @BFDDEP@ $(LOCAL_LOADLIBES) ../libiberty/libiberty.a
  237. LIBS = @OPCODES_LIB@ @BFDLIB@ $(LOCAL_LOADLIBES) ../libiberty/libiberty.a
  238.  
  239. # Specify the directories to be searched for header files.
  240. # Both . and srcdir are used, in that order,
  241. # so that tm.h and config.h will be found in the compilation
  242. # subdirectory rather than in the source directory.
  243. INCLUDES = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(srcdir)/../include -I$(srcdir)/.. -I$(srcdir)/../bfd
  244.  
  245. # Always use -I$(srcdir)/config when compiling.
  246. .c.o:
  247.     $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $<
  248.  
  249. # This tells GNU make version 3 not to export all the variables
  250. # defined in this file into the environment.
  251. .NOEXPORT:
  252.  
  253. # Files to be copied away after each stage in building.
  254. STAGESTUFF = *.o as.new gasp.new
  255.  
  256. $(OBJS): @ALL_OBJ_DEPS@
  257.  
  258. as.new: $(OBJS) $(LIBDEPS)
  259.     $(CC) $(HLDFLAGS) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES)
  260.  
  261. $(OBJS): config.h as.h targ-env.h obj-format.h targ-cpu.h flonum.h expr.h \
  262.     struc-symbol.h write.h frags.h hash.h read.h symbols.h tc.h obj.h \
  263.     listing.h bignum.h
  264.  
  265. gasp.new: $(GASPOBJS) ../libiberty/libiberty.a
  266.     $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o gasp.new $(GASPOBJS) ../libiberty/libiberty.a $(LOADLIBES)
  267.  
  268. installcheck:
  269.     @echo No installcheck target is available yet for the GNU assembler.
  270.  
  271. site.exp: ./Makefile
  272.     @echo "Making a new config file..."
  273.     -@rm -f ./tmp?
  274.     @touch site.exp
  275.     -@mv site.exp site.bak
  276.     @echo "## these variables are automatically generated by make ##" > ./tmp0
  277.     @echo "# Do not edit here. If you wish to override these values," >> ./tmp0
  278.     @echo "# do so in the last section."            >> ./tmp0
  279.     @echo set host_os @host_os@                >> ./tmp0
  280.     @echo set host_alias @host_alias@            >> ./tmp0
  281.     @echo set host_cpu @host_cpu@                >> ./tmp0
  282.     @echo set host_vendor @host_vendor@            >> ./tmp0
  283.     @echo set target_os @target_os@                >> ./tmp0
  284.     @echo set target_alias @target_alias@            >> ./tmp0
  285.     @echo set target_cpu @target_cpu@            >> ./tmp0
  286.     @echo set target_vendor @target_vendor@            >> ./tmp0
  287.     @echo set host_triplet @host@                >> ./tmp0
  288.     @echo set target_triplet @target@            >> ./tmp0
  289.     @echo set target_canonical @target@            >> ./tmp0
  290.     @echo set srcdir ${srcdir}/testsuite            >> ./tmp0
  291.     @echo set exec_prefix ${exec_prefix}            >> ./tmp0
  292.     @echo set objdir `pwd`                    >> ./tmp0
  293.     @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
  294.     @sed -e '1,/^## All variables above are.*##/ d' < site.bak >> ./tmp0
  295.     @mv -f ./tmp0 site.exp
  296.  
  297. check:  site.exp
  298.     if [ -d testsuite ]; then \
  299.       true; \
  300.     else \
  301.       mkdir testsuite; \
  302.     fi
  303.     rm -f testsuite/site.exp
  304.     cp site.exp testsuite/site.exp
  305.     rootme=`pwd`; export rootme; \
  306.     srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
  307.     $(RPATH_ENVVAR)=$$rootme/../bfd:$$rootme/../opcodes:$$$(RPATH_ENVVAR); \
  308.     export $(RPATH_ENVVAR); \
  309.     cd testsuite; \
  310.     EXPECT=${EXPECT} ; export EXPECT ; \
  311.     if [ -f $${rootme}/../expect/expect ] ; then  \
  312.        TCL_LIBRARY=$${srcdir}/../tcl/library ; \
  313.        export TCL_LIBRARY ; fi ; \
  314.     $(RUNTEST) --tool gas --srcdir $${srcdir}/testsuite $(RUNTESTFLAGS)
  315.  
  316. config.status: configure
  317.     $(SHELL) config.status --recheck
  318.  
  319. config.h: config-stamp ; @true
  320. config-stamp: Makefile conf
  321.     -rm -f config.new config-stamp
  322.     echo '/* config.h.  Generated automatically by make.  */' > config.new
  323.     echo '#ifndef GAS_VERSION'            >> config.new
  324.     echo '#define GAS_VERSION "$(VERSION)"'        >> config.new
  325.     echo ''                        >> config.new
  326.     cat conf                    >> config.new
  327.     echo '#endif /* GAS_VERSION */'            >> config.new
  328.     $(srcdir)/../move-if-change config.new config.h
  329.     touch config-stamp
  330.  
  331. # Compiling object files from source files.
  332.  
  333. TARG_CPU_DEP_a29k    =
  334. TARG_CPU_DEP_alpha   = $(srcdir)/../include/opcode/alpha.h subsegs.h
  335. TARG_CPU_DEP_arm     = subsegs.h
  336. TARG_CPU_DEP_generic =
  337. TARG_CPU_DEP_h8300   = $(srcdir)/../include/opcode/h8300.h
  338. TARG_CPU_DEP_h8500   = $(srcdir)/../opcodes/h8500-opc.h subsegs.h
  339. TARG_CPU_DEP_hppa    = subsegs.h
  340. TARG_CPU_DEP_i386    = $(srcdir)/../include/opcode/i386.h subsegs.h
  341. TARG_CPU_DEP_i860    =
  342. TARG_CPU_DEP_i960    =
  343. TARG_CPU_DEP_m68k    = $(srcdir)/../include/opcode/m68k.h \
  344.             $(srcdir)/config/m68k-parse.h subsegs.h
  345. TARG_CPU_DEP_m88k    = $(srcdir)/config/m88k-opcode.h subsegs.h
  346. TARG_CPU_DEP_mips    = $(srcdir)/../include/opcode/mips.h subsegs.h
  347. TARG_CPU_DEP_ns32k   =
  348. TARG_CPU_DEP_ppc     = subsegs.h
  349. TARG_CPU_DEP_sh      = $(srcdir)/../opcodes/sh-opc.h subsegs.h
  350. TARG_CPU_DEP_sparc   = subsegs.h
  351. TARG_CPU_DEP_tahoe   =
  352. TARG_CPU_DEP_vax     =
  353. TARG_CPU_DEP_w65     = $(srcdir)/../opcodes/w65-opc.h subsegs.h
  354. TARG_CPU_DEP_z8k     = $(srcdir)/../opcodes/z8k-opc.h
  355.  
  356. gasp.o : gasp.c sb.h macro.h config.h
  357. sb.o : sb.c sb.h config.h
  358. macro.o : macro.c macro.h sb.h hash.h config.h
  359. app.o : app.c write.h
  360. as.o : as.c output-file.h write.h subsegs.h sb.h macro.h
  361. atof-generic.o : atof-generic.c
  362. bignum-copy.o : bignum-copy.c
  363. cond.o : cond.c
  364. debug.o : debug.c subsegs.h
  365. expr.o : expr.c
  366. flonum-konst.o : flonum-konst.c
  367. flonum-copy.o : flonum-copy.c
  368. flonum-mult.o : flonum-mult.c
  369. frags.o : frags.c subsegs.h
  370. hash.o : hash.c
  371. input-file.o : input-file.c input-file.h
  372. input-scrub.o : input-scrub.c input-file.h sb.h
  373. listing.o : listing.c input-file.h subsegs.h
  374. literal.o : literal.c subsegs.h
  375. messages.o : messages.c
  376. output-file.o : output-file.c output-file.h
  377. read.o : read.c sb.h macro.h
  378. subsegs.o : subsegs.c subsegs.h
  379. symbols.o : symbols.c subsegs.h
  380. write.o : write.c subsegs.h output-file.h
  381. ecoff.o : ecoff.c ecoff.h \
  382.     $(srcdir)/../include/coff/internal.h $(srcdir)/../include/coff/sym.h \
  383.     $(srcdir)/../include/coff/ecoff.h \
  384.     $(srcdir)/../include/coff/symconst.h \
  385.     $(srcdir)/../include/aout/stab_gnu.h
  386. stabs.o : stabs.c subsegs.h $(srcdir)/../include/aout/stab_gnu.h
  387. atof-targ.o : atof-targ.c
  388. obj-format.o : obj-format.c
  389. targ-cpu.o : targ-cpu.c $(TARG_CPU_DEP_@target_cpu_type@)
  390.  
  391. obj-elf.o : $(srcdir)/config/obj-elf.c
  392.     $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-elf.c
  393. obj-ecoff.o : $(srcdir)/config/obj-ecoff.c
  394.     $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-ecoff.c
  395.  
  396. e-mipself.o : $(srcdir)/config/e-mipself.c
  397.     $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-mipself.c
  398. e-mipsecoff.o : $(srcdir)/config/e-mipsecoff.c
  399.     $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-mipsecoff.c
  400.  
  401. # The m68k operand parser.
  402.  
  403. m68k-parse.c: $(srcdir)/config/m68k-parse.y
  404.     $(BISON) $(BISONFLAGS) $(srcdir)/config/m68k-parse.y
  405.     mv -f y.tab.c m68k-parse.c
  406. m68k-parse.o: m68k-parse.c $(srcdir)/config/m68k-parse.h
  407.  
  408. # Remake the info files.
  409.  
  410. doc: $(srcdir)/as.info
  411.  
  412. $(srcdir)/as.info: $(srcdir)/doc/as.texinfo
  413.     @(cd doc; $(MAKE) $(FLAGS_TO_PASS) as.info; mv as.info $srcdir)    
  414.  
  415. diststuff: $(DISTSTUFF) info
  416.  
  417. clean-here:
  418.     -rm -f $(STAGESTUFF) core stamp-mk.com
  419.     -rm -f testsuite/*.o testsuite/*.out \
  420.         testsuite/gas.log testsuite/gas.sum testsuite/site.exp
  421.  
  422. clean mostlyclean: clean-here
  423.     @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@
  424.  
  425. # Like clean but also delete the links made to configure gas.
  426.  
  427. DISTCLEAN_HERE = config.status Makefile targ-env.h targ-cpu.h \
  428.     targ-cpu.c obj-format.h obj-format.c atof-targ.c TAGS \
  429.     config-stamp config.h conf config.log config.cache .gdbinit \
  430.     testsuite/Makefile testsuite/config.status
  431.  
  432. distclean: clean-here
  433.     @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@
  434.     -rm -f $(DISTCLEAN_HERE)
  435.  
  436. maintainer-clean realclean: clean-here
  437.     @echo "This command is intended for maintainers to use;"
  438.     @echo "it deletes files that may require special tools to rebuild."
  439.     @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@
  440.     -rm -rf $(DISTCLEAN_HERE) $(DISTSTUFF)
  441.  
  442. # Entry points `install', `includes' and `uninstall'.
  443.  
  444. # Copy the files into directories where they will be run.
  445. install:
  446.     srcroot=`cd $(srcroot); pwd`; export srcroot; \
  447.     $(INSTALL_XFORM) as.new $(bindir)/as; \
  448.     $(INSTALL_XFORM) as.new $(bindir)/gas; \
  449.     $(INSTALL_XFORM1) $(srcdir)/doc/as.1 $(man1dir)/as.1; \
  450.     test -d $(tooldir) || mkdir $(tooldir); \
  451.     test -d $(tooldir)/bin || mkdir $(tooldir)/bin; \
  452.     n=`echo as | sed '$(program_transform_name)'`; \
  453.     rm -f $(tooldir)/bin/as; \
  454.     $(HARDLINK) $(bindir)/$$n $(tooldir)/bin/as >/dev/null 2>/dev/null \
  455.      || $(INSTALL_PROGRAM) as.new $(tooldir)/bin/as
  456.     srcroot=`cd $(srcroot); pwd`; export srcroot; \
  457.     $(INSTALL_XFORM) gasp.new $(bindir)/gasp
  458.  
  459. # Cancel installation by deleting the installed files.
  460. uninstall:
  461.     -n=`t='$(program_transform_name)'; echo as | sed $$t`; \
  462.     rm -f $(bindir)/$$n; \
  463.     rm -f $(mandir)/$$n.1
  464.     -n=`t='$(program_transform_name)'; echo gasp | sed $$t`; \
  465.     rm -f $(bindir)/$$n; \
  466.  
  467. # These exist for maintenance purposes.
  468.  
  469. tags TAGS: force
  470.     etags $(REAL_HEADERS) $(REAL_SOURCES) $(srcdir)/config/*.[hc] $(srcdir)/README $(srcdir)/Makefile.in
  471.  
  472. bootstrap: as.new force
  473.     $(MAKE) stage1
  474.     rm -f stage && $(SYMLINK) stage1 stage
  475.     $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
  476.     $(MAKE) stage2
  477.     rm -f stage && $(SYMLINK) stage2 stage
  478.     $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
  479.     $(MAKE) comparison against=stage2
  480.  
  481. bootstrap2: force
  482.     rm -f stage && $(SYMLINK) stage1 stage
  483.     $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
  484.     $(MAKE) stage2
  485.     rm -f stage && $(SYMLINK) stage2 stage
  486.     $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
  487.     $(MAKE) comparison against=stage2
  488.  
  489. bootstrap3: force
  490.     rm -f stage && $(SYMLINK) stage2 stage
  491.     $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
  492.     $(MAKE) comparison against=stage2
  493.  
  494. # Copy the object files from a particular stage into a subdirectory.
  495. stage1: force
  496.     -mkdir stage1
  497.     -mv $(STAGESTUFF) stage1
  498.     if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; $(SYMLINK) as.new as) ; fi
  499.  
  500. stage2: force
  501.     -mkdir stage2
  502.     -mv $(STAGESTUFF) stage2
  503.     if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; $(SYMLINK) as.new as) ; fi
  504.  
  505. stage3: force
  506.     -mkdir stage3
  507.     -mv $(STAGESTUFF) stage3
  508.     if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; $(SYMLINK) as.new as) ; fi
  509.  
  510. against=stage2
  511.  
  512. # This rule is derived from corresponding code in the Makefile.in for gcc.
  513. # The "tail +16c" is to bypass headers which may include timestamps or
  514. # temporary assembly file names.
  515. comparison: force
  516.     x=0 ; \
  517.     for file in *.o ; do \
  518.       tail +16c ./$$file > tmp-foo1; \
  519.       if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
  520.         if cmp tmp-foo1 tmp-foo2 ; then \
  521.           true ; \
  522.         else \
  523.           echo $$file differs ; \
  524.           x=1 ; \
  525.         fi ; \
  526.       else true; fi ; \
  527.     done ; \
  528.     exit $$x
  529.     -rm -f tmp-foo*
  530.  
  531. de-stage1: force
  532.     - (cd stage1 ; rm -f as ; mv -f * ..)
  533.     - rmdir stage1
  534.  
  535. de-stage2: force
  536.     - (cd stage2 ; rm -f as ; mv -f * ..)
  537.     - rmdir stage2
  538.  
  539. de-stage3: force
  540.     - (cd stage3 ; rm -f as ; mv -f * ..)
  541.     - rmdir stage3
  542.  
  543. #In GNU Make, ignore whether `stage*' exists.
  544. .PHONY: stage1 stage2 stage3 stage4 clean mostlyclean realclean distclean
  545. .PHONY: TAGS bootstrap
  546.  
  547. force:
  548.  
  549. Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) \
  550.         $(srcdir)/configure.in config.status conf.in
  551.     $(SHELL) ./config.status
  552. .gdbinit: $(srcdir)/gdbinit.in config.status
  553.     $(SHELL) ./config.status
  554.