Makefile 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. #
  2. # $Id$
  3. # This file is part of the Free Pascal run time library.
  4. # Copyright (c) 1996-98 by Michael van Canneyt
  5. #
  6. # Makefile for the Free Pascal Linux Runtime Library
  7. #
  8. # See the file COPYING.FPC, included in this distribution,
  9. # for details about the copyright.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15. # Warning: this file contains TAB (#9) characters that are required for
  16. # make. Make sure you use an editor that does not replace TABs with
  17. # spaces, or the makefile won't work anymore after you save.
  18. #####################################################################
  19. # Makefile Defaults
  20. #####################################################################
  21. # Default place of the makefile.fpc
  22. DEFAULTFPCDIR=../..
  23. # set target and cpu which are required
  24. override OS_TARGET=linux
  25. override CPU=i386
  26. # Where are the include files
  27. RTL=..
  28. INC=$(RTL)/inc
  29. PROCINC=$(RTL)/$(CPU)
  30. # Where to place the result files
  31. TARGETDIR=.
  32. # These units belong to the RTL
  33. UNITPREFIX=rtl
  34. # Default library name
  35. LIBNAME=fprtl
  36. #####################################################################
  37. # Own defaults
  38. #####################################################################
  39. # Paths
  40. OBJPASDIR=$(RTL)/objpas
  41. # Define Go32v2 Units
  42. SYSTEMUNIT=syslinux
  43. # Define Loaders
  44. ifdef AOUT
  45. PRT=prt0
  46. else
  47. PRT=prt1
  48. endif
  49. LOADERAS=$(CPU)/$(PRT).as
  50. GLOADERAS=$(CPU)/g$(PRT).as
  51. LOADEROBJECTS=prt0 gprt0
  52. ifndef AOUT
  53. LOADEROBJECTS+=cprt0 cprt21 gprt21
  54. endif
  55. # Unit Objects
  56. UNITOBJECTS=$(SYSTEMUNIT) objpas strings \
  57. linux ports \
  58. dos crt objects printer graph \
  59. sysutils typinfo math \
  60. cpu mmx getopts heaptrc \
  61. errors sockets gpm ipc
  62. # Unit Objects Which are placed in libfpc.so
  63. SHAREDLIBUNITOBJECTS=$(SYSTEMUNIT) objpas strings \
  64. linux ports \
  65. dos crt objects printer \
  66. sysutils typinfo math \
  67. cpu mmx getopts heaptrc \
  68. errors sockets gpm ipc
  69. #####################################################################
  70. # Common targets
  71. #####################################################################
  72. .PHONY: all clean install info \
  73. staticlib sharedlib libsclean \
  74. staticinstall sharedinstall libinstall \
  75. all: testfpcmake fpc_all
  76. clean: testfpcmake fpc_clean
  77. install: testfpcmake fpc_install
  78. info: testfpcmake fpc_info
  79. staticlib: testfpcmake fpc_staticlib
  80. sharedlib: testfpcmake fpc_sharedlib
  81. libsclean: testfpcmake fpc_libsclean
  82. staticinstall: testfpcmake fpc_staticinstall
  83. sharedinstall: testfpcmake fpc_sharedinstall
  84. libinstall: testfpcmake fpc_libinstall
  85. #####################################################################
  86. # Include default makefile
  87. #####################################################################
  88. # test if FPCMAKE is still valid
  89. ifdef FPCMAKE
  90. ifeq ($(strip $(wildcard $(FPCMAKE))),)
  91. FPCDIR=
  92. FPCMAKE=
  93. endif
  94. endif
  95. ifndef FPCDIR
  96. ifdef DEFAULTFPCDIR
  97. FPCDIR=$(DEFAULTFPCDIR)
  98. endif
  99. endif
  100. ifndef FPCMAKE
  101. ifdef FPCDIR
  102. FPCMAKE=$(FPCDIR)/makefile.fpc
  103. else
  104. FPCMAKE=makefile.fpc
  105. endif
  106. endif
  107. override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
  108. ifeq ($(FPCMAKE),)
  109. testfpcmake:
  110. @echo makefile.fpc not found!
  111. @echo Check the FPCMAKE and FPCDIR environment variables.
  112. @exit
  113. else
  114. include $(FPCMAKE)
  115. testfpcmake:
  116. endif
  117. #####################################################################
  118. # Include system unit dependencies
  119. #####################################################################
  120. SYSTEMPPU=$(addsuffix $(PPUEXT),$(SYSTEMUNIT))
  121. # Get the system independent include file names.
  122. # This will set the following variables :
  123. # SYSINCNAMES
  124. include $(INC)/makefile.inc
  125. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  126. # Get the processor dependent include file names.
  127. # This will set the following variables :
  128. # CPUINCNAMES
  129. include $(PROCINC)/makefile.cpu
  130. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  131. # Put system unit dependencies together.
  132. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  133. #####################################################################
  134. # Dependencies
  135. #####################################################################
  136. # Options needed
  137. ifneq ("$(FPC_VERSION)","0.99.10")
  138. ifndef BROWSER
  139. NEEDOPT=-b-
  140. endif
  141. endif
  142. vpath %$(PASEXT) $(INC) $(PROCINC)
  143. #
  144. # Loaders
  145. #
  146. prt0$(OEXT) : $(LOADERAS)
  147. $(AS) -o prt0$(OEXT) $(LOADERAS)
  148. gprt0$(OEXT) : $(GLOADERAS)
  149. $(AS) -o gprt0$(OEXT) $(GLOADERAS)
  150. ifndef AOUT
  151. cprt0$(OEXT) : $(CPU)/cprt1.as
  152. $(AS) -o cprt0$(OEXT) $(CPU)/cprt1.as
  153. cprt21$(OEXT) : $(CPU)/cprt21.as
  154. $(AS) -o cprt21$(OEXT) $(CPU)/cprt21.as
  155. # still need to use gprt1, because gprt21 crashes
  156. gprt21$(OEXT) : $(CPU)/gprt1.as
  157. $(AS) -o gprt21$(OEXT) $(CPU)/gprt1.as
  158. endif
  159. #
  160. # System Units (System, Objpas, Strings)
  161. #
  162. $(SYSTEMPPU) : syslinux.pp sysconst.inc systypes.inc syscalls.inc $(SYSDEPS)
  163. $(COMPILER) -Us -Sg syslinux.pp $(REDIR)
  164. objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMPPU)
  165. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp $(REDIR)
  166. strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
  167. $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
  168. $(SYSTEMPPU)
  169. #
  170. # System Dependent Units
  171. #
  172. linux$(PPUEXT) : linux.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
  173. syscalls.inc systypes.inc sysconst.inc $(SYSTEMPPU)
  174. ports$(PPUEXT) : ports.pp linux$(PPUEXT) objpas$(PPUEXT)
  175. #
  176. # TP7 Compatible RTL Units
  177. #
  178. dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
  179. linux$(PPUEXT) $(SYSTEMPPU)
  180. crt$(PPUEXT) : crt.pp $(INC)/textrec.inc linux$(PPUEXT) $(SYSTEMPPU)
  181. objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
  182. printer$(PPUEXT) : printer.pp $(INC)/textrec.inc linux$(PPUEXT) $(SYSTEMPPU)
  183. graph$(PPUEXT) : graph.pp linux$(PPUEXT) objects$(PPUEXT)
  184. #
  185. # Delphi Compatible Units
  186. #
  187. sysutils$(PPUEXT) : $(OBJPASDIR)/sysutils.pp $(wildcard $(OBJPASDIR)/*.inc) \
  188. filutil.inc disk.inc objpas$(PPUEXT) linux$(PPUEXT)
  189. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/sysutils.pp $(REDIR)
  190. typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
  191. $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp $(REDIR)
  192. math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  193. $(COMPILER) $(OBJPASDIR)/math.pp $(REDIR)
  194. #
  195. # Other system-independent RTL Units
  196. #
  197. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMPPU)
  198. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMPPU)
  199. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMPPU)
  200. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMPPU)
  201. $(COMPILER) -Sg $(INC)/heaptrc.pp $(REDIR)
  202. #
  203. # Other system-dependent RTL Units
  204. #
  205. sockets$(PPUEXT) : sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
  206. linux$(PPUEXT) $(SYSTEMPPU)
  207. errors$(PPUEXT) : errors.pp strings$(PPUEXT) $(SYSTEMPPU)
  208. ipc$(PPUEXT) : ipc.pp linux$(PPUEXT) $(SYSTEMPPU)
  209. #
  210. # $Log$
  211. # Revision 1.29 1999-07-01 19:39:42 peter
  212. # + gpm unit
  213. #
  214. # Revision 1.28 1999/06/03 09:36:32 peter
  215. # * first things for sharedlib to work again
  216. #
  217. # Revision 1.27 1999/05/28 11:28:30 peter
  218. # * ipc unit can be compiled with 0.99.10 again
  219. #
  220. # Revision 1.26 1999/05/28 11:21:06 peter
  221. # * moved fpc_version check so it works correct
  222. #
  223. # Revision 1.25 1999/05/13 07:39:07 michael
  224. # + Fix in heaptrc target: needs -Sg
  225. #
  226. # Revision 1.24 1999/05/05 22:24:08 peter
  227. # * 0.99.10 check for browser
  228. #
  229. # Revision 1.23 1999/05/04 11:59:45 peter
  230. # * browser off by default
  231. #
  232. # Revision 1.22 1999/05/03 23:30:28 peter
  233. # * small update
  234. # * uses gprt1 again for gprt21 becuase gprt21.as crashes
  235. #
  236. # Revision 1.21 1999/05/03 21:29:35 peter
  237. # + glibc 2.1 support
  238. #
  239. # Revision 1.20 1999/04/22 10:56:32 peter
  240. # * fixed sysutils dependencys
  241. # * objpas files are agian in the main Makefile, makefile.op is obsolete
  242. #
  243. # Revision 1.19 1999/04/14 09:07:17 peter
  244. # * fixed strings dependency
  245. #
  246. # Revision 1.18 1999/03/22 13:09:10 peter
  247. # - ipc unit because it crashes on 0.99.10
  248. #
  249. # Revision 1.17 1999/03/16 00:47:09 peter
  250. # * makefile.fpc targets start with fpc_
  251. # * small updates for install scripts
  252. #
  253. # Revision 1.16 1999/03/12 21:07:51 michael
  254. # + clean and libsclean added
  255. #
  256. # Revision 1.15 1999/03/09 01:35:55 peter
  257. # * makefile.fpc updates and defaultfpcdir var
  258. #
  259. #