Makefile.fpc 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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 baseunix strings systhrds objpas syscall unixutil \
  9. heaptrc lineinfo \
  10. $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) \
  11. dos crt objects printer ggigraph \
  12. sysutils typinfo math 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
  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. PRT0=prt0
  60. else
  61. SYSTEMUNIT=syslinux
  62. LINUXUNIT1=linux
  63. LINUXUNIT2=
  64. PRT0=prt0_10
  65. override FPCOPT+=-dUNIX
  66. endif
  67. # Use new feature from 1.0.5 version
  68. # that generates release PPU files
  69. # which will not be recompiled
  70. ifdef RELEASE
  71. override FPCOPT+=-Ur
  72. endif
  73. # Paths
  74. OBJPASDIR=$(RTL)/objpas
  75. GRAPHDIR=$(INC)/graph
  76. # Use new graph unit ?
  77. # NEWGRAPH=YES
  78. # Use LibGGI ?
  79. # Use
  80. #
  81. ifndef USELIBGGI
  82. USELIBGGI=NO
  83. endif
  84. [rules]
  85. # Get the $(SYSTEMUNIT) independent include file names.
  86. # This will set the following variables :
  87. # SYSINCNAMES
  88. include $(INC)/makefile.inc
  89. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  90. # Get the processor dependent include file names.
  91. # This will set the following variables :
  92. # CPUINCNAMES
  93. include $(PROCINC)/makefile.cpu
  94. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  95. # Put $(SYSTEMUNIT) unit dependencies together.
  96. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  97. #
  98. # Loaders
  99. #
  100. prt0$(OEXT) : $(CPU_TARGET)/$(PRT0).as
  101. $(AS) -o prt0$(OEXT) $(CPU_TARGET)/$(PRT0).as
  102. dllprt0$(OEXT) : $(CPU_TARGET)/dllprt0.as
  103. $(AS) -o dllprt0$(OEXT) $(CPU_TARGET)/dllprt0.as
  104. gprt0$(OEXT) : $(CPU_TARGET)/gprt0.as
  105. $(AS) -o gprt0$(OEXT) $(CPU_TARGET)/gprt0.as
  106. cprt0$(OEXT) : $(CPU_TARGET)/cprt0.as
  107. $(AS) -o cprt0$(OEXT) $(CPU_TARGET)/cprt0.as
  108. cprt21$(OEXT) : $(CPU_TARGET)/cprt21.as
  109. $(AS) -o cprt21$(OEXT) $(CPU_TARGET)/cprt21.as
  110. gprt21$(OEXT) : $(CPU_TARGET)/gprt21.as
  111. $(AS) -o gprt21$(OEXT) $(CPU_TARGET)/gprt21.as
  112. #
  113. # $(SYSTEMUNIT) Units ($(SYSTEMUNIT), Objpas, Strings)
  114. #
  115. $(SYSTEMUNIT)$(PPUEXT) : $(SYSTEMUNIT).pp sysconst.inc systypes.inc $(SYSDEPS)
  116. $(COMPILER) -Us -Sg $(SYSTEMUNIT).pp
  117. systhrds$(PPUEXT): systhrds.pp $(INC)/threadh.inc $(SYSTEMUNIT)$(PPUEXT) objpas$(PPUEXT)
  118. objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
  119. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
  120. dateutils$(PPUEXT): $(OBJPASDIR)/dateutils.pp $(SYSTEMUNIT)$(PPUEXT)
  121. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/dateutils.pp
  122. strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
  123. $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
  124. $(SYSTEMUNIT)$(PPUEXT)
  125. #
  126. # $(SYSTEMUNIT) Dependent Units
  127. #
  128. unix$(PPUEXT) : unix.pp strings$(PPUEXT) baseunix$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
  129. sysc11.inc systypes.inc sysconst.inc $(UNIXINC)/timezone.inc $(SYSTEMUNIT)$(PPUEXT) \
  130. unixsysc.inc
  131. unixtype$(PPUEXT) : $(UNIXINC)/unixtype.pp ptypes.inc ctypes.inc $(SYSTEMUNIT)$(PPUEXT)
  132. baseunix$(PPUEXT) : errno.inc bunxtype.inc ptypes.inc ctypes.inc \
  133. signal.inc $(UNIXINC)/bunxh.inc bunxmain.inc ostypes.inc \
  134. bunxfunc.inc $(CPU_TARGET)/syscallh.inc $(CPU_TARGET)/sysnr.inc \
  135. ostypes.inc ossysch.inc bunxmacr.inc $(UNIXINC)/gensigset.inc \
  136. $(UNIXINC)/genfuncs.inc $(SYSTEMUNIT)$(PPUEXT)
  137. ports$(PPUEXT) : ports.pp unix$(PPUEXT) objpas$(PPUEXT)
  138. dl$(PPUEXT) : $(UNIXINC)/dl.pp $(SYSTEMUNIT)$(PPUEXT)
  139. dynlibs$(PPUEXT) : $(INC)/dynlibs.pp $(UNIXINC)/dynlibs.inc dl$(PPUEXT) objpas$(PPUEXT)
  140. #
  141. # TP7 Compatible RTL Units
  142. #
  143. dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
  144. unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  145. crt$(PPUEXT) : crt.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  146. objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT)
  147. printer$(PPUEXT) : printer.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  148. #
  149. # Graph
  150. #
  151. include $(GRAPHDIR)/makefile.inc
  152. GRAPHINCDEPS=$(addprefix $(GRAPHDIR)/,$(GRAPHINCNAMES))
  153. graph$(PPUEXT) : graph.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
  154. $(GRAPHINCDEPS) $(UNIXINC)/graph16.inc
  155. $(COMPILER) -I$(GRAPHDIR) $(UNIXINC)/graph.pp
  156. ggigraph$(PPUEXT) : $(UNIXINC)/ggigraph.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
  157. $(GRAPHINCDEPS)
  158. $(COMPILER) -I$(GRAPHDIR) $(UNIXINC)/ggigraph.pp
  159. #
  160. # Delphi Compatible Units
  161. #
  162. sysutils$(PPUEXT) : $(UNIXINC)/sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
  163. objpas$(PPUEXT) unix$(PPUEXT) errors$(PPUEXT) sysconst$(PPUEXT)
  164. $(COMPILER) -Fi$(OBJPASDIR)/sysutils $(UNIXINC)/sysutils.pp
  165. classes$(PPUEXT) : classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
  166. sysutils$(PPUEXT) typinfo$(PPUEXT) rtlconst$(PPUEXT)
  167. $(COMPILER) -Fi$(OBJPASDIR)/classes classes.pp
  168. typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
  169. $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp
  170. math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  171. $(COMPILER) $(OBJPASDIR)/math.pp
  172. gettext$(PPUEXT): $(OBJPASDIR)/gettext.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  173. $(COMPILER) $(OBJPASDIR)/gettext.pp
  174. varutils$(PPUEXT) : $(OBJPASDIR)/cvarutil.inc $(OBJPASDIR)/varutils.inc \
  175. $(OBJPASDIR)/varutilh.inc varutils.pp sysutils$(PPUEXT)
  176. $(COMPILER) -I$(OBJPASDIR) $(UNIXINC)/varutils.pp
  177. variants$(PPUEXT) : $(INC)/variants.pp varutils$(PPUEXT)
  178. types$(PPUEXT) : $(OBJPASDIR)/types.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  179. $(COMPILER) $(OBJPASDIR)/types.pp
  180. sysconst$(PPUEXT) : $(OBJPASDIR)/sysconst.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  181. $(COMPILER) $(OBJPASDIR)/sysconst.pp
  182. rtlconst$(PPUEXT) : $(OBJPASDIR)/rtlconst.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  183. $(COMPILER) $(OBJPASDIR)/rtlconst.pp
  184. strutils$(PPUEXT) : $(OBJPASDIR)/strutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
  185. sysutils$(PPUEXT)
  186. $(COMPILER) $(OBJPASDIR)/strutils.pp
  187. #
  188. # Other $(SYSTEMUNIT)-independent RTL Units
  189. #
  190. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT)
  191. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  192. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
  193. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
  194. $(COMPILER) -Sg $(INC)/heaptrc.pp
  195. lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT)
  196. charset$(PPUEXT) : $(INC)/charset.pp $(SYSTEMUNIT)$(PPUEXT)
  197. ucomplex$(PPUEXT) : $(INC)/ucomplex.pp math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  198. #
  199. # Other $(SYSTEMUNIT)-dependent RTL Units
  200. #
  201. sockets$(PPUEXT) : sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
  202. unixsock.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  203. errors$(PPUEXT) : errors.pp strings$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  204. ipc$(PPUEXT) : ipc.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  205. terminfo$(PPUEXT) : terminfo.pp unix$(PPUEXT)
  206. callspec$(PPUEXT) : $(INC)/callspec.pp $(SYSTEMUNIT)$(PPUEXT)
  207. cmem$(PPUEXT) : $(INC)/cmem.pp $(SYSTEMUNIT)$(PPUEXT)
  208. cthreads$(PPUEXT) : $(UNIXINC)/cthreads.pp $(SYSTEMUNIT)$(PPUEXT) systhrds$(PPUEXT)