Makefile 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  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 Go32v2 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. #####################################################################
  16. # Configuration section
  17. #####################################################################
  18. # Use smartlinking ?
  19. ifndef SMARTLINK
  20. SMARTLINK=NO
  21. endif
  22. # Name of library ?
  23. # If this is set, all units will be put in the same library.
  24. # If it is empty (default), the units will be left in separate files.
  25. ifndef LIBNAME
  26. LIBNAME=
  27. #LIBNAME=fpc
  28. endif
  29. # Should the library be shared or static (only if LIBNAME is set).
  30. # Set this to 'shared' or 'static' to create a librrary
  31. # Setting this to shared will disable smart linking.
  32. ifndef LIBTYPE
  33. LIBTYPE=
  34. #LIBTYPE=static
  35. endif
  36. #####################################################################
  37. # Defaults
  38. #####################################################################
  39. # set target and cpu which are required
  40. OS_TARGET=go32v2
  41. CPU=i386
  42. # Where are the include files
  43. RTL=../..
  44. CFG=$(RTL)/cfg
  45. INC=$(RTL)/inc
  46. PROCINC=$(RTL)/$(CPU)
  47. OBJPASDIR=$(RTL)/objpas
  48. # Where are the .ppi files.
  49. PPI=../ppi
  50. #####################################################################
  51. # Include default makefile
  52. #####################################################################
  53. include $(CFG)/makefile.cfg
  54. #####################################################################
  55. # System dependent
  56. #####################################################################
  57. # Define Go32v2 Units
  58. SYSTEMPPU=system$(PPUEXT)
  59. OBJECTS=strings go32 \
  60. dpmiexcp profile dxeload emu387 \
  61. dos crt objects printer \
  62. cpu mmx mouse getopts heaptrc graph objpas sysutils
  63. LOADERS=prt0 exceptn fpu
  64. #####################################################################
  65. # Include system unit dependencies
  66. #####################################################################
  67. # Get the system independent include file names.
  68. # This will set the following variables :
  69. # SYSINCNAMES
  70. include $(INC)/makefile.inc
  71. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  72. # Get the processor dependent include file names.
  73. # This will set the following variables :
  74. # CPUINCNAMES
  75. include $(PROCINC)/makefile.cpu
  76. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  77. # Put system unit dependencies together.
  78. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  79. #####################################################################
  80. # System independent Makefile
  81. #####################################################################
  82. # Add Prefix and Suffixes
  83. OBJLOADERS=$(addsuffix $(OEXT), $(LOADERS))
  84. PPUOBJECTS=$(addsuffix $(PPUEXT), $(OBJECTS))
  85. .PHONY : all install clean \
  86. libs libsclean \
  87. diffs diffclean \
  88. all : $(OBJLOADERS) $(PPUOBJECTS)
  89. install : all
  90. $(MKDIR) $(UNITINSTALLDIR)
  91. $(INSTALL) *$(PPUEXT) *$(OEXT) $(UNITINSTALLDIR)
  92. clean :
  93. -$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) $(PPAS) link.res log
  94. -$(DELTREE) *$(SMARTEXT)
  95. -make -C $(OBJPASDIR) clean
  96. #####################################################################
  97. # Files
  98. #####################################################################
  99. #
  100. # Loaders
  101. #
  102. prt0$(OEXT) : v2prt0.as
  103. as -o prt0$(OEXT) v2prt0.as
  104. exceptn$(OEXT) : exceptn.as
  105. as -o exceptn$(OEXT) exceptn.as
  106. fpu$(OEXT) : fpu.as
  107. as -o fpu$(OEXT) fpu.as
  108. #
  109. # Base Units (System, strings, os-dependent-base-unit)
  110. #
  111. $(SYSTEMPPU) : system.pp $(SYSDEPS)
  112. $(COMPILER) -Us -Sg system.pp $(REDIR)
  113. strings$(PPUEXT) : $(PROCINC)/strings.pp $(SYSTEMPPU)
  114. $(COPY) $(PROCINC)/strings.pp .
  115. $(COMPILER) strings.pp $(REDIR)
  116. $(DEL) strings.pp
  117. go32$(PPUEXT) : ../go32.pp $(SYSTEMPPU)
  118. $(COPY) ../go32.pp .
  119. $(COMPILER) go32.pp $(REDIR)
  120. $(DEL) go32.pp
  121. #
  122. # Delphi Object Model
  123. #
  124. objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(INC)/except.inc
  125. $(COPY) $(OBJPASDIR)/objpas.pp .
  126. $(COMPILER) -S2 -I$(OBJPASDIR) objpas $(REDIR)
  127. $(DEL) objpas.pp
  128. SYSUTILINC = $(wildcard $(OBJPASDIR)/*.inc)
  129. sysutils$(PPUEXT) : $(OBJPASDIR)/sysutils.pp $(SYSUTILINC) filutil.inc disk.inc
  130. $(COPY) $(OBJPASDIR)/sysutils.pp .
  131. $(COMPILER) -S2 -I$(OBJPASDIR) sysutils $(REDIR)
  132. $(DEL) sysutils.pp
  133. #
  134. # System Dependent Units
  135. #
  136. # new version need -Sv switch for external variables
  137. dpmiexcp$(PPUEXT) : dpmiexcp.pp exceptn$(OEXT) $(SYSTEMPPU)
  138. $(COMPILER) -Sg -Sv dpmiexcp.pp $(REDIR)
  139. profile$(PPUEXT) : profile.pp dpmiexcp$(PPUEXT) go32$(PPUEXT) $(SYSTEMPPU)
  140. $(COMPILER) profile.pp $(REDIR)
  141. dxeload$(PPUEXT) : dxeload.pp $(SYSTEMPPU)
  142. $(COMPILER) dxeload.pp $(REDIR)
  143. emu387$(PPUEXT) : emu387.pp fpu$(OEXT) strings$(PPUEXT) dxeload$(PPUEXT) \
  144. dpmiexcp$(PPUEXT) $(SYSTEMPPU)
  145. $(COMPILER) emu387.pp $(REDIR)
  146. #
  147. # TP7 Compatible RTL Units
  148. #
  149. dos$(PPUEXT) : ../dos.pp $(INC)/filerec.inc $(INC)/textrec.inc \
  150. go32$(PPUEXT) strings$(PPUEXT) $(SYSTEMPPU)
  151. $(COPY) ../dos.pp .
  152. $(COMPILER) dos $(REDIR)
  153. $(DEL) dos.pp
  154. crt$(PPUEXT) : ../crt.pp $(INC)/textrec.inc go32$(PPUEXT) $(SYSTEMPPU)
  155. $(COPY) ../crt.pp .
  156. $(COMPILER) crt $(REDIR)
  157. $(DEL) crt.pp
  158. objects$(PPUEXT) : $(INC)/objects.pp $(INC)/platform.inc objinc.inc $(SYSTEMPPU)
  159. $(COPY) $(INC)/objects.pp .
  160. $(COMPILER) objects.pp $(REDIR)
  161. $(DEL) objects.pp
  162. printer$(PPUEXT) : ../printer.pp $(SYSTEMPPU)
  163. $(COPY) ../printer.pp .
  164. $(COMPILER) printer.pp $(REDIR)
  165. $(DEL) printer.pp
  166. #
  167. # Other RTL Units
  168. #
  169. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMPPU)
  170. $(COPY) $(PROCINC)/cpu.pp .
  171. $(COMPILER) cpu.pp $(REDIR)
  172. $(DEL) cpu.pp
  173. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMPPU)
  174. $(COPY) $(PROCINC)/mmx.pp .
  175. $(COMPILER) mmx.pp $(REDIR)
  176. $(DEL) mmx.pp
  177. mouse$(PPUEXT) : ../mouse.pp $(SYSTEMPPU)
  178. $(COPY) ../mouse.pp .
  179. $(COMPILER) mouse.pp $(REDIR)
  180. $(DEL) mouse.pp
  181. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMPPU)
  182. $(COPY) $(INC)/getopts.pp .
  183. $(COMPILER) getopts.pp $(REDIR)
  184. $(DEL) getopts.pp
  185. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMPPU)
  186. $(COPY) $(INC)/heaptrc.pp .
  187. $(COMPILER) heaptrc $(REDIR)
  188. $(DEL) heaptrc.pp
  189. PPIFILES:=$(wildcard $(PPI)/*.ppi)
  190. graph$(PPUEXT) : ../graph.pp go32$(PPUEXT) $(SYSTEMPPU) mmx$(PPUEXT) $(PPIFILES)
  191. $(COPY) ../graph.pp .
  192. $(COMPILER) -I$(PPI) graph $(REDIR)
  193. $(DEL) graph.pp
  194. #####################################################################
  195. # Libs
  196. #####################################################################
  197. staticlib:
  198. make libsclean
  199. make all SMARTLINK=YES LIBNAME=fpc LIBTYPE=static
  200. sharedlib:
  201. @echo Shared Libraries not supported for Go32v2
  202. staticlibinstall: staticlib
  203. $(MKDIR) $(STATIC_LIBINSTALLDIR)
  204. $(MKDIR) $(STATIC_UNITINSTALLDIR)
  205. $(INSTALLEXE) *$(STATICLIBEXT) $(STATIC_LIBINSTALLDIR)
  206. $(INSTALL) *$(PPUEXT) *$(OEXT) $(STATIC_UNITINSTALLDIR)
  207. sharedlibinstall: sharedlib
  208. libinstall: staticlibinstall
  209. libsclean : clean
  210. -$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  211. #####################################################################
  212. # Default targets
  213. #####################################################################
  214. include $(CFG)/makefile.def
  215. #
  216. # $Log$
  217. # Revision 1.10 1998-10-21 16:51:07 pierre
  218. # * dxeload range check problem solved
  219. #
  220. # Revision 1.9 1998/10/14 07:56:02 pierre
  221. # * -Sv now necessary for dpmiexcp unit
  222. #
  223. # Revision 1.8 1998/10/12 08:36:31 pierre
  224. # * wrong 'objpas' target in all removed
  225. #
  226. # Revision 1.7 1998/10/11 13:45:05 michael
  227. # + Added disk.inc to sysutils dependencies
  228. #
  229. # Revision 1.6 1998/10/11 12:21:48 michael
  230. # + Further sysutils implementations.
  231. #
  232. # Revision 1.5 1998/10/06 22:10:30 peter
  233. # + heaptrc
  234. #
  235. # Revision 1.4 1998/10/02 09:26:00 peter
  236. # * fixed rtl path
  237. #
  238. # Revision 1.3 1998/09/16 16:47:27 peter
  239. # * merged fixes
  240. #
  241. # Revision 1.1.2.2 1998/09/16 16:17:50 peter
  242. # * updates to install with go32,win32
  243. #
  244. # Revision 1.2 1998/09/15 12:09:09 peter
  245. # * merged updates
  246. #
  247. # Revision 1.1.2.1 1998/09/15 12:02:03 peter
  248. # * updates to get objpas using its own makefile
  249. #
  250. # Revision 1.1 1998/09/10 14:13:28 peter
  251. # * renamed
  252. #
  253. # Revision 1.16 1998/09/10 10:20:41 florian
  254. # * fixed typo of previous commit
  255. #
  256. # Revision 1.15 1998/09/10 10:16:52 florian
  257. # * make staticlib does now a make libclean instead of make clean
  258. #
  259. # Revision 1.14 1998/08/20 08:08:37 pierre
  260. # * dpmiexcp did not compile with older versions
  261. # due to the proc to procvar bug
  262. # * makefile separator problem fixed
  263. #
  264. # Revision 1.13 1998/08/19 10:05:01 peter
  265. # * fixed for go32v2 staticlib
  266. #
  267. # Revision 1.12 1998/08/05 10:31:05 pierre
  268. # + added BUGFIX test to be able to compile bugfix branch
  269. #
  270. # Revision 1.11 1998/07/29 15:44:37 michael
  271. # included sysutils and math.pp as target. They compile now.
  272. #
  273. # Revision 1.10 1998/07/22 21:37:03 michael
  274. # make cycle now works
  275. #
  276. # Revision 1.9 1998/05/22 00:39:36 peter
  277. # * go32v1, go32v2 recompiles with the new objects
  278. # * remake3 works again with go32v2
  279. # - removed some "optimizes" from daniel which were wrong
  280. #
  281. # Revision 1.8 1998/05/06 11:53:40 peter
  282. # * update
  283. #
  284. #