home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / gnu / gcc-2.3.3-src.lha / GNU / src / amiga / gcc-2.3.3 / config / t-amigados < prev    next >
Text File  |  1994-02-06  |  7KB  |  181 lines

  1. # Makefile fragment for amigados target.
  2.  
  3. # We generate two additional things:
  4. #
  5. # libb/libgcc.a
  6. #    A base relative version of libgcc.a which is used when compiling and
  7. #    linking with the '-resident' option.
  8. #
  9. # xgccv
  10. #    A forking gcc instead of one calling ssytem(). This makes it less
  11. #    system conformant (can't ^C it when started from make), while
  12. #    providing increased functionality (-pipe option).
  13.  
  14. # Use the vfork'ing version of gcc by default, so that the -pipe option can
  15. # get tested.  To use the regular version just do "make XGCC=gcc".
  16.  
  17. XGCC = xgccv -pipe
  18. GCC_FOR_TARGET = ./$(XGCC) -B./
  19.  
  20. # Build residentable versions of the gcc executables by default.  Use
  21. # "make RESIDENT=" to build non-residentable versions.
  22.  
  23. RESIDENT = -resident
  24.  
  25. # The standard additional target flags for the compiler.
  26.  
  27. T_CFLAGS = $(RESIDENT)
  28.  
  29. # Allow the user to override the default target optimizations with gcc, or
  30. # if the target compiler is not gcc and doesn't understand -O<N>.
  31.  
  32. T_OPTIMISE = -O2
  33.  
  34. # Each compilation environment (Manx, Dice, GCC, SAS/C, etc) provides its
  35. # own equivalent of the UNIX /usr/include tree.  For gcc, the standard
  36. # headers are in /gnu/include and system specific headers are in
  37. # /gnu/os-include.  Use these paths for fixincludes.
  38.  
  39. SYSTEM_HEADER_DIR = /gnu/include
  40. OTHER_FIXINCLUDES_DIRS = /gnu/os-include
  41.  
  42. # We don't need a libgcc1, it's all in ixemul.library
  43.  
  44. LIBGCC1 = libgcc1.null
  45.  
  46. # Flags to use when compiling the normal version of libgcc.a.
  47. # Don't compile with debugging, as long as there is no debugger.
  48. # Explicitly leave out the -resident compilation flag and don't use T_CFLAGS.
  49.  
  50. LIBGCC2_CFLAGS = $(T_OPTIMIZE) $(INTERNAL_CFLAGS) $(X_CFLAGS) $(CFLAGS) \
  51.           $(CROSS_GCC_CFLAGS)
  52.  
  53. # Flags to use when compiling the base relative version of libgcc.a.
  54. # Don't compile with debugging, as long as there is no debugger.
  55. # Explicitly force -resident in the compilation flags and don't use T_CFLAGS.
  56.  
  57. LIBBGCC2_CFLAGS = $(T_OPTIMIZE) $(INTERNAL_CFLAGS) $(X_CFLAGS) $(CFLAGS) \
  58.           $(CROSS_GCC_CFLAGS) -resident
  59.  
  60. # Build the base relative library.
  61. # It is later copied into /gnu/lib/gcc-lib/amigados/<version>/libb/libgcc.a,
  62. # whereas libgcc.a is copied into /gnu/lib/gcc-lib/amigados/<version>/libgcc.a.
  63. # It doesn't work very well to define one of the EXTRA_* macros to contain
  64. # libb/libgcc.a, particularly for doing "make stageN" or "make install".
  65.  
  66. GCC_PARTS=$(GCC_PASSES) libgcc.a libb/libgcc.a $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS)
  67.  
  68. INSTALL_EXTRA_PARTS = install-libbgcc install-gccv
  69.  
  70. # This includes the knowledge that target amigados doesn't need libgcc1.a
  71.  
  72. libb/libgcc.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(LIB2FUNCS_EXTRA) \
  73.    longlong.h gbl-ctors.h config.status
  74. # Actually build it in tmplibbgcc.a, then rename at end,
  75. # so that libb/libgcc.a itself remains nonexistent if compilation is aborted.
  76.     -rm -f tmplibbgcc.a
  77. # -e causes any failing command to make this rule fail.
  78. # -e doesn't work in certain shells, so we test $$? as well.
  79.     set -e; \
  80.     for name in $(LIB2FUNCS); \
  81.     do \
  82.       echo $${name}; \
  83.       $(GCC_FOR_TARGET) $(LIBBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
  84.           $(srcdir)/libgcc2.c -o $${name}.o; \
  85.       if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  86.       $(AR) $(AR_FLAGS) tmplibbgcc.a $${name}.o; \
  87.       rm -f $${name}.o; \
  88.     done
  89. # Some shells crash when a loop has no items.
  90. # So make sure there is always at least one--`..'.
  91. # Then ignore it.
  92. # We don't use -e here because there are if statements
  93. # that should not make the command give up when the if condition is false.
  94. # Instead, we test for failure after each command where it matters.
  95.     -for file in .. $(LIB2FUNCS_EXTRA); \
  96.     do \
  97.       if [ x$${file} != x.. ]; then \
  98.         name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
  99.         echo $${name}; \
  100.         if [ $${name}.asm = $${file} ]; then \
  101.           cp $${file} $${name}.s; file=$${name}.s; \
  102.           if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  103.         else true; fi; \
  104.         $(GCC_FOR_TARGET) $(LIBBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
  105.         if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  106.         $(AR) $(AR_FLAGS) tmplibbgcc.a $${name}.o; \
  107.         rm -f $${name}.[so]; \
  108.       else true; \
  109.       fi; \
  110.     done
  111.     -if $(RANLIB_TEST) ; then $(RANLIB) tmplibbgcc.a; else true; fi
  112.     -if [ -d libb ] ; then true ; else mkdir libb ; fi
  113.     mv tmplibbgcc.a libb/libgcc.a
  114.  
  115. install-libbgcc: libb/libgcc.a install-dir
  116.     -if [ -d $(libsubdir)/libb ] ; then true ; else mkdir $(libsubdir)/libb ; fi
  117.     -if [ -f libb/libgcc.a ] ; then \
  118.       rm -f $(libsubdir)/libb/libgcc.a; \
  119.       $(INSTALL_DATA) libb/libgcc.a $(libsubdir)/libb/libgcc.a; \
  120.       if $(RANLIB_TEST) ; then \
  121.         (cd $(libsubdir)/libb; $(RANLIB) libgcc.a); else true; fi; \
  122.       chmod a-x $(libsubdir)/libb/libgcc.a; \
  123.     else true; fi
  124.     
  125.  
  126. # The default gcc (xgcc) is built without -DAMIGADOS_FORK_GCC. This gcc (xgccv)
  127. # is built with AMIGADOS_FORK_GCC defined, so that it can use '-pipe'.  We
  128. # don't want to define EXTRA_PASSES to xgccv because that will cause xgccv
  129. # to be installed in $(libsubdir), so instead we use the default GCC_PASSES
  130. # and add xgccv to it.
  131.  
  132. GCC_PASSES = xgcc xgccv cc1 cpp $(EXTRA_PASSES)
  133.  
  134. xgccv: xgccv.o version.o $(LIBDEPS)
  135.     $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o xgccv xgccv.o version.o $(LIBS)
  136.  
  137. xgccv.o: gcc.c $(CONFIG_H) gvarargs.h obstack.h
  138.     $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
  139.   -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
  140.   -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
  141.   -DDEFAULT_TARGET_MACHINE=\"$(target)\" \
  142.   -DTOOLDIR=\"$(tooldir)/\" \
  143.   -DAMIGADOS_FORK_GCC \
  144.   -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'` -o xgccv.o
  145.  
  146. install-gccv: xgccv
  147.     rm -f $(bindir)/gccv
  148.     $(INSTALL_PROGRAM) xgccv $(bindir)/gccv
  149.  
  150. # When making one of the stage<N> dirs, we need to make a libb subdir for
  151. # it, and copy libbgcc.a there as libgcc.a.
  152.  
  153. EXTRA_STAGE1_TARGETS = stage1-libb
  154. EXTRA_STAGE2_TARGETS = stage2-libb
  155. EXTRA_STAGE3_TARGETS = stage3-libb
  156. EXTRA_STAGE4_TARGETS = stage4-libb
  157.  
  158. stage1-libb:
  159.     -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
  160.     -if [ -d stage1/libb ] ; then true ; else mkdir stage1/libb ; fi
  161.     -cp libb/libgcc.a stage1/libb/libgcc.a
  162.     -if $(RANLIB_TEST) ; then $(RANLIB) stage1/libb/libgcc.a; else true; fi
  163.  
  164. stage2-libb:
  165.     -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
  166.     -if [ -d stage2/libb ] ; then true ; else mkdir stage2/libb ; fi
  167.     -cp libb/libgcc.a stage2/libb/libgcc.a
  168.     -if $(RANLIB_TEST) ; then $(RANLIB) stage2/libb/libgcc.a; else true; fi
  169.  
  170. stage3-libb:
  171.     -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
  172.     -if [ -d stage3/libb ] ; then true ; else mkdir stage3/libb ; fi
  173.     -cp libb/libgcc.a stage3/libb/libgcc.a
  174.     -if $(RANLIB_TEST) ; then $(RANLIB) stage3/libb/libgcc.a; else true; fi
  175.  
  176. stage4-libb:
  177.     -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
  178.     -if [ -d stage4/libb ] ; then true ; else mkdir stage4/libb ; fi
  179.     -cp libb/libgcc.a stage4/libb/libgcc.a
  180.     -if $(RANLIB_TEST) ; then $(RANLIB) stage4/libb/libgcc.a; else true; fi
  181.