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