Makefile.fpc 8.2 KB

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