Makefile.fpc 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. #
  2. # Makefile.fpc for Free Pascal OpenBSD RTL
  3. #
  4. [package]
  5. main=rtl
  6. [install]
  7. fpcpackage=y
  8. [target]
  9. loaders=prt0 cprt0 dllprt0
  10. units=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings syscall baseunix \
  11. $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc \
  12. $(CPU_UNITS) dos rtlconsts \
  13. sysutils fgl classes typinfo math \
  14. charset cpall character getopts heaptrc lineinfo lnfodwrf \
  15. errors \
  16. types sysctl sysconst \
  17. fpintres dynlibs cwstring cmem dl termio \
  18. cthreads unixcp
  19. rsts=math typinfo classes sysconst
  20. implicitunits=exeinfo \
  21. cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 \
  22. cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852 \
  23. unicodedata unicodenumtable
  24. [require]
  25. nortl=y
  26. [install]
  27. fpcpackage=y
  28. [default]
  29. fpcdir=../..
  30. target=openbsd
  31. [compiler]
  32. includedir=$(INC) $(PROCINC) $(UNIXINC) $(BSDINC) $(BSDPROCINC) $(TARGETPROCINC)
  33. sourcedir=$(INC) $(PROCINC) $(UNIXINC) $(BSDINC)
  34. [lib]
  35. libname=libfprtl.so
  36. libversion=2.0.0
  37. libunits=$(SYSTEMUNIT) objpas strings \
  38. unix \
  39. dos \
  40. sysutils typinfo math \
  41. cpu mmx getopts heaptrc \
  42. errors
  43. [prerules]
  44. RTL=..
  45. INC=$(RTL)/inc
  46. PROCINC=$(RTL)/$(CPU_TARGET)
  47. BSDINC=$(RTL)/bsd
  48. BSDPROCINC=$(BSDINC)/$(CPU_TARGET)
  49. UNIXINC=$(RTL)/unix
  50. UNITPREFIX=rtl
  51. TARGETPROCINC=$(RTL)/openbsd/$(CPU_TARGET)
  52. ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
  53. SYSTEMUNIT=system
  54. LINUXUNIT=
  55. PRT0=prt0
  56. else
  57. SYSTEMUNIT=sysbsd
  58. LINUXUNIT=
  59. override FPCOPT+=-dUNIX
  60. PRT0=prt0_10
  61. endif
  62. # Use new feature from 1.0.5 version
  63. # that generates release PPU files
  64. # which will not be recompiled
  65. ifdef RELEASE
  66. override FPCOPT+=-Ur
  67. endif
  68. ifeq ($(ARCH),x86_64)
  69. CPU_UNITS=x86 ports cpu
  70. endif
  71. ifeq ($(ARCH),i386)
  72. CPU_UNITS=x86 ports cpu mmx
  73. endif
  74. # Paths
  75. OBJPASDIR=$(RTL)/objpas
  76. GRAPHDIR=$(INC)/graph
  77. # Use new graph unit ?
  78. # NEWGRAPH=YES
  79. # Use LibGGI ?
  80. # Use
  81. #
  82. ifndef USELIBGGI
  83. USELIBGGI=NO
  84. endif
  85. [rules]
  86. .NOTPARALLEL:
  87. # Get the system independent include file names.
  88. # This will set the following variables :
  89. # SYSINCNAMES
  90. include $(INC)/makefile.inc
  91. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  92. # Get the processor dependent include file names.
  93. # This will set the following variables :
  94. # CPUINCNAMES
  95. include $(PROCINC)/makefile.cpu
  96. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  97. # Put system unit dependencies together.
  98. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  99. #
  100. # Loaders
  101. #
  102. prt0$(OEXT) : $(CPU_TARGET)/$(PRT0).as
  103. $(AS) -o $(UNITTARGETDIRPREFIX)prt0$(OEXT) $(CPU_TARGET)/$(PRT0).as
  104. cprt0$(OEXT) : $(CPU_TARGET)/cprt0.as
  105. $(AS) -o $(UNITTARGETDIRPREFIX)cprt0$(OEXT) $(CPU_TARGET)/cprt0.as
  106. dllprt0$(OEXT) : $(CPU_TARGET)/dllprt0.as
  107. $(AS) -o $(UNITTARGETDIRPREFIX)dllprt0$(OEXT) $(CPU_TARGET)/dllprt0.as
  108. #
  109. # System Units (System, Objpas, Strings)
  110. #
  111. $(SYSTEMUNIT)$(PPUEXT) : $(BSDINC)/$(SYSTEMUNIT).pp sysconst.inc systypes.inc syscalls.inc $(SYSDEPS)
  112. $(COMPILER) -Us -Sg $(BSDINC)/$(SYSTEMUNIT).pp
  113. uuchar$(PPUEXT): $(SYSTEMUNIT)$(PPUEXT) $(INC)/uuchar.pp
  114. objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
  115. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
  116. strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
  117. $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
  118. $(SYSTEMUNIT)$(PPUEXT)
  119. #
  120. # System Dependent Units
  121. #
  122. unixtype$(PPUEXT): $(UNIXINC)/unixtype.pp $(UNIXINC)/ctypes.inc ptypes.inc $(SYSTEMUNIT)$(PPUEXT)
  123. baseunix$(PPUEXT) : errno.inc ptypes.inc $(UNIXINC)/ctypes.inc \
  124. signal.inc $(UNIXINC)/bunxh.inc \
  125. $(BSDINC)/bunxsysc.inc $(BSDPROCINC)/syscallh.inc sysnr.inc \
  126. $(BSDINC)/ostypes.inc $(BSDINC)/osmacro.inc $(UNIXINC)/gensigset.inc \
  127. $(UNIXINC)/genfuncs.inc sysctl$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  128. unix$(PPUEXT) : $(UNIXINC)/unix.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
  129. unxconst.inc $(UNIXINC)/timezone.inc \
  130. unxfunc.inc baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  131. linux$(PPUEXT) : baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  132. unixcp$(PPUEXT) : $(UNIXINC)/unixcp.pp $(SYSTEMUNIT)$(PPUEXT) objpas$(PPUEXT) baseunix$(PPUEXT)
  133. $(COMPILER) $(UNIXINC)/unixcp.pp
  134. #
  135. # TP7 Compatible RTL Units
  136. #
  137. dos$(PPUEXT) : $(UNIXINC)/dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
  138. unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  139. #
  140. # Graph
  141. #
  142. #
  143. # Delphi Compatible Units
  144. #
  145. sysutils$(PPUEXT) : $(UNIXINC)/sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
  146. objpas$(PPUEXT) unix$(PPUEXT) errors$(PPUEXT) sysconst$(PPUEXT)
  147. $(COMPILER) -Fi$(OBJPASDIR)/sysutils $(UNIXINC)/sysutils.pp
  148. classes$(PPUEXT) : $(UNIXINC)/classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
  149. sysutils$(PPUEXT) typinfo$(PPUEXT) fgl$(PPUEXT)
  150. $(COMPILER) -Fi$(OBJPASDIR)/classes $(UNIXINC)/classes.pp
  151. fgl$(PPUEXT) : $(OBJPASDIR)/fgl.pp objpas$(PPUEXT) types$(PPUEXT) system$(PPUEXT) sysutils$(PPUEXT)
  152. $(COMPILER) $(OBJPASDIR)/fgl.pp
  153. rtlconsts$(PPUEXT) : $(OBJPASDIR)/rtlconsts.pp
  154. $(COMPILER) $(OBJPASDIR)/rtlconsts.pp
  155. typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
  156. $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp
  157. math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  158. $(COMPILER) $(OBJPASDIR)/math.pp
  159. types$(PPUEXT) : $(OBJPASDIR/types.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  160. $(COMPILER) $(OBJPASDIR)/types.pp
  161. ctypes$(PPUEXT) : $(INC)/ctypes.pp $(SYSTEMUNIT)$(PPUEXT)
  162. dynlibs$(PPUEXT) : $(INC)/dynlibs.pas $(UNIXINC)/dynlibs.inc dl$(PPUEXT) objpas$(PPUEXT)
  163. cwstring$(PPUEXT) : $(UNIXINC)/cwstring.pp $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT) baseunix$(PPUEXT) unix$(PPUEXT) unixtype$(PPUEXT) ctypes$(PPUEXT) dynlibs$(PPUEXT)
  164. # let it depend on buildcollations to prevent simultaneous building of unicodedata
  165. character$(PPUEXT): sysutils$(PPUEXT) $(OBJPASDIR)/character.pas objpas$(PPUEXT) rtlconsts$(PPUEXT)
  166. $(COMPILER) $(OBJPASDIR)/character.pas
  167. #
  168. # Mac Pascal Model
  169. #
  170. macpas$(PPUEXT) : $(INC)/macpas.pp objpas$(PPUEXT) math$(PPUEXT)
  171. $(COMPILER) $(INC)/macpas.pp $(REDIR)
  172. #
  173. # Other system-independent RTL Units
  174. #
  175. ifeq ($(ARCH),x86_64)
  176. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT)
  177. else
  178. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT)
  179. endif
  180. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  181. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
  182. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
  183. $(COMPILER) -Sg $(INC)/heaptrc.pp
  184. lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT)
  185. lnfodwrf$(PPUEXT) : $(INC)/lnfodwrf.pp $(SYSTEMUNIT)$(PPUEXT)
  186. charset$(PPUEXT) : $(INC)/charset.pp $(SYSTEMUNIT)$(PPUEXT)
  187. cpall$(PPUEXT): $(RTL)/charmaps/cpall.pas system$(PPUEXT) charset$(PPUEXT)
  188. $(COMPILER) -Fu$(INC) -Fi$(RTL)/charmaps $(RTL)/charmaps/cpall.pas
  189. #
  190. # Other system-dependent RTL Units
  191. #
  192. errors$(PPUEXT) : $(UNIXINC)/errors.pp strings$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  193. callspec$(PPUEXT) : $(INC)/callspec.pp $(SYSTEMUNIT)$(PPUEXT)
  194. sysctl$(PPUEXT) : $(BSDINC)/sysctl.pp $(SYSTEMUNIT)$(PPUEXT) syscall$(PPUEXT) unixtype$(PPUEXT)
  195. syscall$(PPUEXT) : $(UNIXINC)/syscall.pp
  196. sysconst$(PPUEXT) : $(OBJPASDIR)/sysconst.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  197. $(COMPILER) $(OBJPASDIR)/sysconst.pp
  198. cthreads$(PPUEXT) : $(UNIXINC)/cthreads.pp
  199. rtlconst$(PPUEXT) : $(OBJPASDIR)/rtlconst.pp
  200. $(COMPILER) $(OBJPASDIR)/rtlconst.pp