Makefile 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  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) objpas
  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. dpmiexcp$(PPUEXT) : dpmiexcp.pp exceptn$(OEXT) $(SYSTEMPPU)
  137. $(COMPILER) -Sg dpmiexcp.pp $(REDIR)
  138. profile$(PPUEXT) : profile.pp dpmiexcp$(PPUEXT) go32$(PPUEXT) $(SYSTEMPPU)
  139. $(COMPILER) profile.pp $(REDIR)
  140. dxeload$(PPUEXT) : $(SYSTEMPPU)
  141. $(COMPILER) dxeload.pp $(REDIR)
  142. emu387$(PPUEXT) : emu387.pp fpu$(OEXT) strings$(PPUEXT) dxeload$(PPUEXT) \
  143. dpmiexcp$(PPUEXT) $(SYSTEMPPU)
  144. $(COMPILER) emu387.pp $(REDIR)
  145. #
  146. # TP7 Compatible RTL Units
  147. #
  148. dos$(PPUEXT) : ../dos.pp $(INC)/filerec.inc $(INC)/textrec.inc \
  149. go32$(PPUEXT) strings$(PPUEXT) $(SYSTEMPPU)
  150. $(COPY) ../dos.pp .
  151. $(COMPILER) dos $(REDIR)
  152. $(DEL) dos.pp
  153. crt$(PPUEXT) : ../crt.pp $(INC)/textrec.inc go32$(PPUEXT) $(SYSTEMPPU)
  154. $(COPY) ../crt.pp .
  155. $(COMPILER) crt $(REDIR)
  156. $(DEL) crt.pp
  157. objects$(PPUEXT) : $(INC)/objects.pp $(INC)/platform.inc objinc.inc $(SYSTEMPPU)
  158. $(COPY) $(INC)/objects.pp .
  159. $(COMPILER) objects.pp $(REDIR)
  160. $(DEL) objects.pp
  161. printer$(PPUEXT) : ../printer.pp $(SYSTEMPPU)
  162. $(COPY) ../printer.pp .
  163. $(COMPILER) printer.pp $(REDIR)
  164. $(DEL) printer.pp
  165. #
  166. # Other RTL Units
  167. #
  168. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMPPU)
  169. $(COPY) $(PROCINC)/cpu.pp .
  170. $(COMPILER) cpu.pp $(REDIR)
  171. $(DEL) cpu.pp
  172. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMPPU)
  173. $(COPY) $(PROCINC)/mmx.pp .
  174. $(COMPILER) mmx.pp $(REDIR)
  175. $(DEL) mmx.pp
  176. mouse$(PPUEXT) : ../mouse.pp $(SYSTEMPPU)
  177. $(COPY) ../mouse.pp .
  178. $(COMPILER) mouse.pp $(REDIR)
  179. $(DEL) mouse.pp
  180. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMPPU)
  181. $(COPY) $(INC)/getopts.pp .
  182. $(COMPILER) getopts.pp $(REDIR)
  183. $(DEL) getopts.pp
  184. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMPPU)
  185. $(COPY) $(INC)/heaptrc.pp .
  186. $(COMPILER) heaptrc $(REDIR)
  187. $(DEL) heaptrc.pp
  188. PPIFILES:=$(wildcard $(PPI)/*.ppi)
  189. graph$(PPUEXT) : ../graph.pp go32$(PPUEXT) $(SYSTEMPPU) mmx$(PPUEXT) $(PPIFILES)
  190. $(COPY) ../graph.pp .
  191. $(COMPILER) -I$(PPI) graph $(REDIR)
  192. $(DEL) graph.pp
  193. #####################################################################
  194. # Libs
  195. #####################################################################
  196. staticlib:
  197. make libsclean
  198. make all SMARTLINK=YES LIBNAME=fpc LIBTYPE=static
  199. sharedlib:
  200. @echo Shared Libraries not supported for Go32v2
  201. staticlibinstall: staticlib
  202. $(MKDIR) $(STATIC_LIBINSTALLDIR)
  203. $(MKDIR) $(STATIC_UNITINSTALLDIR)
  204. $(INSTALLEXE) *$(STATICLIBEXT) $(STATIC_LIBINSTALLDIR)
  205. $(INSTALL) *$(PPUEXT) *$(OEXT) $(STATIC_UNITINSTALLDIR)
  206. sharedlibinstall: sharedlib
  207. libinstall: staticlibinstall
  208. libsclean : clean
  209. -$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  210. #####################################################################
  211. # Default targets
  212. #####################################################################
  213. include $(CFG)/makefile.def
  214. #
  215. # $Log$
  216. # Revision 1.7 1998-10-11 13:45:05 michael
  217. # + Added disk.inc to sysutils dependencies
  218. #
  219. # Revision 1.6 1998/10/11 12:21:48 michael
  220. # + Further sysutils implementations.
  221. #
  222. # Revision 1.5 1998/10/06 22:10:30 peter
  223. # + heaptrc
  224. #
  225. # Revision 1.4 1998/10/02 09:26:00 peter
  226. # * fixed rtl path
  227. #
  228. # Revision 1.3 1998/09/16 16:47:27 peter
  229. # * merged fixes
  230. #
  231. # Revision 1.1.2.2 1998/09/16 16:17:50 peter
  232. # * updates to install with go32,win32
  233. #
  234. # Revision 1.2 1998/09/15 12:09:09 peter
  235. # * merged updates
  236. #
  237. # Revision 1.1.2.1 1998/09/15 12:02:03 peter
  238. # * updates to get objpas using its own makefile
  239. #
  240. # Revision 1.1 1998/09/10 14:13:28 peter
  241. # * renamed
  242. #
  243. # Revision 1.16 1998/09/10 10:20:41 florian
  244. # * fixed typo of previous commit
  245. #
  246. # Revision 1.15 1998/09/10 10:16:52 florian
  247. # * make staticlib does now a make libclean instead of make clean
  248. #
  249. # Revision 1.14 1998/08/20 08:08:37 pierre
  250. # * dpmiexcp did not compile with older versions
  251. # due to the proc to procvar bug
  252. # * makefile separator problem fixed
  253. #
  254. # Revision 1.13 1998/08/19 10:05:01 peter
  255. # * fixed for go32v2 staticlib
  256. #
  257. # Revision 1.12 1998/08/05 10:31:05 pierre
  258. # + added BUGFIX test to be able to compile bugfix branch
  259. #
  260. # Revision 1.11 1998/07/29 15:44:37 michael
  261. # included sysutils and math.pp as target. They compile now.
  262. #
  263. # Revision 1.10 1998/07/22 21:37:03 michael
  264. # make cycle now works
  265. #
  266. # Revision 1.9 1998/05/22 00:39:36 peter
  267. # * go32v1, go32v2 recompiles with the new objects
  268. # * remake3 works again with go32v2
  269. # - removed some "optimizes" from daniel which were wrong
  270. #
  271. # Revision 1.8 1998/05/06 11:53:40 peter
  272. # * update
  273. #
  274. #