makefile 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  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 Go32v1 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\go32v1
  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=GO32V1
  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=.pp1
  144. PPLEXT=.ppl
  145. OEXT=.o1
  146. ASMEXT=.s1
  147. LIBEXT=.a1
  148. # Define Linux Units
  149. SYSTEMPPU=system$(PPUEXT)
  150. OBJECTS=strings go32 objpas \
  151. dos crt objects printer \
  152. cpu mmx mouse getopts graph \
  153. LOADERS=prt0
  154. #####################################################################
  155. # System independent Makefile
  156. #####################################################################
  157. # OS Independent Depends
  158. SYSTEMDEPS=system.inc systemh.inc mathh.inc real2str.inc \
  159. heaph.inc innr.inc sstrings.inc file.inc
  160. SYSTEMDEPS2=text.inc typefile.inc version.inc filerec.inc \
  161. textrec.inc
  162. # Processor Dependent Depends
  163. SYSPROCDEPS=math.inc set.inc heap.inc $(CPU).inc
  164. # Add Prefix and Suffixes
  165. OBJLOADERS=$(addsuffix $(OEXT), $(LOADERS))
  166. PPUOBJECTS=$(addsuffix $(PPUEXT), $(OBJECTS))
  167. DSYSTEMDEPS=$(addprefix $(INC)/, $(SYSTEMDEPS))
  168. DSYSTEMDEPS2=$(addprefix $(INC)/, $(SYSTEMDEPS2))
  169. DSYSPROCDEPS=$(addprefix $(PROCINC)/, $(SYSPROCDEPS))
  170. .PHONY : all install clean \
  171. libs libsclean \
  172. diffs diffclean \
  173. all : $(OBJLOADERS) $(PPUOBJECTS)
  174. install : all
  175. $(MKDIR) $(UNITINSTALLDIR)
  176. $(INSTALL) *$(PPUEXT) *$(OEXT) $(UNITINSTALLDIR)
  177. clean :
  178. -$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) *.PPS log
  179. #####################################################################
  180. # Files
  181. #####################################################################
  182. #
  183. # Loaders
  184. #
  185. prt0$(OEXT) : prt0.as
  186. as -D -o prt0$(OEXT) prt0.as
  187. #
  188. # Base Units (System, strings, os-dependent-base-unit)
  189. #
  190. $(SYSTEMPPU) : system.pp $(DSYSTEMDEPS) $(DSYSPROCDEPS)
  191. $(COPY) $(DSYSTEMDEPS) .
  192. $(COPY) $(DSYSTEMDEPS2) .
  193. $(COPY) $(DSYSPROCDEPS) .
  194. $(PP) $(OPT) -Us -Sg system.pp $(REDIR)
  195. $(DEL) $(SYSTEMDEPS)
  196. $(DEL) $(SYSTEMDEPS2)
  197. $(DEL) $(SYSPROCDEPS)
  198. strings$(PPUEXT) : $(PROCINC)/strings.pp $(SYSTEMPPU)
  199. $(COPY) $(PROCINC)/strings.pp .
  200. $(PP) $(OPT) strings.pp $(REDIR)
  201. $(DEL) strings.pp
  202. go32$(PPUEXT) : ../go32.pp $(SYSTEMPPU)
  203. $(COPY) ../go32.pp .
  204. $(PP) $(OPT) go32.pp $(REDIR)
  205. $(DEL) go32.pp
  206. #
  207. # Delphi Object Model
  208. #
  209. objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(SYSTEMPPU)
  210. $(COPY) $(OBJPASDIR)/objpas.pp .
  211. $(PP) $(OPT) objpas $(REDIR)
  212. $(DEL) objpas.pp
  213. #
  214. # System Dependent Units
  215. #
  216. #
  217. # TP7 Compatible RTL Units
  218. #
  219. dos$(PPUEXT) : ../dos.pp $(INC)/filerec.inc $(INC)/textrec.inc \
  220. go32$(PPUEXT) strings$(PPUEXT) $(SYSTEMPPU)
  221. $(COPY) ../dos.pp $(INC)/filerec.inc $(INC)/textrec.inc .
  222. $(PP) $(OPT) dos $(REDIR)
  223. $(DEL) dos.pp filerec.inc textrec.inc
  224. crt$(PPUEXT) : ../crt.pp $(INC)/textrec.inc go32$(PPUEXT) $(SYSTEMPPU)
  225. $(COPY) ../crt.pp $(INC)/textrec.inc .
  226. $(PP) $(OPT) crt $(REDIR)
  227. $(DEL) crt.pp textrec.inc
  228. objects$(PPUEXT) : ../objects.pp $(SYSTEMPPU)
  229. $(COPY) ../objects.pp .
  230. $(PP) $(OPT) objects.pp $(REDIR)
  231. $(DEL) objects.pp
  232. printer$(PPUEXT) : ../printer.pp $(SYSTEMPPU)
  233. $(COPY) ../printer.pp .
  234. $(PP) $(OPT) printer.pp $(REDIR)
  235. $(DEL) printer.pp
  236. #
  237. # Other RTL Units
  238. #
  239. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMPPU)
  240. $(COPY) $(PROCINC)/cpu.pp .
  241. $(PP) $(OPT) cpu.pp $(REDIR)
  242. $(DEL) cpu.pp
  243. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMPPU)
  244. $(COPY) $(PROCINC)/mmx.pp .
  245. $(PP) $(OPT) mmx.pp $(REDIR)
  246. $(DEL) mmx.pp
  247. mouse$(PPUEXT) : ../mouse.pp $(SYSTEMPPU)
  248. $(COPY) ../mouse.pp .
  249. $(PP) $(OPT) mouse.pp $(REDIR)
  250. $(DEL) mouse.pp
  251. getopts$(PPUEXT) : $(PROCINC)/getopts.pp $(SYSTEMPPU)
  252. $(COPY) $(PROCINC)/getopts.pp .
  253. $(PP) $(OPT) getopts.pp $(REDIR)
  254. $(DEL) getopts.pp
  255. graph$(PPUEXT) : ../graph.pp go32$(PPUEXT) $(SYSTEMPPU) mmx$(PPUEXT) \
  256. $(PPI)/arc.ppi $(PPI)/colors.ppi $(PPI)/dpmi2raw.ppi $(PPI)/ellipse.ppi \
  257. $(PPI)/fill.ppi $(PPI)/font.ppi $(PPI)/global.ppi $(PPI)/ibm.ppi \
  258. $(PPI)/image.ppi $(PPI)/line.ppi $(PPI)/modes.ppi $(PPI)/move.ppi \
  259. $(PPI)/palette.ppi $(PPI)/pixel.ppi $(PPI)/stdcolor.ppi $(PPI)/text.ppi \
  260. $(PPI)/triangle.ppi $(PPI)/vesadeb.ppi
  261. $(COPY) ../graph.pp $(PPI)/*.ppi .
  262. $(PP) $(OPT) graph $(REDIR)
  263. $(DEL) graph.pp *.ppi
  264. #####################################################################
  265. # Libs
  266. #####################################################################
  267. libs: all
  268. libsclean : clean
  269. -$(DEL) *.$(LIBEXT) *$(PPLEXT)
  270. #####################################################################
  271. # Diffs
  272. #####################################################################
  273. %.dif : %.pp
  274. -$(DIFF) $(DIFFOPTS) $*.pp $(REFPATH)/dos/go32v1/$*.pp > $*.dif
  275. %.dif : %.inc
  276. -$(DIFF) $(DIFFOPTS) $*.inc $(REFPATH)/dos/go32v1/$*.inc > $*.dif
  277. %.dif : %.as
  278. -$(DIFF) $(DIFFOPTS) $*.as $(REFPATH)/dos/go32v1/$*.as > $*.dif
  279. diffclean:
  280. -$(DEL) *.dif
  281. makefile.dif : makefile
  282. -$(DIFF) $(DIFFOPTS) makefile $(REFPATH)/dos/go32v1/makefile > makefile.dif
  283. diffs: system.dif os.dif makefile.dif prt0.dif
  284. #####################################################################
  285. # Distribution
  286. #####################################################################
  287. distclean : clean libsclean diffclean