home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Mint / mntlib32.zoo / Makefile < prev    next >
Makefile  |  1993-06-17  |  3KB  |  187 lines

  1. #
  2. # Top level Makefile for MiNT-Gcc library
  3. #
  4.  
  5. # GCC configuration info...
  6.  
  7. # Leave the next line undefined for native compilation setup.
  8. #CROSSDIR := /net/acae127/home/bammi/atari/cross-gcc
  9.  
  10. # Define MINTFLAG if you want to use the "normal"
  11. # gcc libraries, too
  12. #MINTFLAG := -mint
  13.  
  14. ifdef MINTFLAG
  15. MINTOPT := -mint
  16. else
  17. MINTOPT :=
  18. endif
  19.  
  20. ifdef CROSSDIR
  21.  
  22. # Set up to do cross-compiling...
  23.  
  24. CROSSLIB := $(CROSSDIR)/lib
  25. CROSSBIN := $(CROSSDIR)/bin
  26.  
  27. AR    := $(CROSSBIN)/car
  28. AS     := cgcc $(MINTOPT)
  29. CC    := cgcc $(MINTOPT)
  30. C++    := cgcc $(MINTOPT)
  31. LIB     := $(CROSSLIB)
  32. VPATH   := ../co
  33. CP    := cp
  34.  
  35. else
  36.  
  37. # Set up to run native...
  38.  
  39. AR    := gcc-ar
  40. AS    := gcc $(MINTOPT)
  41. CC    := gcc $(MINTOPT)
  42. C++    := gcc $(MINTOPT)
  43. LIB    := c:\gnu\lib
  44. CP    := mv
  45.  
  46. endif
  47.  
  48. ifdef ENTROPY
  49. # This reflects my setup, your mileage may vary.
  50. ifndef CROSSDIR
  51. AR    := ar
  52. LIB    := /src/newlib
  53. else
  54. MINTFLAG := -mint
  55. MINTOPT := $(MINTFLAG)
  56. XPFLAGS :=  -nostdinc -I../minclude
  57. XFLAGS := $(XPFLAGS)
  58. endif
  59. endif
  60.  
  61. # Additional options for compiling C code
  62.  
  63. #XFLAGS := -I../co
  64.  
  65. # Dynamic selection of options for each target library...
  66.  
  67. ifneq (,$(findstring debug,$(TARGET)))
  68. OPTIM= -O -g -Wstrict-prototypes
  69. FRAME=
  70. DEBUG=
  71. g=g
  72. else
  73. OPTIM= -O2 -fstrength-reduce
  74. FRAME= -fomit-frame-pointer
  75. DEBUG= -DNDEBUG
  76. g=
  77. endif
  78.  
  79. ifneq (,$(findstring long-int,$(TARGET)))
  80. SHORT=
  81. DSHORT=
  82. ST=
  83. else
  84. SHORT= -mshort
  85. DSHORT= -DSHORTLIB
  86. ST=16
  87. endif
  88.  
  89. ifneq (,$(findstring 68020,$(TARGET)))
  90. CC := $(CC) -m68020
  91. endif
  92.  
  93. ifneq (,$(findstring baserel,$(TARGET)))
  94. CC := $(CC) -mbaserel
  95. b=b
  96. else
  97. b=
  98. endif
  99.  
  100. # common subset of options; no int size or omit-frame-pointer:
  101. COPTS= $(DEBUG) $(OPTIM) $(XFLAGS)
  102.  
  103. # Base options CC; includes int size but not omit-frame-pointer
  104. CFFLAGS = $(SHORT) $(COPTS)
  105.  
  106. # normal CFLAGS including int size and omit-frame-pointer
  107. CFLAGS= $(CFFLAGS) $(FRAME)
  108.  
  109. # cflags for stuff that needs to be compiled with 32 bit ints
  110. CLFLAGS= $(COPTS) $(FRAME) $(DSHORT)
  111.  
  112. # flags to $(CC) when it runs the assembler only
  113. ASFLAGS= -c
  114.  
  115. # flags to $(CC) when running preprocessor and assembler
  116. PPFLAGS= $(XPFLAGS) $(SHORT) -P -c
  117.  
  118. # library targets
  119. ifdef MINTFLAG
  120.  
  121. CLIB= $bmint$g$(ST).olb
  122. CLIB020=$bmint$g$(ST)020.olb
  123. IIOLIB= $bmiio$g$(ST).olb
  124. CRT0=$bmcrt0.o
  125. GCRT0=$bmgcrt0.o
  126.  
  127. else
  128.  
  129. CLIB= $bgnu$g$(ST).olb
  130. CLIB020=$bgnu$g$(ST)020.olb
  131. IIOLIB= $biio$g$(ST).olb
  132. CRT0=$bcrt0.o
  133. GCRT0=$bgcrt0.o
  134.  
  135. endif
  136.  
  137. STARTO= $(CRT0) $(GCRT0)
  138.  
  139. # the stuff to make
  140. ALL= $(CLIB) $(IIOLIB) $(STARTO)
  141. ALL020 = $(CLIB020) $(STARTO)
  142.  
  143. top: lshort llong lbshort lblong
  144. #all: lshort llong lbshort lblong lgshort lglong
  145.  
  146. lshort:
  147.     $(MAKE) clean
  148.     $(MAKE) install
  149.  
  150. llong:
  151.     $(MAKE) clean
  152.     $(MAKE) install TARGET=long-int
  153.  
  154. lgshort:
  155.     $(MAKE) clean
  156.     $(MAKE) install TARGET=debug
  157.  
  158. lglong:
  159.     $(MAKE) clean
  160.     $(MAKE) install TARGET="long-int debug"
  161.  
  162. l020short:
  163.     $(MAKE) clean
  164.     $(MAKE) install020 TARGET=68020
  165.  
  166. l020long:
  167.     $(MAKE) clean
  168.     $(MAKE) install020 TARGET="68020 long-int"
  169.  
  170. lbshort:
  171.     $(MAKE) clean
  172.     $(MAKE) install TARGET="baserel"
  173.  
  174. lblong:
  175.     $(MAKE) clean
  176.     $(MAKE) install TARGET="long-int baserel"
  177.  
  178. realclean:
  179.     rm -f *.o *.olb *~ *#
  180.     rm -f core report nohup.out
  181.  
  182. distclean: realclean
  183.  
  184. # Get the rules to build everything...
  185.  
  186. include mincl
  187.