makefile 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  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. # Start of configurable section.
  17. # Please note that all these must be set in the main makefile, and
  18. # should be set there.
  19. # Don't remove the indef statements. They serve to avoid conflicts
  20. # with the main makefile.
  21. #####################################################################
  22. # What is the Operating System
  23. ifndef OS_SOURCE
  24. OS_SOURCE=GO32V2
  25. endif
  26. # What is the target operating system ?
  27. ifndef OS_TARGET
  28. OS_TARGET=GO32V2
  29. endif
  30. # What is the target processor :
  31. ifndef CPU
  32. CPU=i386
  33. #CPU=m68k
  34. endif
  35. # What compiler to use ?
  36. # I think ppc386 is better (it's mostly in path) (FK)
  37. ifndef PP
  38. PP=ppc386
  39. endif
  40. # What options to pass to the compiler ?
  41. # You may want to specify a config file or error definitions file here.
  42. ifndef OPT
  43. OPT=
  44. endif
  45. # Where is the ppumove program ?
  46. ifndef PPUMOVE
  47. PPUMOVE=ppumove
  48. endif
  49. #####################################################################
  50. # End of configurable section.
  51. # Do not edit after this line.
  52. #####################################################################
  53. # Where are the include files
  54. INC=../../inc
  55. PROCINC=../../$(CPU)
  56. CFG=../../cfg
  57. OBJPASDIR=../../objpas
  58. # Where are the .ppi files.
  59. PPI=../ppi
  60. # Get some defaults for Programs and OSes.
  61. # This will set the following variables :
  62. # inlinux indos COPY REPLACE DEL INSTALL INSTALLEXE MKDIR
  63. # It will also set OPT for cross-compilation, and add required options.
  64. # also checks for config file.
  65. # it expects INC PROCINC to be set !!
  66. include $(CFG)/makefile.cfg
  67. override COPY=cp
  68. override DEL=rm
  69. # Get the system independent include file names.
  70. # This will set the following variables :
  71. # SYSINCNAMES
  72. include $(INC)/makefile.inc
  73. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  74. # Get the processor dependent include file names.
  75. # This will set the following variables :
  76. # CPUINCNAMES
  77. include $(PROCINC)/makefile.cpu
  78. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  79. # Put system unit dependencies together.
  80. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  81. #####################################################################
  82. # System dependent
  83. #####################################################################
  84. # Define Go32v2 Units
  85. SYSTEMPPU=system$(PPUEXT)
  86. # BUGFIX branch cannot handle sysutils
  87. ifndef BUGFIX
  88. OBJECTS=strings go32 objpas sysutils math\
  89. dpmiexcp profile dxeload emu387 \
  90. dos crt objects printer \
  91. cpu mmx mouse getopts graph
  92. else
  93. OBJECTS=strings go32 objpas math\
  94. dpmiexcp profile dxeload emu387 \
  95. dos crt objects printer \
  96. cpu mmx mouse getopts graph
  97. endif
  98. LOADERS=prt0 exceptn fpu
  99. #####################################################################
  100. # System independent Makefile
  101. #####################################################################
  102. # Add Prefix and Suffixes
  103. OBJLOADERS=$(addsuffix $(OEXT), $(LOADERS))
  104. PPUOBJECTS=$(addsuffix $(PPUEXT), $(OBJECTS))
  105. .PHONY : all install clean \
  106. libs libsclean \
  107. diffs diffclean \
  108. all : $(OBJLOADERS) $(PPUOBJECTS)
  109. install : all
  110. $(MKDIR) $(BASEINSTALLDIR)
  111. $(MKDIR) $(UNITINSTALLDIR)
  112. $(INSTALL) *$(PPUEXT) *$(OEXT) $(UNITINSTALLDIR)
  113. clean :
  114. -$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) *.PPS log
  115. #####################################################################
  116. # Files
  117. #####################################################################
  118. #
  119. # Loaders
  120. #
  121. prt0$(OEXT) : v2prt0.as
  122. as -o prt0$(OEXT) v2prt0.as
  123. exceptn$(OEXT) : exceptn.as
  124. as -o exceptn$(OEXT) exceptn.as
  125. fpu$(OEXT) : fpu.as
  126. as -o fpu$(OEXT) fpu.as
  127. #
  128. # Base Units (System, strings, os-dependent-base-unit)
  129. #
  130. $(SYSTEMPPU) : system.pp $(SYSDEPS)
  131. $(PP) $(OPT) -Us -Sg system.pp $(REDIR)
  132. strings$(PPUEXT) : $(PROCINC)/strings.pp $(SYSTEMPPU)
  133. $(COPY) $(PROCINC)/strings.pp .
  134. $(PP) $(OPT) strings.pp $(REDIR)
  135. $(DEL) strings.pp
  136. go32$(PPUEXT) : ../go32.pp $(SYSTEMPPU)
  137. $(COPY) ../go32.pp .
  138. $(PP) $(OPT) go32.pp $(REDIR)
  139. $(DEL) go32.pp
  140. #
  141. # Delphi Object Model
  142. #
  143. objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(SYSTEMPPU)
  144. $(COPY) $(OBJPASDIR)/objpas.pp .
  145. -$(PP) $(OPT) objpas.pp $(REDIR)
  146. $(DEL) objpas.pp
  147. sysutils$(PPUEXT) : $(OBJPASDIR)/sysutils.pp $(SYSTEMPPU) objpas$(PPUEXT) \
  148. dos$(PPUEXT)
  149. $(COPY) $(OBJPASDIR)/sysutils.pp .
  150. $(PP) $(OPT) -I$(OBJPASDIR) sysutils $(REDIR)
  151. $(DEL) sysutils.pp
  152. math$(PPUEXT) : $(OBJPASDIR)/math.pp $(SYSTEMPPU) objpas$(PPUEXT) \
  153. dos$(PPUEXT)
  154. $(COPY) $(OBJPASDIR)/math.pp .
  155. $(PP) $(OPT) -I$(OBJPASDIR) math $(REDIR)
  156. $(DEL) math.pp
  157. #
  158. # System Dependent Units
  159. #
  160. dpmiexcp$(PPUEXT) : dpmiexcp.pp exceptn$(OEXT) $(SYSTEMPPU)
  161. $(PP) $(OPT) -Sg dpmiexcp.pp $(REDIR)
  162. profile$(PPUEXT) : profile.pp dpmiexcp$(PPUEXT) go32$(PPUEXT) $(SYSTEMPPU)
  163. $(PP) $(OPT) profile.pp $(REDIR)
  164. dxeload$(PPUEXT) : $(SYSTEMPPU)
  165. $(PP) $(OPT) dxeload.pp $(REDIR)
  166. emu387$(PPUEXT) : emu387.pp fpu$(OEXT) strings$(PPUEXT) dxeload$(PPUEXT) \
  167. dpmiexcp$(PPUEXT) $(SYSTEMPPU)
  168. $(PP) $(OPT) emu387.pp $(REDIR)
  169. #
  170. # TP7 Compatible RTL Units
  171. #
  172. dos$(PPUEXT) : ../dos.pp $(INC)/filerec.inc $(INC)/textrec.inc \
  173. go32$(PPUEXT) strings$(PPUEXT) $(SYSTEMPPU)
  174. $(COPY) ../dos.pp .
  175. $(PP) $(OPT) dos $(REDIR)
  176. $(DEL) dos.pp
  177. crt$(PPUEXT) : ../crt.pp $(INC)/textrec.inc go32$(PPUEXT) $(SYSTEMPPU)
  178. $(COPY) ../crt.pp .
  179. $(PP) $(OPT) crt $(REDIR)
  180. $(DEL) crt.pp
  181. objects$(PPUEXT) : $(INC)/objects.pp $(INC)/platform.inc objinc.inc $(SYSTEMPPU)
  182. $(COPY) $(INC)/objects.pp .
  183. $(PP) $(OPT) objects.pp $(REDIR)
  184. $(DEL) objects.pp
  185. printer$(PPUEXT) : ../printer.pp $(SYSTEMPPU)
  186. $(COPY) ../printer.pp .
  187. $(PP) $(OPT) printer.pp $(REDIR)
  188. $(DEL) printer.pp
  189. #
  190. # Other RTL Units
  191. #
  192. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMPPU)
  193. $(COPY) $(PROCINC)/cpu.pp .
  194. $(PP) $(OPT) cpu.pp $(REDIR)
  195. $(DEL) cpu.pp
  196. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMPPU)
  197. $(COPY) $(PROCINC)/mmx.pp .
  198. $(PP) $(OPT) mmx.pp $(REDIR)
  199. $(DEL) mmx.pp
  200. mouse$(PPUEXT) : ../mouse.pp $(SYSTEMPPU)
  201. $(COPY) ../mouse.pp .
  202. $(PP) $(OPT) mouse.pp $(REDIR)
  203. $(DEL) mouse.pp
  204. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMPPU)
  205. $(COPY) $(INC)/getopts.pp .
  206. $(PP) $(OPT) getopts.pp $(REDIR)
  207. $(DEL) getopts.pp
  208. PPIFILES:=$(wildcard $(PPI)/*.ppi)
  209. graph$(PPUEXT) : ../graph.pp go32$(PPUEXT) $(SYSTEMPPU) mmx$(PPUEXT) $(PPIFILES)
  210. $(COPY) ../graph.pp .
  211. $(PP) $(OPT) -I$(PPI) graph $(REDIR)
  212. $(DEL) graph.pp
  213. #####################################################################
  214. # Libs
  215. #####################################################################
  216. libs: all libfpc$(LIBEXT)
  217. libfpc.a:
  218. $(PPUMOVE) -s -o fpc *.ppu
  219. libsclean : clean
  220. -$(DEL) *.$(LIBEXT) *$(PPLEXT)
  221. libinstall: libs
  222. $(INSTALL) libfpc$(LIBEXT) $(LIBINSTALLDIR)
  223. $(INSTALL) *$(PPLEXT) $(UNITINSTALLDIR)
  224. #####################################################################
  225. # Default targets
  226. #####################################################################
  227. include $(CFG)/makefile.def
  228. #
  229. # $Log$
  230. # Revision 1.12 1998-08-05 10:31:05 pierre
  231. # + added BUGFIX test to be able to compile bugfix branch
  232. #
  233. # Revision 1.11 1998/07/29 15:44:37 michael
  234. # included sysutils and math.pp as target. They compile now.
  235. #
  236. # Revision 1.10 1998/07/22 21:37:03 michael
  237. # make cycle now works
  238. #
  239. # Revision 1.9 1998/05/22 00:39:36 peter
  240. # * go32v1, go32v2 recompiles with the new objects
  241. # * remake3 works again with go32v2
  242. # - removed some "optimizes" from daniel which were wrong
  243. #
  244. # Revision 1.8 1998/05/06 11:53:40 peter
  245. # * update
  246. #
  247. #