home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Mint / mntlib25.zoo / makefile < prev    next >
Makefile  |  1992-10-09  |  3KB  |  172 lines

  1. #
  2. # Top level Makefile for TOS-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. # Additional options for compiling C code
  49.  
  50. #XFLAGS := -I../co
  51.  
  52. # Dynamic selection of options for each target library...
  53.  
  54. ifneq (,$(findstring debug,$(TARGET)))
  55. OPTIM= -O -g -Wstrict-prototypes
  56. FRAME=
  57. DEBUG=
  58. g=g
  59. else
  60. OPTIM= -O2 -fstrength-reduce
  61. FRAME= -fomit-frame-pointer
  62. DEBUG= -DNDEBUG
  63. g=
  64. endif
  65.  
  66. ifneq (,$(findstring long-int,$(TARGET)))
  67. SHORT=
  68. DSHORT=
  69. ST=
  70. else
  71. SHORT= -mshort
  72. DSHORT= -DSHORTLIB
  73. ST=16
  74. endif
  75.  
  76. ifneq (,$(findstring 68020,$(TARGET)))
  77. CC := $(CC) -m68020
  78. endif
  79.  
  80. ifneq (,$(findstring baserel,$(TARGET)))
  81. CC := $(CC) -mbaserel
  82. b=b
  83. else
  84. b=
  85. endif
  86.  
  87. # common subset of options; no int size or omit-frame-pointer:
  88. COPTS= $(DEBUG) $(OPTIM) $(XFLAGS)
  89.  
  90. # Base options CC; includes int size but not omit-frame-pointer
  91. CFFLAGS = $(SHORT) $(COPTS)
  92.  
  93. # normal CFLAGS including int size and omit-frame-pointer
  94. CFLAGS= $(CFFLAGS) $(FRAME)
  95.  
  96. # cflags for stuff that needs to be compiled with 32 bit ints
  97. CLFLAGS= $(COPTS) $(FRAME) $(DSHORT)
  98.  
  99. # flags to $(CC) when it runs the assembler only
  100. ASFLAGS= -c
  101.  
  102. # flags to $(CC) when running preprocessor and assembler
  103. PPFLAGS= $(SHORT) -P -c
  104.  
  105. # library targets
  106. ifdef MINTFLAG
  107.  
  108. CLIB= $bmint$g$(ST).olb
  109. CLIB020=$bmint$g$(ST)020.olb
  110. IIOLIB= $bmiio$g$(ST).olb
  111. CRT0=$bmcrt0.o
  112. GCRT0=$bmgcrt0.o
  113.  
  114. else
  115.  
  116. CLIB= $bgnu$g$(ST).olb
  117. CLIB020=$bgnu$g$(ST)020.olb
  118. IIOLIB= $biio$g$(ST).olb
  119. CRT0=$bcrt0.o
  120. GCRT0=$bgcrt0.o
  121.  
  122. endif
  123.  
  124. STARTO= $(CRT0) $(GCRT0)
  125.  
  126. # the stuff to make
  127. ALL= $(CLIB) $(IIOLIB) $(STARTO)
  128. ALL020 = $(CLIB020) $(STARTO)
  129.  
  130. #all: lshort llong lgshort lglong
  131. top: lshort llong
  132.  
  133. lshort:
  134.     $(MAKE) clean
  135.     $(MAKE) install
  136.  
  137. llong:
  138.     $(MAKE) clean
  139.     $(MAKE) install TARGET=long-int
  140.  
  141. lgshort:
  142.     $(MAKE) clean
  143.     $(MAKE) install TARGET=debug
  144.  
  145. lglong:
  146.     $(MAKE) clean
  147.     $(MAKE) install TARGET="long-int debug"
  148.  
  149. l020short:
  150.     $(MAKE) clean
  151.     $(MAKE) install020 TARGET=68020
  152.  
  153. l020long:
  154.     $(MAKE) clean
  155.     $(MAKE) install020 TARGET="68020 long-int"
  156.  
  157. lbshort:
  158.     $(MAKE) clean
  159.     $(MAKE) install TARGET="baserel"
  160.  
  161. lblong:
  162.     $(MAKE) clean
  163.     $(MAKE) install TARGET="long-int baserel"
  164.  
  165. realclean:
  166.     rm -f *.o *.olb
  167.     rm -f core report
  168.  
  169. # Get the rules to build everything...
  170.  
  171. include mincl
  172.