Makefile 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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, this can't contain units
  63. # that need to be linked with other libs like graph, gpm
  64. SHAREDLIBUNITOBJECTS=$(SYSTEMUNIT) objpas strings \
  65. linux ports \
  66. dos crt objects printer \
  67. sysutils typinfo math \
  68. cpu mmx getopts heaptrc \
  69. sockets ipc
  70. #####################################################################
  71. # Common targets
  72. #####################################################################
  73. .PHONY: all clean install info \
  74. staticlib sharedlib libsclean \
  75. staticinstall sharedinstall libinstall \
  76. all: testfpcmake fpc_all
  77. clean: testfpcmake fpc_clean
  78. install: testfpcmake fpc_install
  79. info: testfpcmake fpc_info
  80. staticlib: testfpcmake fpc_staticlib
  81. sharedlib: testfpcmake fpc_sharedlib
  82. libsclean: testfpcmake fpc_libsclean
  83. staticinstall: testfpcmake fpc_staticinstall
  84. sharedinstall: testfpcmake fpc_sharedinstall
  85. libinstall: testfpcmake fpc_libinstall
  86. #####################################################################
  87. # Include default makefile
  88. #####################################################################
  89. # test if FPCMAKE is still valid
  90. ifdef FPCMAKE
  91. ifeq ($(strip $(wildcard $(FPCMAKE))),)
  92. FPCDIR=
  93. FPCMAKE=
  94. endif
  95. endif
  96. ifndef FPCDIR
  97. ifdef DEFAULTFPCDIR
  98. FPCDIR=$(DEFAULTFPCDIR)
  99. endif
  100. endif
  101. ifndef FPCMAKE
  102. ifdef FPCDIR
  103. FPCMAKE=$(FPCDIR)/makefile.fpc
  104. else
  105. FPCMAKE=makefile.fpc
  106. endif
  107. endif
  108. override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
  109. ifeq ($(FPCMAKE),)
  110. testfpcmake:
  111. @echo makefile.fpc not found!
  112. @echo Check the FPCMAKE and FPCDIR environment variables.
  113. @exit
  114. else
  115. include $(FPCMAKE)
  116. testfpcmake:
  117. endif
  118. #####################################################################
  119. # Include system unit dependencies
  120. #####################################################################
  121. SYSTEMPPU=$(addsuffix $(PPUEXT),$(SYSTEMUNIT))
  122. # Get the system independent include file names.
  123. # This will set the following variables :
  124. # SYSINCNAMES
  125. include $(INC)/makefile.inc
  126. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  127. # Get the processor dependent include file names.
  128. # This will set the following variables :
  129. # CPUINCNAMES
  130. include $(PROCINC)/makefile.cpu
  131. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  132. # Put system unit dependencies together.
  133. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  134. #####################################################################
  135. # Dependencies
  136. #####################################################################
  137. # Options needed
  138. ifneq ("$(FPC_VERSION)","0.99.10")
  139. ifndef BROWSER
  140. NEEDOPT=-b-
  141. endif
  142. endif
  143. vpath %$(PASEXT) $(INC) $(PROCINC)
  144. #
  145. # Loaders
  146. #
  147. prt0$(OEXT) : $(LOADERAS)
  148. $(AS) -o prt0$(OEXT) $(LOADERAS)
  149. gprt0$(OEXT) : $(GLOADERAS)
  150. $(AS) -o gprt0$(OEXT) $(GLOADERAS)
  151. ifndef AOUT
  152. cprt0$(OEXT) : $(CPU)/cprt1.as
  153. $(AS) -o cprt0$(OEXT) $(CPU)/cprt1.as
  154. cprt21$(OEXT) : $(CPU)/cprt21.as
  155. $(AS) -o cprt21$(OEXT) $(CPU)/cprt21.as
  156. # still need to use gprt1, because gprt21 crashes
  157. gprt21$(OEXT) : $(CPU)/gprt1.as
  158. $(AS) -o gprt21$(OEXT) $(CPU)/gprt1.as
  159. endif
  160. #
  161. # System Units (System, Objpas, Strings)
  162. #
  163. $(SYSTEMPPU) : syslinux.pp sysconst.inc systypes.inc syscalls.inc $(SYSDEPS)
  164. $(COMPILER) -Us -Sg syslinux.pp $(REDIR)
  165. objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMPPU)
  166. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp $(REDIR)
  167. strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
  168. $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
  169. $(SYSTEMPPU)
  170. #
  171. # System Dependent Units
  172. #
  173. linux$(PPUEXT) : linux.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
  174. syscalls.inc systypes.inc sysconst.inc $(SYSTEMPPU)
  175. ports$(PPUEXT) : ports.pp linux$(PPUEXT) objpas$(PPUEXT)
  176. #
  177. # TP7 Compatible RTL Units
  178. #
  179. dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
  180. linux$(PPUEXT) $(SYSTEMPPU)
  181. crt$(PPUEXT) : crt.pp $(INC)/textrec.inc linux$(PPUEXT) $(SYSTEMPPU)
  182. objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
  183. printer$(PPUEXT) : printer.pp $(INC)/textrec.inc linux$(PPUEXT) $(SYSTEMPPU)
  184. graph$(PPUEXT) : graph.pp linux$(PPUEXT) objects$(PPUEXT)
  185. #
  186. # Delphi Compatible Units
  187. #
  188. sysutils$(PPUEXT) : $(OBJPASDIR)/sysutils.pp $(wildcard $(OBJPASDIR)/*.inc) \
  189. filutil.inc disk.inc objpas$(PPUEXT) linux$(PPUEXT)
  190. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/sysutils.pp $(REDIR)
  191. typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
  192. $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp $(REDIR)
  193. math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  194. $(COMPILER) $(OBJPASDIR)/math.pp $(REDIR)
  195. gettext$(PPUEXT): $(OBJPASDIR)/gettext.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  196. $(COMPILER) $(OBJPASDIR)/gettext.pp $(REDIR)
  197. #
  198. # Other system-independent RTL Units
  199. #
  200. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMPPU)
  201. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMPPU)
  202. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMPPU)
  203. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMPPU)
  204. $(COMPILER) -Sg $(INC)/heaptrc.pp $(REDIR)
  205. #
  206. # Other system-dependent RTL Units
  207. #
  208. sockets$(PPUEXT) : sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
  209. linux$(PPUEXT) $(SYSTEMPPU)
  210. errors$(PPUEXT) : errors.pp strings$(PPUEXT) $(SYSTEMPPU)
  211. ipc$(PPUEXT) : ipc.pp linux$(PPUEXT) $(SYSTEMPPU)
  212. #
  213. # $Log$
  214. # Revision 1.31 1999-08-04 11:30:05 michael
  215. # * moved gettext to fcl
  216. #
  217. # Revision 1.30 1999/07/29 01:39:09 peter
  218. # * shared lib units fixed
  219. #
  220. # Revision 1.29 1999/07/01 19:39:42 peter
  221. # + gpm unit
  222. #
  223. # Revision 1.28 1999/06/03 09:36:32 peter
  224. # * first things for sharedlib to work again
  225. #
  226. # Revision 1.27 1999/05/28 11:28:30 peter
  227. # * ipc unit can be compiled with 0.99.10 again
  228. #
  229. # Revision 1.26 1999/05/28 11:21:06 peter
  230. # * moved fpc_version check so it works correct
  231. #
  232. # Revision 1.25 1999/05/13 07:39:07 michael
  233. # + Fix in heaptrc target: needs -Sg
  234. #
  235. # Revision 1.24 1999/05/05 22:24:08 peter
  236. # * 0.99.10 check for browser
  237. #
  238. # Revision 1.23 1999/05/04 11:59:45 peter
  239. # * browser off by default
  240. #
  241. # Revision 1.22 1999/05/03 23:30:28 peter
  242. # * small update
  243. # * uses gprt1 again for gprt21 becuase gprt21.as crashes
  244. #
  245. # Revision 1.21 1999/05/03 21:29:35 peter
  246. # + glibc 2.1 support
  247. #
  248. # Revision 1.20 1999/04/22 10:56:32 peter
  249. # * fixed sysutils dependencys
  250. # * objpas files are agian in the main Makefile, makefile.op is obsolete
  251. #
  252. # Revision 1.19 1999/04/14 09:07:17 peter
  253. # * fixed strings dependency
  254. #
  255. # Revision 1.18 1999/03/22 13:09:10 peter
  256. # - ipc unit because it crashes on 0.99.10
  257. #
  258. # Revision 1.17 1999/03/16 00:47:09 peter
  259. # * makefile.fpc targets start with fpc_
  260. # * small updates for install scripts
  261. #
  262. # Revision 1.16 1999/03/12 21:07:51 michael
  263. # + clean and libsclean added
  264. #
  265. # Revision 1.15 1999/03/09 01:35:55 peter
  266. # * makefile.fpc updates and defaultfpcdir var
  267. #
  268. #