Makefile.fpc 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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 dynlibs \
  14. $(CPU_UNITS) charset ucomplex crt getopts heaptrc lineinfo \
  15. errors sockets ipc terminfo bsd freebsd \
  16. video mouse keyboard console serial dateutils \
  17. sysconst cthreads strutils convutils dos objects cwstring fpmkunit
  18. rsts=math varutils typinfo classes variants dateutils sysconst fpmkunit
  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. # Get the system independent include file names.
  71. # This will set the following variables :
  72. # SYSINCNAMES
  73. include $(INC)/makefile.inc
  74. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  75. # Get the processor dependent include file names.
  76. # This will set the following variables :
  77. # CPUINCNAMES
  78. include $(PROCINC)/makefile.cpu
  79. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  80. # Put system unit dependencies together.
  81. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  82. #
  83. # Loaders
  84. #
  85. prt0$(OEXT) : $(CPU_TARGET)/prt0.as
  86. $(AS) -o $(UNITTARGETDIRPREFIX)prt0$(OEXT) $(CPU_TARGET)/prt0.as
  87. cprt0$(OEXT) : $(CPU_TARGET)/cprt0.as
  88. $(AS) -o $(UNITTARGETDIRPREFIX)cprt0$(OEXT) $(CPU_TARGET)/cprt0.as
  89. gprt0$(OEXT) : $(CPU_TARGET)/gprt0.as
  90. $(AS) -o $(UNITTARGETDIRPREFIX)gprt0$(OEXT) $(CPU_TARGET)/gprt0.as
  91. #
  92. # System Units (System, Objpas, Strings)
  93. #
  94. $(SYSTEMUNIT)$(PPUEXT) : $(BSDINC)/$(SYSTEMUNIT).pp unxconst.inc $(SYSDEPS)
  95. $(COMPILER) -Us -Sg $(BSDINC)/$(SYSTEMUNIT).pp
  96. objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
  97. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
  98. dateutils$(PPUEXT): $(OBJPASDIR)/dateutils.pp baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  99. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/dateutils.pp
  100. strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
  101. $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
  102. $(SYSTEMUNIT)$(PPUEXT)
  103. #
  104. # System Dependent Units
  105. #
  106. unixtype$(PPUEXT): $(UNIXINC)/unixtype.pp $(UNIXINC)/ctypes.inc ptypes.inc $(SYSTEMUNIT)$(PPUEXT)
  107. baseunix$(PPUEXT) : errno.inc ptypes.inc $(UNIXINC)/ctypes.inc \
  108. signal.inc $(UNIXINC)/bunxh.inc \
  109. $(BSDINC)/bunxsysc.inc $(BSDPROCINC)/syscallh.inc sysnr.inc \
  110. $(BSDINC)/ostypes.inc $(BSDINC)/osmacro.inc $(UNIXINC)/gensigset.inc \
  111. $(UNIXINC)/genfuncs.inc $(SYSTEMUNIT)$(PPUEXT)
  112. unix$(PPUEXT) : $(UNIXINC)/unix.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
  113. unxconst.inc $(UNIXINC)/timezone.inc \
  114. unxfunc.inc baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  115. linux$(PPUEXT) : baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  116. #
  117. # TP7 Compatible RTL Units
  118. #
  119. dos$(PPUEXT) : $(UNIXINC)/dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
  120. unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  121. crt$(PPUEXT) : $(UNIXINC)/crt.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  122. objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT)
  123. printer$(PPUEXT) : $(UNIXINC)/printer.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  124. #
  125. # Delphi Compatible Units
  126. #
  127. sysutils$(PPUEXT) : $(UNIXINC)/sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
  128. objpas$(PPUEXT) unix$(PPUEXT) errors$(PPUEXT) sysconst$(PPUEXT)
  129. $(COMPILER) -Fi$(OBJPASDIR)/sysutils $(UNIXINC)/sysutils.pp
  130. rtlconsts$(PPUEXT) : $(OBJPASDIR)/rtlconsts.pp
  131. $(COMPILER): $(OBJPASDIR)/rtlconsts.pp
  132. classes$(PPUEXT) : $(UNIXINC)/classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
  133. sysutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT)
  134. $(COMPILER) -Fi$(OBJPASDIR)/classes $(UNIXINC)/classes.pp
  135. typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT) rtlconsts$(PPUEXT)
  136. $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp
  137. math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  138. $(COMPILER) $(OBJPASDIR)/math.pp
  139. gettext$(PPUEXT): $(OBJPASDIR)/gettext.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  140. $(COMPILER) $(OBJPASDIR)/gettext.pp
  141. varutils$(PPUEXT) : $(OBJPASDIR)/cvarutil.inc $(OBJPASDIR)/varutils.inc \
  142. $(OBJPASDIR)/varutilh.inc varutils.pp
  143. $(COMPILER) -I$(OBJPASDIR) $(UNIXINC)/varutils.pp
  144. types$(PPUEXT) : $(OBJPASDIR)/types.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  145. $(COMPILER) $(OBJPASDIR)/types.pp
  146. sysconst$(PPUEXT) : $(OBJPASDIR)/sysconst.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  147. $(COMPILER) $(OBJPASDIR)/sysconst.pp
  148. #
  149. # Mac Pascal Model
  150. #
  151. macpas$(PPUEXT) : $(INC)/macpas.pp $(SYSTEMUNIT)$(PPUEXT)
  152. $(COMPILER) $(INC)/macpas.pp $(REDIR)
  153. #
  154. # Other system-independent RTL Units
  155. #
  156. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT)
  157. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  158. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
  159. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
  160. $(COMPILER) -Sg $(INC)/heaptrc.pp
  161. lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT)
  162. charset$(PPUEXT) : $(INC)/charset.pp $(SYSTEMUNIT)$(PPUEXT)
  163. ucomplex$(PPUEXT) : $(INC)/ucomplex.pp math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  164. fpmkunit$(PPUEXT) : $(COMMON)/fpmkunit.pp classes$(PPUEXT)
  165. #
  166. # Other system-dependent RTL Units
  167. #
  168. sockets$(PPUEXT) : $(UNIXINC)/sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
  169. unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  170. errors$(PPUEXT) : $(UNIXINC)/errors.pp strings$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  171. ipc$(PPUEXT) : $(UNIXINC)/ipc.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  172. terminfo$(PPUEXT) : terminfo.pp unix$(PPUEXT)
  173. callspec$(PPUEXT) : $(INC)/callspec.pp $(SYSTEMUNIT)$(PPUEXT)
  174. cmem$(PPUEXT) : $(INC)/cmem.pp $(SYSTEMUNIT)$(PPUEXT)
  175. sysctl$(PPUEXT) : $(BSDINC)/sysctl.pp $(SYSTEMUNIT)$(PPUEXT)
  176. cthreads$(PPUEXT) : $(UNIXINC)/cthreads.pp $(SYSTEMUNIT)$(PPUEXT)
  177. strutils$(PPUEXT) : $(OBJPASDIR)/strutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
  178. sysutils$(PPUEXT)
  179. $(COMPILER) $(OBJPASDIR)/strutils.pp
  180. convutils$(PPUEXT) : $(OBJPASDIR)/convutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
  181. sysutils$(PPUEXT)
  182. $(COMPILER) $(OBJPASDIR)/convutils.pp
  183. dynlibs$(PPUEXT) : $(INC)/dynlibs.pp $(UNIXINC)/dynlibs.inc dl$(PPUEXT) objpas$(PPUEXT)
  184. ctypes$(PPUEXT) : $(INC)/ctypes.pp $(SYSTEMUNIT)$(PPUEXT)
  185. variants$(PPUEXT) : $(INC)/variants.pp sysutils$(PPUEXT) sysconst$(PPUEXT) varutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT) math$(PPUEXT)
  186. $(COMPILER) -Fi$(INC) $(INC)/variants.pp
  187. cwstring$(PPUEXT) : $(UNIXINC)/cwstring.pp $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT) baseunix$(PPUEXT) unix$(PPUEXT) unixtype$(PPUEXT) ctypes$(PPUEXT)