makefile 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  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. # set the directory where to install the units.
  23. ifndef UNITINSTALLDIR
  24. UNITINSTALLDIR=c:\lib\ppc\go32v2
  25. endif
  26. # set the directory where to install libraries
  27. ifndef LIBINSTALLDIR
  28. LIBINSTALLDIR=c:\lib
  29. endif
  30. # What is the Operating System
  31. ifndef OS_SRC
  32. OS_SRC=GO32V2
  33. endif
  34. # What is the target operating system ?
  35. ifndef OS_TARGET
  36. OS_TARGET=GO32V2
  37. endif
  38. # What is the target processor :
  39. ifndef CPU
  40. CPU=i386
  41. #CPU=m68k
  42. endif
  43. # What compiler to use ?
  44. # I think ppc386 is better (it's mostly in path) (FK)
  45. ifndef PP
  46. PP=ppc386
  47. endif
  48. # What options to pass to the compiler ?
  49. # You may want to specify a config file or error definitions file here.
  50. ifndef OPT
  51. OPT=
  52. endif
  53. # Where is the ppumove program ?
  54. ifndef PPUMOVE
  55. PPUMOVE=ppumove
  56. endif
  57. #####################################################################
  58. # End of configurable section.
  59. # Do not edit after this line.
  60. #####################################################################
  61. # Where are the include files
  62. INC=../../inc
  63. PROCINC=../../$(CPU)
  64. OBJPASDIR=../../objpas
  65. # Where are the .ppi files.
  66. PPI=../ppi
  67. # To copy pograms
  68. ifndef COPY
  69. ifeq ($(DOS),YES)
  70. COPY=copy
  71. else
  72. COPY=cp -p
  73. endif
  74. endif
  75. # Check delete program
  76. ifndef DEL
  77. ifeq ($(DOS),YES)
  78. DEL=del
  79. else
  80. DEL=rm -f
  81. endif
  82. endif
  83. # To install files
  84. ifndef INSTALL
  85. ifeq ($(DOS),YES)
  86. INSTALL=copy
  87. else
  88. INSTALL=install -m 644
  89. endif
  90. endif
  91. # To install programs
  92. ifndef INSTALLEXE
  93. ifeq ($(DOS),YES)
  94. INSTALLEXE=copy
  95. else
  96. INSTALLEXE=install -m 755
  97. endif
  98. endif
  99. # To make a directory.
  100. ifndef MKDIR
  101. ifeq ($(DOS),YES)
  102. MKDIR=mkdir
  103. else
  104. MKDIR=install -m 755 -d
  105. endif
  106. endif
  107. # diff program
  108. ifndef REFPATH
  109. REFPATH=/usr/local/fpk/work/new/rtl
  110. endif
  111. ifndef DIFF
  112. DIFF=diff
  113. endif
  114. ifndef DIFFOPTS
  115. DIFFOPTS=-b -c
  116. endif
  117. #
  118. # System independent Commandline Options
  119. #
  120. # Cross compiling ?
  121. ifeq ($(OS_TARGET),$(OS_SRC))
  122. CROSSCOMPILE=NO
  123. else
  124. CROSSCOMPILE=YES
  125. endif
  126. # add required options... (-dFPC is required for older versions)
  127. override OPT:= $(OPT) -dFPC -d$(CPU)
  128. # Was a config file specified ?
  129. ifdef CFGFILE
  130. override OPT:=$(OPT) @$(CFGFILE)
  131. endif
  132. # Check for crosscompile
  133. ifeq ($(CROSSCOMPILE),YES)
  134. override OPT:= $(OPT) -dCROSSCOMPILE -T$(OS_TARGET)
  135. endif
  136. #
  137. # System dependent Commandline Options
  138. #
  139. #####################################################################
  140. # System dependent
  141. #####################################################################
  142. # Determine needed extensions
  143. PPUEXT=.ppu
  144. PPLEXT=.ppl
  145. OEXT=.o
  146. ASMEXT=.s
  147. LIBEXT=.a
  148. # Define Linux Units
  149. SYSTEMPPU=system$(PPUEXT)
  150. OBJECTS=strings go32 objpas \
  151. dpmiexcp profile dxeload emu387 \
  152. dos crt objects printer \
  153. cpu mmx mouse getopts graph \
  154. LOADERS=prt0 exceptn fpu
  155. #####################################################################
  156. # System independent Makefile
  157. #####################################################################
  158. # OS Independent Depends
  159. SYSTEMDEPS=system.inc systemh.inc mathh.inc real2str.inc \
  160. heaph.inc innr.inc sstrings.inc file.inc
  161. SYSTEMDEPS2=text.inc typefile.inc version.inc filerec.inc \
  162. textrec.inc
  163. # Processor Dependent Depends
  164. SYSPROCDEPS=math.inc set.inc heap.inc $(CPU).inc
  165. # Add Prefix and Suffixes
  166. OBJLOADERS=$(addsuffix $(OEXT), $(LOADERS))
  167. PPUOBJECTS=$(addsuffix $(PPUEXT), $(OBJECTS))
  168. DSYSTEMDEPS=$(addprefix $(INC)/, $(SYSTEMDEPS))
  169. DSYSTEMDEPS2=$(addprefix $(INC)/, $(SYSTEMDEPS2))
  170. DSYSPROCDEPS=$(addprefix $(PROCINC)/, $(SYSPROCDEPS))
  171. .PHONY : all install clean \
  172. libs libsclean \
  173. diffs diffclean \
  174. all : $(OBJLOADERS) $(PPUOBJECTS)
  175. install : all
  176. $(MKDIR) $(UNITINSTALLDIR)
  177. $(INSTALL) *$(PPUEXT) *$(OEXT) $(UNITINSTALLDIR)
  178. clean :
  179. -$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) *.PPS log
  180. #####################################################################
  181. # Files
  182. #####################################################################
  183. #
  184. # Loaders
  185. #
  186. prt0$(OEXT) : v2prt0.as
  187. as -o prt0$(OEXT) v2prt0.as
  188. exceptn$(OEXT) : exceptn.as
  189. as -o exceptn$(OEXT) exceptn.as
  190. fpu$(OEXT) : fpu.as
  191. as -o fpu$(OEXT) fpu.as
  192. #
  193. # Base Units (System, strings, os-dependent-base-unit)
  194. #
  195. $(SYSTEMPPU) : system.pp $(DSYSTEMDEPS) $(DSYSPROCDEPS)
  196. $(COPY) $(DSYSTEMDEPS) .
  197. $(COPY) $(DSYSTEMDEPS2) .
  198. $(COPY) $(DSYSPROCDEPS) .
  199. $(PP) $(OPT) -Us -Sg system.pp $(REDIR)
  200. $(DEL) $(SYSTEMDEPS)
  201. $(DEL) $(SYSTEMDEPS2)
  202. $(DEL) $(SYSPROCDEPS)
  203. strings$(PPUEXT) : $(PROCINC)/strings.pp $(SYSTEMPPU)
  204. $(COPY) $(PROCINC)/strings.pp .
  205. $(PP) $(OPT) strings.pp $(REDIR)
  206. $(DEL) strings.pp
  207. go32$(PPUEXT) : ../go32.pp $(SYSTEMPPU)
  208. $(COPY) ../go32.pp .
  209. $(PP) $(OPT) go32.pp $(REDIR)
  210. $(DEL) go32.pp
  211. #
  212. # Delphi Object Model
  213. #
  214. objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(SYSTEMPPU)
  215. $(COPY) $(OBJPASDIR)/objpas.pp .
  216. -$(PP) $(OPT) objpas.pp $(REDIR)
  217. $(DEL) objpas.pp
  218. #
  219. # System Dependent Units
  220. #
  221. dpmiexcp$(PPUEXT) : dpmiexcp.pp exceptn$(OEXT) $(SYSTEMPPU)
  222. $(PP) $(OPT) -Sg dpmiexcp.pp $(REDIR)
  223. profile$(PPUEXT) : profile.pp dpmiexcp$(PPUEXT) go32$(PPUEXT) $(SYSTEMPPU)
  224. $(PP) $(OPT) profile.pp $(REDIR)
  225. dxeload$(PPUEXT) : $(SYSTEMPPU)
  226. $(PP) $(OPT) dxeload.pp $(REDIR)
  227. emu387$(PPUEXT) : emu387.pp fpu$(OEXT) strings$(PPUEXT) dxeload$(PPUEXT) \
  228. dpmiexcp$(PPUEXT) $(SYSTEMPPU)
  229. $(PP) $(OPT) emu387.pp $(REDIR)
  230. #
  231. # TP7 Compatible RTL Units
  232. #
  233. dos$(PPUEXT) : ../dos.pp $(INC)/filerec.inc $(INC)/textrec.inc \
  234. go32$(PPUEXT) strings$(PPUEXT) $(SYSTEMPPU)
  235. $(COPY) ../dos.pp $(INC)/filerec.inc $(INC)/textrec.inc .
  236. $(PP) $(OPT) dos $(REDIR)
  237. $(DEL) dos.pp filerec.inc textrec.inc
  238. crt$(PPUEXT) : ../crt.pp $(INC)/textrec.inc go32$(PPUEXT) $(SYSTEMPPU)
  239. $(COPY) ../crt.pp $(INC)/textrec.inc .
  240. $(PP) $(OPT) crt $(REDIR)
  241. $(DEL) crt.pp textrec.inc
  242. objects$(PPUEXT) : ../objects.pp $(SYSTEMPPU)
  243. $(COPY) ../objects.pp .
  244. $(PP) $(OPT) objects.pp $(REDIR)
  245. $(DEL) objects.pp
  246. printer$(PPUEXT) : ../printer.pp $(SYSTEMPPU)
  247. $(COPY) ../printer.pp .
  248. $(PP) $(OPT) printer.pp $(REDIR)
  249. $(DEL) printer.pp
  250. #
  251. # Other RTL Units
  252. #
  253. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMPPU)
  254. $(COPY) $(PROCINC)/cpu.pp .
  255. $(PP) $(OPT) cpu.pp $(REDIR)
  256. $(DEL) cpu.pp
  257. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMPPU)
  258. $(COPY) $(PROCINC)/mmx.pp .
  259. $(PP) $(OPT) mmx.pp $(REDIR)
  260. $(DEL) mmx.pp
  261. mouse$(PPUEXT) : ../mouse.pp $(SYSTEMPPU)
  262. $(COPY) ../mouse.pp .
  263. $(PP) $(OPT) mouse.pp $(REDIR)
  264. $(DEL) mouse.pp
  265. getopts$(PPUEXT) : $(PROCINC)/getopts.pp $(SYSTEMPPU)
  266. $(COPY) $(PROCINC)/getopts.pp .
  267. $(PP) $(OPT) getopts.pp $(REDIR)
  268. $(DEL) getopts.pp
  269. graph$(PPUEXT) : ../graph.pp go32$(PPUEXT) $(SYSTEMPPU) mmx$(PPUEXT) \
  270. $(PPI)/arc.ppi $(PPI)/colors.ppi $(PPI)/dpmi2raw.ppi $(PPI)/ellipse.ppi \
  271. $(PPI)/fill.ppi $(PPI)/font.ppi $(PPI)/global.ppi $(PPI)/ibm.ppi \
  272. $(PPI)/image.ppi $(PPI)/line.ppi $(PPI)/modes.ppi $(PPI)/move.ppi \
  273. $(PPI)/palette.ppi $(PPI)/pixel.ppi $(PPI)/stdcolor.ppi $(PPI)/text.ppi \
  274. $(PPI)/triangle.ppi $(PPI)/vesadeb.ppi
  275. $(COPY) ../graph.pp $(PPI)/*.ppi .
  276. $(PP) $(OPT) graph $(REDIR)
  277. $(DEL) graph.pp *.ppi
  278. #####################################################################
  279. # Libs
  280. #####################################################################
  281. libs: all libfpc$(LIBEXT)
  282. libfpc.a:
  283. $(PPUMOVE) -s -o fpc *.ppu
  284. libsclean : clean
  285. -$(DEL) *.$(LIBEXT) *$(PPLEXT)
  286. libinstall: libs
  287. $(INSTALL) libfpc$(LIBEXT) $(LIBINSTALLDIR)
  288. $(INSTALL) *$(PPLEXT) $(UNITINSTALLDIR)
  289. #####################################################################
  290. # Diffs
  291. #####################################################################
  292. %.dif : %.pp
  293. -$(DIFF) $(DIFFOPTS) $*.pp $(REFPATH)/dos/go32v2/$*.pp > $*.dif
  294. %.dif : %.inc
  295. -$(DIFF) $(DIFFOPTS) $*.inc $(REFPATH)/dos/go32v2/$*.inc > $*.dif
  296. %.dif : %.as
  297. -$(DIFF) $(DIFFOPTS) $*.as $(REFPATH)/dos/go32v2/$*.as > $*.dif
  298. %.dif : %.asm
  299. -$(DIFF) $(DIFFOPTS) $*.asm $(REFPATH)/dos/go32v2/$*.asm > $*.dif
  300. diffclean:
  301. -$(DEL) *.dif
  302. makefile.dif : makefile
  303. -$(DIFF) $(DIFFOPTS) makefile $(REFPATH)/dos/go32v2/makefile > makefile.dif
  304. diffs: system.dif v2prt0.dif dpmiexcp.dif exceptn.dif profile.dif os.dif \
  305. sbrk16.dif exit16.dif makefile.dif
  306. #####################################################################
  307. # Distribution
  308. #####################################################################
  309. distclean : clean libsclean diffclean