home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / gcc / ixemulsrc.lha / ixemul / library / Makefile.in < prev    next >
Makefile  |  1996-12-15  |  5KB  |  199 lines

  1. #### Start of system configuration section. ####
  2.  
  3. srcdir =    @srcdir@
  4.  
  5. ifeq ($(srcdir),.)
  6. srcdir = ../..
  7. endif
  8.  
  9. VPATH :=    $(srcdir)
  10.  
  11. # Common prefix for machine-independent installed files.
  12. prefix =    @prefix@
  13.  
  14. # Common prefix for machine-dependent installed files.
  15. exec_prefix =    @exec_prefix@
  16.  
  17. bindir =    $(exec_prefix)/bin
  18. libdir =    $(exec_prefix)/Sys/libs
  19.  
  20. INSTALL =    @INSTALL@
  21. INSTALL_DATA =    @INSTALL_DATA@
  22.  
  23. CC =        @CC@
  24.  
  25. CFLAGS =    @CFLAGS@
  26. LDFLAGS =    @LDFLAGS@
  27.  
  28. RANLIB =    @RANLIB@
  29. AR =        ar
  30.  
  31. #### End system configuration section ####
  32.  
  33. # I *love* GNU make!
  34. define catenate
  35. /bin/echo -n creating $@...
  36. /bin/echo "$(^:%=#include \"%\"\n)" >$@
  37. /bin/echo done
  38. endef
  39.  
  40. FLAVOR_CFLAGS =    -m$(CPU) -m$(FPU)
  41. STD_CFLAGS = $(CFLAGS) $(OTHER_CFLAGS) -g $(INCS)
  42. ALL_CFLAGS = $(FLAVOR_CFLAGS) $(STD_CFLAGS)
  43.  
  44. INCS =        -I$(srcdir) -I$(srcdir)/../library -I$(srcdir)/../include -I.
  45. LIB =        library.a
  46.  
  47. # Strip the executable (-s), don't look for standard libraries (-nostdlib)
  48. # don't link in crt0.o (-nostartfiles) and tell the linker explicitly to
  49. # load the module from the library that defines the symbol "___load_seg"
  50. # (-Xlinker -u -Xlinker ___load_seg).
  51.  
  52. LINKFLAGS =    -nostdlib -nostartfiles -Xlinker -u -Xlinker ___load_seg
  53.  
  54. .c.o:
  55.         $(CC) $(ALL_CFLAGS) -c $< -o $@
  56.  
  57. all:        ixemul.library ixemul.trace ixemul.debug
  58.  
  59. SRC_A4 =    ix_startup.c _main.c ix_exec_entry.c exit.c ix_resident.c machdep.c
  60. SRC_MISC =    parse_version.c create_header.c tracecntl.c
  61. SRC_OTHERS =    hwck.c trap.c ix_timer.c debugstub.c
  62. OBJ_OTHERS =    $(SRC_OTHERS:.c=.o)
  63.  
  64. SRC =           $(filter-out $(SRC_A4) $(SRC_OTHERS) $(SRC_MISC),$(notdir $(wildcard $(srcdir)/*.c)))
  65.  
  66. SRC___ =    $(filter _%,$(SRC))
  67. SRC_AH =    $(filter a% b% c% d% e% f% g% h%,$(SRC))
  68. SRC_II =    $(filter i%,$(SRC))
  69. SRC_JO =    $(filter j% k% l% m% n% o%,$(SRC))
  70. SRC_PR =    $(filter p% q% r%,$(SRC))
  71. SRC_SS =    $(filter s%,$(SRC))
  72. SRC_TZ =    $(filter t% u% v% w% x% y% z%,$(SRC))
  73.  
  74. # These are object files which explicitly get linked into the ixemul.library
  75. # file, in the order specified
  76.  
  77. OBJ_N =        start.o tracecntl.o
  78.  
  79. OBJ_T =        start.ot tracecntl.ot
  80.  
  81. IXLIBS =    $(LIB) \
  82.         ../../../string/$(CPU)/$(FPU)/libstring.a \
  83.         ../../../general/$(CPU)/$(FPU)/libgeneral.a \
  84.         ../../../stdlib/$(CPU)/$(FPU)/libstdlib.a \
  85.         ../../../stdio/$(CPU)/$(FPU)/libstdio.a
  86.  
  87. LIBS =        -lgcc -lamiga
  88.  
  89.  
  90. $(LIB) :    a4.o __.o ah.o ii.o jo.o pr.o ss.o tz.o $(OBJ_OTHERS)
  91.         rm -f $@
  92.         $(AR) rv $@ $^
  93.         $(RANLIB) $@
  94.  
  95. ixemul.library:    $(OBJ_N) $(IXLIBS)
  96.         $(CC) -s $(LINKFLAGS) $(OBJ_N) $(IXLIBS) $(LIBS) -o $@
  97.  
  98. ixemul.trace:    $(OBJ_T) $(IXLIBS)
  99.         $(CC) -s $(LINKFLAGS) $(OBJ_T) $(IXLIBS) $(LIBS) -o $@
  100.  
  101. ixemul.debug:    $(OBJ_N) $(IXLIBS)
  102.         $(CC) -g $(LINKFLAGS) $(OBJ_N) $(IXLIBS) $(LIBS) -o $@
  103.  
  104. clean:
  105.         rm -rf 680?0
  106.  
  107. clobber:    clean
  108.         rm -f Makefile
  109.  
  110. a4.o:        a4.c
  111.         $(CC) $(ALL_CFLAGS) -ffixed-a4 -c $< -o $@
  112.  
  113. a4.c:        $(SRC_A4)
  114.         @$(catenate)
  115.  
  116. __.c:        $(SRC___)
  117.         @$(catenate)
  118.  
  119. ah.c:        $(SRC_AH)
  120.         @$(catenate)
  121.  
  122. ii.c:        $(SRC_II)
  123.         @$(catenate)
  124.  
  125. jo.c:        $(SRC_JO)
  126.         @$(catenate)
  127.  
  128. pr.c:        $(SRC_PR)
  129.         @$(catenate)
  130.  
  131. ss.c:        $(SRC_SS)
  132.         @$(catenate)
  133.  
  134. tz.c:        $(SRC_TZ)
  135.         @$(catenate)
  136.  
  137. start.o:    start.s version.h $(srcdir)/../include/sys/syscall.def ix_internals.h
  138.         cp $< x.c
  139.         $(CC) $(STD_CFLAGS) -traditional -E x.c -o x.s
  140.         $(CC) $(STD_CFLAGS) -c -m68000 -msoft-float x.s -o $@
  141.         rm -f x.s x.c
  142.  
  143. start.ot:    start.s version.h $(srcdir)/../include/sys/syscall.def ix_internals.h
  144.         cp $< x.c
  145.         $(CC) $(STD_CFLAGS) -DTRACE_LIBRARY -traditional -E x.c -o x.s
  146.         $(CC) $(STD_CFLAGS) -c -m68000 -msoft-float x.s -o $@
  147.         rm -f x.c x.s
  148.  
  149. # ix_open.c (and thus ii.o) depends on the size of struct user
  150.  
  151. ii.o:        $(srcdir)/../include/user.h
  152.  
  153. # Force -m68020 & -m68881 so the assembler won't bitch about fpu
  154. # instructions.  This means we have to leave out FLAVOR_CFLAGS.
  155.  
  156. trap.o:        trap.s ix_internals.h
  157.         cp $< x.c
  158.         $(CC) $(STD_CFLAGS) -traditional -E x.c -o x.s
  159.         $(CC) $(STD_CFLAGS) -c -m68020 -m68881 x.s -o $@
  160.         rm -f x.s x.c
  161.  
  162. # Never omit the frame pointer.
  163.  
  164. ix_timer.o:    ix_timer.c
  165.         $(CC) $(ALL_CFLAGS) -fno-omit-frame-pointer -c $< -o $@
  166.  
  167. # hwck.c checks for defines like mc68020 and __HAVE_68881__, but it also
  168. # must be compiled with -m68000. So we first preprocess the source with
  169. # standard flavor flags, and then we compile the resulting source with
  170. # -m68000. This ensures that when we try to use a 68020 ixemul.library on
  171. # a 68000 Amiga, we get a correct message and not a crash.
  172.  
  173. hwck.o:        hwck.c
  174.         $(CC) $(ALL_CFLAGS) -E $< -o x.c
  175.         $(CC) $(STD_CFLAGS) -m68000 -msoft-float -c x.c -o $@
  176.         rm -f x.c
  177.  
  178. debugstub.o:    debugstub.c
  179.  
  180. tracecntl.o:    tracecntl.c
  181.         $(CC) $(ALL_CFLAGS) -ffixed-a4 -c $< -o $@
  182.  
  183. tracecntl.ot:    tracecntl.c
  184.         $(CC) $(ALL_CFLAGS) -DTRACE_LIBRARY -ffixed-a4 -c $< -o $@
  185.  
  186. ix_internals.h:    create_header
  187.         ./create_header >$@
  188.  
  189. create_header:    create_header.o
  190.  
  191. create_header.o:    create_header.c $(srcdir)/../include/user.h ixemul.h
  192.  
  193. ii.o tz.o:    version.h
  194.  
  195. parse_version:    parse_version.o
  196.  
  197. version.h:    parse_version ../version.in
  198.         ./parse_version $(srcdir) >$@
  199.