Makefile.fpc 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. #
  2. # Makefile.fpc for Free Pascal Linux RTL
  3. #
  4. [package]
  5. main=rtl
  6. [target]
  7. loaders=prt0 dllprt0 cprt0 gprt0 $(CRT21)
  8. units=$(SYSTEMUNIT) unixtype ctypes baseunix strings systhrds objpas macpas syscall unixutil \
  9. heaptrc lineinfo \
  10. $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) \
  11. crt printer ggigraph \
  12. sysutils typinfo math matrix varutils \
  13. charset ucomplex getopts \
  14. errors sockets gpm ipc serial terminfo dl dynlibs \
  15. video mouse keyboard variants types dateutils sysconst \
  16. cthreads classes strutils rtlconst dos objects
  17. rsts=math varutils typinfo variants systhrds sysconst rtlconst
  18. [require]
  19. nortl=y
  20. [clean]
  21. units=syslinux linux
  22. [install]
  23. fpcpackage=y
  24. [default]
  25. fpcdir=../..
  26. target=linux
  27. [compiler]
  28. includedir=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
  29. sourcedir=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
  30. targetdir=.
  31. [lib]
  32. libname=libfprtl.so
  33. libversion=1.0
  34. libunits=$(SYSTEMUNIT) objpas strings \
  35. unix ports \
  36. dos crt objects printer \
  37. sysutils typinfo math \
  38. cpu mmx getopts heaptrc \
  39. errors sockets ipc dl dynlibs varutils
  40. [prerules]
  41. RTL=..
  42. INC=$(RTL)/inc
  43. PROCINC=$(RTL)/$(CPU_TARGET)
  44. UNIXINC=$(RTL)/unix
  45. ifeq ($(CPU_TARGET),i386)
  46. CRT21=cprt21 gprt21
  47. CPU_UNITS=x86 ports cpu mmx graph
  48. else
  49. CPU_UNITS=
  50. endif
  51. UNITPREFIX=rtl
  52. ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
  53. SYSTEMUNIT=system
  54. LINUXUNIT1=
  55. ifeq ($(CPU_TARGET),i386)
  56. CPU_UNITS+=oldlinux
  57. endif
  58. LINUXUNIT2=linux
  59. else
  60. SYSTEMUNIT=syslinux
  61. LINUXUNIT1=linux
  62. LINUXUNIT2=
  63. override FPCOPT+=-dUNIX
  64. endif
  65. # Use new feature from 1.0.5 version
  66. # that generates release PPU files
  67. # which will not be recompiled
  68. ifdef RELEASE
  69. override FPCOPT+=-Ur
  70. endif
  71. # Paths
  72. OBJPASDIR=$(RTL)/objpas
  73. GRAPHDIR=$(INC)/graph
  74. # Use new graph unit ?
  75. # NEWGRAPH=YES
  76. # Use LibGGI ?
  77. # Use
  78. #
  79. ifndef USELIBGGI
  80. USELIBGGI=NO
  81. endif
  82. [rules]
  83. # Get the $(SYSTEMUNIT) independent include file names.
  84. # This will set the following variables :
  85. # SYSINCNAMES
  86. include $(INC)/makefile.inc
  87. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  88. # Get the processor dependent include file names.
  89. # This will set the following variables :
  90. # CPUINCNAMES
  91. include $(PROCINC)/makefile.cpu
  92. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  93. # Put $(SYSTEMUNIT) unit dependencies together.
  94. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  95. #
  96. # Loaders
  97. #
  98. prt0$(OEXT) : $(CPU_TARGET)/prt0.as
  99. $(AS) -o $(UNITTARGETDIRPREFIX)prt0$(OEXT) $(CPU_TARGET)/prt0.as
  100. dllprt0$(OEXT) : $(CPU_TARGET)/dllprt0.as
  101. $(AS) -o $(UNITTARGETDIRPREFIX)dllprt0$(OEXT) $(CPU_TARGET)/dllprt0.as
  102. gprt0$(OEXT) : $(CPU_TARGET)/gprt0.as
  103. $(AS) -o $(UNITTARGETDIRPREFIX)gprt0$(OEXT) $(CPU_TARGET)/gprt0.as
  104. cprt0$(OEXT) : $(CPU_TARGET)/cprt0.as
  105. $(AS) -o $(UNITTARGETDIRPREFIX)cprt0$(OEXT) $(CPU_TARGET)/cprt0.as
  106. cprt21$(OEXT) : $(CPU_TARGET)/cprt21.as
  107. $(AS) -o $(UNITTARGETDIRPREFIX)cprt21$(OEXT) $(CPU_TARGET)/cprt21.as
  108. gprt21$(OEXT) : $(CPU_TARGET)/gprt21.as
  109. $(AS) -o $(UNITTARGETDIRPREFIX)gprt21$(OEXT) $(CPU_TARGET)/gprt21.as
  110. #
  111. # $(SYSTEMUNIT) Units ($(SYSTEMUNIT), Objpas, Strings)
  112. #
  113. $(SYSTEMUNIT)$(PPUEXT) : $(SYSTEMUNIT).pp sysconst.inc systypes.inc $(SYSDEPS)
  114. $(COMPILER) -Us -Sg $(SYSTEMUNIT).pp
  115. systhrds$(PPUEXT): systhrds.pp $(INC)/threadh.inc $(SYSTEMUNIT)$(PPUEXT) objpas$(PPUEXT)
  116. objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
  117. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
  118. dateutils$(PPUEXT): $(OBJPASDIR)/dateutils.pp $(SYSTEMUNIT)$(PPUEXT)
  119. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/dateutils.pp
  120. strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
  121. $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
  122. $(SYSTEMUNIT)$(PPUEXT)
  123. #
  124. # $(SYSTEMUNIT) Dependent Units
  125. #
  126. unix$(PPUEXT) : unix.pp strings$(PPUEXT) baseunix$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
  127. sysc11.inc systypes.inc sysconst.inc $(UNIXINC)/timezone.inc $(SYSTEMUNIT)$(PPUEXT) \
  128. unixsysc.inc
  129. unixtype$(PPUEXT) : $(UNIXINC)/unixtype.pp ptypes.inc ctypes.inc $(SYSTEMUNIT)$(PPUEXT)
  130. baseunix$(PPUEXT) : errno.inc bunxtype.inc ptypes.inc ctypes.inc \
  131. signal.inc $(UNIXINC)/bunxh.inc bunxmain.inc ostypes.inc \
  132. bunxfunc.inc $(CPU_TARGET)/syscallh.inc $(CPU_TARGET)/sysnr.inc \
  133. ostypes.inc ossysch.inc bunxmacr.inc $(UNIXINC)/gensigset.inc \
  134. $(UNIXINC)/genfuncs.inc $(SYSTEMUNIT)$(PPUEXT)
  135. ports$(PPUEXT) : ports.pp unix$(PPUEXT) objpas$(PPUEXT)
  136. dl$(PPUEXT) : $(UNIXINC)/dl.pp $(SYSTEMUNIT)$(PPUEXT)
  137. dynlibs$(PPUEXT) : $(INC)/dynlibs.pp $(UNIXINC)/dynlibs.inc dl$(PPUEXT) objpas$(PPUEXT)
  138. #
  139. # TP7 Compatible RTL Units
  140. #
  141. dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
  142. unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  143. crt$(PPUEXT) : crt.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  144. objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT)
  145. printer$(PPUEXT) : printer.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  146. #
  147. # Graph
  148. #
  149. include $(GRAPHDIR)/makefile.inc
  150. GRAPHINCDEPS=$(addprefix $(GRAPHDIR)/,$(GRAPHINCNAMES))
  151. graph$(PPUEXT) : graph.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
  152. $(GRAPHINCDEPS) $(UNIXINC)/graph16.inc
  153. $(COMPILER) -I$(GRAPHDIR) $(UNIXINC)/graph.pp
  154. ggigraph$(PPUEXT) : $(UNIXINC)/ggigraph.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
  155. $(GRAPHINCDEPS)
  156. $(COMPILER) -I$(GRAPHDIR) $(UNIXINC)/ggigraph.pp
  157. #
  158. # Delphi Compatible Units
  159. #
  160. sysutils$(PPUEXT) : $(UNIXINC)/sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
  161. objpas$(PPUEXT) unix$(PPUEXT) errors$(PPUEXT) sysconst$(PPUEXT)
  162. $(COMPILER) -Fi$(OBJPASDIR)/sysutils $(UNIXINC)/sysutils.pp
  163. classes$(PPUEXT) : classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
  164. sysutils$(PPUEXT) typinfo$(PPUEXT) rtlconst$(PPUEXT)
  165. $(COMPILER) -Fi$(OBJPASDIR)/classes classes.pp
  166. typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  167. $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp
  168. math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  169. $(COMPILER) $(OBJPASDIR)/math.pp
  170. gettext$(PPUEXT): $(OBJPASDIR)/gettext.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  171. $(COMPILER) $(OBJPASDIR)/gettext.pp
  172. varutils$(PPUEXT) : $(OBJPASDIR)/cvarutil.inc $(OBJPASDIR)/varutils.inc \
  173. $(OBJPASDIR)/varutilh.inc varutils.pp sysutils$(PPUEXT)
  174. $(COMPILER) -I$(OBJPASDIR) $(UNIXINC)/varutils.pp
  175. variants$(PPUEXT) : $(INC)/variants.pp varutils$(PPUEXT)
  176. types$(PPUEXT) : $(OBJPASDIR)/types.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  177. $(COMPILER) $(OBJPASDIR)/types.pp
  178. sysconst$(PPUEXT) : $(OBJPASDIR)/sysconst.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  179. $(COMPILER) $(OBJPASDIR)/sysconst.pp
  180. rtlconst$(PPUEXT) : $(OBJPASDIR)/rtlconst.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  181. $(COMPILER) $(OBJPASDIR)/rtlconst.pp
  182. strutils$(PPUEXT) : $(OBJPASDIR)/strutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
  183. sysutils$(PPUEXT)
  184. $(COMPILER) $(OBJPASDIR)/strutils.pp
  185. #
  186. # Mac Pascal Model
  187. #
  188. macpas$(PPUEXT) : $(INC)/macpas.pp $(SYSTEMUNIT)$(PPUEXT)
  189. $(COMPILER) $(INC)/macpas.pp $(REDIR)
  190. #
  191. # Other $(SYSTEMUNIT)-independent RTL Units
  192. #
  193. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT)
  194. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  195. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
  196. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
  197. $(COMPILER) -Sg $(INC)/heaptrc.pp
  198. lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT)
  199. charset$(PPUEXT) : $(INC)/charset.pp $(SYSTEMUNIT)$(PPUEXT)
  200. ucomplex$(PPUEXT) : $(INC)/ucomplex.pp math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  201. #
  202. # Other $(SYSTEMUNIT)-dependent RTL Units
  203. #
  204. sockets$(PPUEXT) : sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
  205. unixsock.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  206. errors$(PPUEXT) : errors.pp strings$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  207. ipc$(PPUEXT) : ipc.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  208. terminfo$(PPUEXT) : terminfo.pp unix$(PPUEXT)
  209. callspec$(PPUEXT) : $(INC)/callspec.pp $(SYSTEMUNIT)$(PPUEXT)
  210. cmem$(PPUEXT) : $(INC)/cmem.pp $(SYSTEMUNIT)$(PPUEXT)
  211. cthreads$(PPUEXT) : $(UNIXINC)/cthreads.pp $(SYSTEMUNIT)$(PPUEXT) systhrds$(PPUEXT)
  212. gpm$(PPUEXT): $(UNIXINC)/gpm.pp unix$(PPUEXT) baseunix$(PPUEXT) sockets$(PPUEXT)
  213. $(COMPILER) -Sg $(UNIXINC)/gpm.pp
  214. ctypes$(PPUEXT) : $(INC)/ctypes.pp $(SYSTEMUNIT)$(PPUEXT)