Makefile 7.5 KB

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