Makefile.fpc 7.4 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 rtlconst initc cmem matrix \
  12. dl termio printer \
  13. sysutils typinfo systhrds types classes math varutils dynlibs \
  14. cpu mmx charset ucomplex crt getopts heaptrc lineinfo \
  15. errors sockets ipc terminfo \
  16. video mouse keyboard console serial variants dateutils \
  17. sysconst cthreads strutils convutils dos objects
  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)
  29. [lib]
  30. libname=libfprtl.so
  31. libversion=1.0
  32. libunits=$(SYSTEMUNIT) objpas strings \
  33. unix \
  34. dos crt objects printer \
  35. sysutils typinfo math \
  36. cpu mmx getopts heaptrc \
  37. errors sockets ipc dynlibs
  38. [prerules]
  39. RTL=..
  40. INC=$(RTL)/inc
  41. PROCINC=$(RTL)/$(CPU_TARGET)
  42. OSPROCINC=$(RTL)/freebsd/$(CPU_TARGET)
  43. BSDINC=$(RTL)/bsd
  44. BSDPROCINC=$(BSDINC)/$(CPU_TARGET)
  45. UNIXINC=$(RTL)/unix
  46. UNITPREFIX=rtl
  47. ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
  48. SYSTEMUNIT=system
  49. override FPCOPT+=-dNOMOUSE
  50. loaders+=gprt0
  51. else
  52. SYSTEMUNIT=sysbsd
  53. override FPCOPT+=-dUNIX -dNOMOUSE
  54. endif
  55. # Use new feature from 1.0.5 version
  56. # that generates release PPU files
  57. # which will not be recompiled
  58. ifdef RELEASE
  59. override FPCOPT+=-Ur
  60. endif
  61. # Paths
  62. OBJPASDIR=$(RTL)/objpas
  63. GRAPHDIR=$(INC)/graph
  64. # Use new graph unit ?
  65. # NEWGRAPH=YES
  66. # Use LibGGI ?
  67. # Use
  68. #
  69. ifndef USELIBGGI
  70. USELIBGGI=NO
  71. endif
  72. [rules]
  73. # Get the system independent include file names.
  74. # This will set the following variables :
  75. # SYSINCNAMES
  76. include $(INC)/makefile.inc
  77. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  78. # Get the processor dependent include file names.
  79. # This will set the following variables :
  80. # CPUINCNAMES
  81. include $(PROCINC)/makefile.cpu
  82. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  83. # Put system unit dependencies together.
  84. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  85. #
  86. # Loaders
  87. #
  88. prt0$(OEXT) : $(CPU_TARGET)/prt0.as
  89. $(AS) -o $(UNITTARGETDIRPREFIX)prt0$(OEXT) $(CPU_TARGET)/prt0.as
  90. cprt0$(OEXT) : $(CPU_TARGET)/cprt0.as
  91. $(AS) -o $(UNITTARGETDIRPREFIX)cprt0$(OEXT) $(CPU_TARGET)/cprt0.as
  92. gprt0$(OEXT) : $(CPU_TARGET)/gprt0.as
  93. $(AS) -o $(UNITTARGETDIRPREFIX)gprt0$(OEXT) $(CPU_TARGET)/gprt0.as
  94. #
  95. # System Units (System, Objpas, Strings)
  96. #
  97. $(SYSTEMUNIT)$(PPUEXT) : $(BSDINC)/$(SYSTEMUNIT).pp sysconst.inc systypes.inc syscalls.inc $(SYSDEPS)
  98. $(COMPILER) -Us -Sg $(BSDINC)/$(SYSTEMUNIT).pp
  99. objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
  100. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
  101. dateutils$(PPUEXT): $(OBJPASDIR)/dateutils.pp baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  102. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/dateutils.pp
  103. strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
  104. $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
  105. $(SYSTEMUNIT)$(PPUEXT)
  106. #
  107. # System Dependent Units
  108. #
  109. unixtype$(PPUEXT): $(UNIXINC)/unixtype.pp $(BSDINC)/ctypes.inc ptypes.inc $(SYSTEMUNIT)$(PPUEXT)
  110. baseunix$(PPUEXT) : errno.inc $(BSDINC)/bunxtype.inc ptypes.inc $(BSDINC)/ctypes.inc \
  111. signal.inc $(UNIXINC)/bunxh.inc $(BSDINC)/bunxmain.inc $(BSDINC)/ostypes.inc \
  112. $(BSDINC)/bunxfunc.inc $(BSDPROCINC)/syscallh.inc sysnr.inc \
  113. $(BSDINC)/ostypes.inc $(BSDINC)/ossysch.inc $(BSDINC)/bunxmacr.inc $(UNIXINC)/gensigset.inc \
  114. $(UNIXINC)/genfuncs.inc $(SYSTEMUNIT)$(PPUEXT)
  115. unix$(PPUEXT) : $(UNIXINC)/unix.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
  116. syscalls.inc systypes.inc sysconst.inc $(UNIXINC)/timezone.inc \
  117. unixsysc.inc baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  118. linux$(PPUEXT) : baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  119. #
  120. # TP7 Compatible RTL Units
  121. #
  122. dos$(PPUEXT) : $(UNIXINC)/dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
  123. unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  124. crt$(PPUEXT) : $(UNIXINC)/crt.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  125. objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT)
  126. printer$(PPUEXT) : $(UNIXINC)/printer.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  127. #
  128. # Graph
  129. #
  130. #
  131. # Delphi Compatible Units
  132. #
  133. sysutils$(PPUEXT) : $(UNIXINC)/sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
  134. objpas$(PPUEXT) unix$(PPUEXT) errors$(PPUEXT) sysconst$(PPUEXT)
  135. $(COMPILER) -Fi$(OBJPASDIR)/sysutils $(UNIXINC)/sysutils.pp
  136. rtlconst$(PPUEXT) : $(OBJPASDIR)/rtlconst.pp
  137. $(COMPILER): $(OBJPASDIR)/rtlconst.pp
  138. classes$(PPUEXT) : classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
  139. sysutils$(PPUEXT) typinfo$(PPUEXT) rtlconst$(PPUEXT)
  140. $(COMPILER) -Fi$(OBJPASDIR)/classes classes.pp
  141. typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
  142. $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp
  143. math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  144. $(COMPILER) $(OBJPASDIR)/math.pp
  145. gettext$(PPUEXT): $(OBJPASDIR)/gettext.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  146. $(COMPILER) $(OBJPASDIR)/gettext.pp
  147. varutils$(PPUEXT) : $(OBJPASDIR)/cvarutil.inc $(OBJPASDIR)/varutils.inc \
  148. $(OBJPASDIR)/varutilh.inc varutils.pp
  149. $(COMPILER) -I$(OBJPASDIR) $(UNIXINC)/varutils.pp
  150. types$(PPUEXT) : $(OBJPASDIR)/types.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  151. $(COMPILER) $(OBJPASDIR)/types.pp
  152. sysconst$(PPUEXT) : $(OBJPASDIR)/sysconst.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  153. $(COMPILER) $(OBJPASDIR)/sysconst.pp
  154. #
  155. # Mac Pascal Model
  156. #
  157. macpas$(PPUEXT) : $(INC)/macpas.pp $(SYSTEMUNIT)$(PPUEXT)
  158. $(COMPILER) $(INC)/macpas.pp $(REDIR)
  159. #
  160. # Other system-independent RTL Units
  161. #
  162. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT)
  163. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  164. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
  165. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
  166. $(COMPILER) -Sg $(INC)/heaptrc.pp
  167. lineinfo$(PPUEXT) : $(INC)/lineinfo.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 systhrds$(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. dynlibs$(PPUEXT) : $(INC)/dynlibs.pp $(UNIXINC)/dynlibs.inc dl$(PPUEXT) objpas$(PPUEXT)
  189. ctypes$(PPUEXT) : $(INC)/ctypes.pp $(SYSTEMUNIT)$(PPUEXT)