makefile 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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. CFG=../../cfg
  63. INC=../../inc
  64. PROCINC=../../$(CPU)
  65. OBJPASDIR=../../objpas
  66. # Where are the .ppi files.
  67. PPI=../ppi
  68. # Get some defaults for Programs and OSes.
  69. # This will set the following variables :
  70. # inlinux indos COPY REPLACE DEL INSTALL INSTALLEXE MKDIR
  71. # It will also set OPT for cross-compilation, and add required options.
  72. # also checks for config file.
  73. # it expects INC PROCINC to be set !!
  74. include $(CFG)/makefile.cfg
  75. # Get the system independent include file names.
  76. # This will set the following variables :
  77. # SYSINCNAMES
  78. include $(INC)/makefile.inc
  79. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  80. # Get the processor dependent include file names.
  81. # This will set the following variables :
  82. # CPUINCNAMES
  83. include $(PROCINC)/makefile.cpu
  84. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  85. # Get the PPI file names
  86. # This sets the variable name PPIINCNAMES
  87. include $(PPI)/makefile.ppi
  88. PPIDEPS=$(addprefix $(PPI)/,$(PPIINCNAMES))
  89. # Put system unit dependencies together.
  90. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  91. #####################################################################
  92. # System dependent
  93. #####################################################################
  94. # Determine needed extensions
  95. PPUEXT=.pp1
  96. PPLEXT=.ppl
  97. OEXT=.o1
  98. ASMEXT=.s1
  99. LIBEXT=.a1
  100. # Define Linux Units
  101. SYSTEMPPU=system$(PPUEXT)
  102. OBJECTS=strings go32 objpas \
  103. dos crt objects printer \
  104. cpu mmx mouse getopts graph \
  105. LOADERS=prt0
  106. #####################################################################
  107. # System independent Makefile
  108. #####################################################################
  109. # Add Prefix and Suffixes
  110. OBJLOADERS=$(addsuffix $(OEXT), $(LOADERS))
  111. PPUOBJECTS=$(addsuffix $(PPUEXT), $(OBJECTS))
  112. .PHONY : all install clean \
  113. libs libsclean \
  114. diffs diffclean \
  115. all : $(OBJLOADERS) $(PPUOBJECTS)
  116. install : all
  117. $(MKDIR) $(UNITINSTALLDIR)
  118. $(INSTALL) *$(PPUEXT) *$(OEXT) $(UNITINSTALLDIR)
  119. clean :
  120. -$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) *.PPS log
  121. #####################################################################
  122. # Files
  123. #####################################################################
  124. #
  125. # Loaders
  126. #
  127. prt0$(OEXT) : prt0.as
  128. as -D -o prt0$(OEXT) prt0.as
  129. #
  130. # Base Units (System, strings, os-dependent-base-unit)
  131. #
  132. $(SYSTEMPPU) : system.pp $(SYSDEPS)
  133. $(PP) $(OPT) -Us -Sg system.pp $(REDIR)
  134. strings$(PPUEXT) : $(PROCINC)/strings.pp $(SYSTEMPPU)
  135. $(COPY) $(PROCINC)/strings.pp .
  136. $(PP) $(OPT) strings.pp $(REDIR)
  137. $(DEL) strings.pp
  138. go32$(PPUEXT) : ../go32.pp $(SYSTEMPPU)
  139. $(COPY) ../go32.pp .
  140. $(PP) $(OPT) go32.pp $(REDIR)
  141. $(DEL) go32.pp
  142. #
  143. # Delphi Object Model
  144. #
  145. objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(SYSTEMPPU)
  146. $(COPY) $(OBJPASDIR)/objpas.pp .
  147. $(PP) $(OPT) objpas $(REDIR)
  148. $(DEL) objpas.pp
  149. #
  150. # System Dependent Units
  151. #
  152. #
  153. # TP7 Compatible RTL Units
  154. #
  155. dos$(PPUEXT) : ../dos.pp $(INC)/filerec.inc $(INC)/textrec.inc \
  156. go32$(PPUEXT) strings$(PPUEXT) $(SYSTEMPPU)
  157. $(COPY) ../dos.pp .
  158. $(PP) $(OPT) dos $(REDIR)
  159. $(DEL) dos.pp
  160. crt$(PPUEXT) : ../crt.pp $(INC)/textrec.inc go32$(PPUEXT) $(SYSTEMPPU)
  161. $(COPY) ../crt.pp .
  162. $(PP) $(OPT) crt $(REDIR)
  163. $(DEL) crt.pp
  164. objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
  165. $(COPY) $(INC)/objects.pp .
  166. $(PP) $(OPT) objects.pp $(REDIR)
  167. $(DEL) objects.pp
  168. printer$(PPUEXT) : ../printer.pp $(SYSTEMPPU)
  169. $(COPY) ../printer.pp .
  170. $(PP) $(OPT) printer.pp $(REDIR)
  171. $(DEL) printer.pp
  172. #
  173. # Other RTL Units
  174. #
  175. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMPPU)
  176. $(COPY) $(PROCINC)/cpu.pp .
  177. $(PP) $(OPT) cpu.pp $(REDIR)
  178. $(DEL) cpu.pp
  179. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMPPU)
  180. $(COPY) $(PROCINC)/mmx.pp .
  181. $(PP) $(OPT) mmx.pp $(REDIR)
  182. $(DEL) mmx.pp
  183. mouse$(PPUEXT) : ../mouse.pp $(SYSTEMPPU)
  184. $(COPY) ../mouse.pp .
  185. $(PP) $(OPT) mouse.pp $(REDIR)
  186. $(DEL) mouse.pp
  187. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMPPU)
  188. $(COPY) $(INC)/getopts.pp .
  189. $(PP) $(OPT) getopts.pp $(REDIR)
  190. $(DEL) getopts.pp
  191. PPIFILES:=$(wildcard $(PPI)/*.ppi)
  192. graph$(PPUEXT) : ../graph.pp go32$(PPUEXT) $(SYSTEMPPU) mmx$(PPUEXT) $(PPIFILES)
  193. $(COPY) ../graph.pp .
  194. $(PP) $(OPT) -I$(PPI) graph $(REDIR)
  195. $(DEL) graph.pp
  196. #####################################################################
  197. # Libs
  198. #####################################################################
  199. libs: all
  200. libsclean : clean
  201. -$(DEL) *.$(LIBEXT) *$(PPLEXT)
  202. #####################################################################
  203. # Diffs
  204. #####################################################################
  205. %.dif : %.pp
  206. -$(DIFF) $(DIFFOPTS) $*.pp $(REFPATH)/dos/go32v1/$*.pp > $*.dif
  207. %.dif : %.inc
  208. -$(DIFF) $(DIFFOPTS) $*.inc $(REFPATH)/dos/go32v1/$*.inc > $*.dif
  209. %.dif : %.as
  210. -$(DIFF) $(DIFFOPTS) $*.as $(REFPATH)/dos/go32v1/$*.as > $*.dif
  211. diffclean:
  212. -$(DEL) *.dif
  213. makefile.dif : makefile
  214. -$(DIFF) $(DIFFOPTS) makefile $(REFPATH)/dos/go32v1/makefile > makefile.dif
  215. diffs: system.dif os.dif makefile.dif prt0.dif
  216. #####################################################################
  217. # Distribution
  218. #####################################################################
  219. distclean : clean libsclean diffclean