Makefile 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. #
  2. # $Id$
  3. # This file is part of the Free Pascal run time library.
  4. # Copyright (c) 1999-2000 by Michael van Canneyt
  5. #
  6. # Makefile for the Free Pascal Amiga Runtime Library
  7. #
  8. # See the file COPYING.FPC, included in this distribution,
  9. # for details about the copyright.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15. #####################################################################
  16. # Start of configurable section.
  17. # Please note that all these must be set in the main makefile, and
  18. # should be set there.
  19. # Don't remove the indef statements. They serve to avoid conflicts
  20. # with the main makefile.
  21. #####################################################################
  22. # What is the Operating System ?
  23. ifndef OS_SOURCE
  24. OS_SOURCE=linux
  25. endif
  26. # What is the target operating system ?
  27. ifndef OS_TARGET
  28. OS_TARGET=amiga
  29. endif
  30. # use as68k if crosscompiling
  31. ifneq ($(OS_SOURCE),$(OS_TARGET))
  32. override OPT+= -AGAS
  33. endif
  34. # What is the target processor :
  35. ifndef CPU
  36. #CPU=i386
  37. CPU=m68k
  38. endif
  39. # What compiler to use ?
  40. ifndef PP
  41. PP=ppc68k
  42. endif
  43. # What options to pass to the compiler ?
  44. # You may want to specify a config file or error definitions file here.
  45. ifndef OPT
  46. OPT=
  47. endif
  48. # Use smartlinking ?
  49. ifndef SMARTLINK
  50. SMARTLINK=NO
  51. endif
  52. # Name of library ?
  53. # If this is set, all units will be put in the same library.
  54. # If it is empty (default), the units will be left in separate files.
  55. ifndef LIBNAME
  56. LIBNAME=
  57. #LIBNAME=fpc
  58. endif
  59. # Should the library be shared or static (only if LIBNAME is set).
  60. # Set this to 'shared' or 'static' to create a librrary
  61. # Setting this to shared will disable smart linking.
  62. ifndef LIBTYPE
  63. LIBTYPE=
  64. #LIBTYPE=static
  65. endif
  66. # Where is the PPUMOVE program ?
  67. ifndef PPUMOVE
  68. PPUMOVE=ppumove
  69. endif
  70. #####################################################################
  71. # End of configurable section.
  72. # Do not edit after this line.
  73. #####################################################################
  74. #####################################################################
  75. # System independent
  76. #####################################################################
  77. # Where are the include files
  78. RTL=..
  79. CFG=$(RTL)/cfg
  80. INC=$(RTL)/inc
  81. PROCINC=$(RTL)/$(CPU)
  82. OBJPASDIR=$(RTL)/objpas
  83. # Get some defaults for Programs and OSes.
  84. # This will set the following variables :
  85. # inlinux indos COPY REPLACE DEL INSTALL INSTALLEXE MKDIR
  86. # It will also set OPT for cross-compilation, and add required options.
  87. # also checks for config file.
  88. # it expects INC PROCINC to be set !!
  89. include $(CFG)/makefile.cfg
  90. # Get the system independent include file names.
  91. # This will set the following variables :
  92. # SYSINCNAMES
  93. include $(INC)/makefile.inc
  94. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  95. # Get the processor dependent include file names.
  96. # This will set the following variables :
  97. # CPUINCNAMES
  98. include $(PROCINC)/makefile.cpu
  99. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  100. # Put system unit dependencies together.
  101. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  102. #####################################################################
  103. # System dependent
  104. #####################################################################
  105. # Override extensions
  106. PPUEXT=.ppa
  107. ASMEXT=.asm
  108. # Define Linux Units
  109. SYSTEMPPU=sysamiga$(PPUEXT)
  110. # no compiling :
  111. # getopts : no argv !!
  112. # sysutils : problem with objpas unit ??
  113. OBJECTS=strings exec dos crt printer objects objpas heaptrc
  114. PRT=prt0
  115. LOADERAS=$(PRT).as
  116. # Define Loaders
  117. LOADERS=prt0
  118. # Add Prefix and Suffixes
  119. OBJLOADERS=$(addsuffix $(OEXT), $(LOADERS))
  120. PPUOBJECTS=$(addsuffix $(PPUEXT), $(OBJECTS))
  121. .PHONY : all install clean \
  122. libs libsclean \
  123. diffs diffclean \
  124. all : $(OBJLOADERS) $(PPUOBJECTS)
  125. install : all
  126. $(MKDIR) $(UNITINSTALLDIR)
  127. $(INSTALL) *$(PPUEXT) *$(OEXT) $(UNITINSTALLDIR)
  128. clean :
  129. -$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) *.PPS log
  130. #####################################################################
  131. # Files
  132. #####################################################################
  133. #
  134. # Loaders
  135. #
  136. prt0$(OEXT) : $(LOADERAS)
  137. -$(AS) $(LOADERAS) -o prt0$(OEXT)
  138. #gprt0$(OEXT) : $(GLOADERAS)
  139. # -$(AS) $(GLOADERAS) -o gprt0$(OEXT)
  140. #
  141. # Base Units (System, strings, os-dependent-base-unit)
  142. #
  143. $(SYSTEMPPU) : sysamiga.pas $(SYSLINUXDEPS) $(SYSDEPS)
  144. $(PP) $(OPT) -ui386 -dm68k -I$(INC) -I$(PROCINC) -Us -Sg sysamiga.pas $(REDIR)
  145. strings$(PPUEXT) : ../template/strings.pp $(SYSTEMPPU)
  146. $(COPY) ../template/strings.pp .
  147. $(PP) $(OPT) strings $(REDIR)
  148. $(DEL) strings.pp
  149. exec$(PPUEXT) : exec.pp exec.inc $(SYSTEMPPU)
  150. $(PP) $(OPT) exec $(REDIR)
  151. #
  152. # Delphi Object Model
  153. #
  154. objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(SYSTEMPPU)
  155. $(COPY) $(OBJPASDIR)/objpas.pp .
  156. $(PP) $(OPT) -I$(INC) objpas $(REDIR)
  157. $(DEL) objpas.pp
  158. sysutils$(PPUEXT) : $(OBJPASDIR)/sysutils.pp objpas$(PPUEXT) $(SYSTEMPPU)
  159. $(COPY) $(OBJPASDIR)/sysutils.pp .
  160. $(PP) $(OPT) -I$(INC) sysutils $(REDIR)
  161. $(DEL) sysutils.pp
  162. #
  163. # System Dependent Units
  164. #
  165. #
  166. # TP7 Compatible RTL Units
  167. #
  168. dos$(PPUEXT) : $(DOSDEPS) $(SYSTEMPPU)
  169. $(PP) $(OPT) -I$(INC) dos $(REDIR)
  170. crt$(PPUEXT) : crt.pp $(INC)/textrec.inc $(SYSTEMPPU)
  171. $(PP) $(OPT) -I$(INC) crt $(REDIR)
  172. printer$(PPUEXT) : printer.pp $(SYSTEMPPU)
  173. $(PP) $(OPT) printer $(REDIR)
  174. objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
  175. $(COPY) $(INC)/objects.pp .
  176. $(PP) $(OPT) -I$(INC) objects $(REDIR)
  177. $(DEL) objects.pp
  178. #
  179. # Other RTL Units
  180. #
  181. getopts$(PPUEXT) : $(INC)/getopts.pp strings$(PPUEXT) $(SYSTEMPPU)
  182. $(COPY) $(INC)/getopts.pp .
  183. $(PP) $(OPT) -I$(INC) getopts $(REDIR)
  184. $(DEL) getopts.pp
  185. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMPPU)
  186. $(COPY) $(INC)/heaptrc.pp .
  187. $(PP) $(OPT) heaptrc $(REDIR)
  188. $(DEL) heaptrc.pp
  189. #####################################################################
  190. # Libs
  191. #####################################################################
  192. staticlib:
  193. make clean
  194. make all SMARTLINK=YES LIBNAME=fpc LIBTYPE=static
  195. sharedlib:
  196. make clean
  197. make all
  198. $(PPUMOVE) -o fpc $(SHAREDLIBFILES)
  199. staticlibinstall: staticlib
  200. $(MKDIR) $(STATIC_LIBINSTALLDIR)
  201. $(MKDIR) $(STATIC_UNITINSTALLDIR)
  202. $(INSTALLEXE) libfpc$(STATICLIBEXT) $(STATIC_LIBINSTALLDIR)
  203. $(INSTALL) *$(PPUEXT) *$(OEXT) $(STATIC_UNITINSTALLDIR)
  204. sharedlibinstall: sharedlib
  205. $(MKDIR) $(SHARED_LIBINSTALLDIR)
  206. $(MKDIR) $(SHARED_UNITINSTALLDIR)
  207. $(INSTALLEXE) libfpc$(SHAREDLIBEXT) $(SHARED_LIBINSTALLDIR)
  208. $(INSTALL) *$(PPUEXT) *$(OEXT) $(SHARED_UNITINSTALLDIR)
  209. ldconfig
  210. libinstall: staticlibinstall sharedlibinstall
  211. libsclean : clean
  212. -$(DEL) *$(SMARTLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  213. #####################################################################
  214. # Default targets
  215. #####################################################################
  216. include $(CFG)/makefile.def
  217. #
  218. # $Log$
  219. # Revision 1.8 2000-01-07 16:41:28 daniel
  220. # * copyright 2000
  221. #
  222. # Revision 1.7 2000/01/07 16:32:21 daniel
  223. # * copyright 2000 added
  224. #
  225. # Revision 1.6 1998/10/22 16:43:54 pierre
  226. # + added some units
  227. #
  228. # Revision 1.5 1998/10/14 10:49:46 pierre
  229. # * added some include directory command lines necessary
  230. # * added some missing units
  231. # + now compiles completely with cross-compiler
  232. #
  233. # Revision 1.4 1998/10/13 16:31:14 pierre
  234. # + added -AGAS for crosscompilers
  235. #
  236. # Revision 1.3 1998/10/13 08:07:01 pierre
  237. # * uses AS variable (can be set to as68k when crosscompiling)
  238. # * correct command line for sysamiga.pas
  239. #
  240. # Revision 1.2 1998/10/02 09:25:58 peter
  241. # * fixed rtl path
  242. #
  243. # Revision 1.1 1998/09/10 14:15:47 peter
  244. # - renamed makefile to Makefile
  245. #
  246. #