makefile 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. # Makefile for the DOS Go32v2 Run-time library.
  2. # we need the stupid copies and del because the old FPK Pascal doesn't handle
  3. # ppc386 ..\crt correct..
  4. #
  5. #####################################################################
  6. # Start of configurable section.
  7. # Please note that all these must be set in the main makefile, and
  8. # should be set there.
  9. # Don't remove the indef statements. They serve to avoid conflicts
  10. # with the main makefile.
  11. #####################################################################
  12. # set the directory where to install the units.
  13. ifndef UNITINSTALLDIR
  14. UNITINSTALLDIR=c:\lib\ppc
  15. endif
  16. # set the directory where to install libraries
  17. ifndef LIBINSTALLDIR
  18. LIBINSTALLDIR=c:\lib
  19. endif
  20. # What is the Operating System
  21. ifndef OS_SRC
  22. OS_SRC=GO32V2
  23. endif
  24. # What is the target operating system ?
  25. ifndef OS_TARGET
  26. OS_TARGET=GO32V2
  27. endif
  28. # What compiler to use ?
  29. # I think ppc386 is better (it's mostly in path) (FK)
  30. ifndef PP
  31. PP=ppc386
  32. endif
  33. # What options to pass to the compiler ?
  34. # You may want to specify a config file or error definitions file here.
  35. ifndef OPT
  36. OPT=
  37. endif
  38. # Where is the ppumove program ?
  39. ifndef PPUMOVE
  40. PPUMOVE=ppumove
  41. endif
  42. #####################################################################
  43. # End of configurable section.
  44. # Do not edit after this line.
  45. #####################################################################
  46. # Where are the include files
  47. INC=../../inc
  48. ifndef CPU
  49. CPU=i386
  50. endif
  51. PROCINC=../../$(CPU)
  52. # Where are the .ppi files.
  53. PPI=../ppi
  54. ifeq ($(OS_TARGET),$(OS_SRC))
  55. CROSSCOMPILE=NO
  56. else
  57. CROSSCOMPILE=YES
  58. endif
  59. # To copy pograms
  60. ifndef COPY
  61. COPY=cp -p
  62. endif
  63. # To delete programs
  64. ifndef DEL
  65. ifeq ($(DOS),YES)
  66. DEL=del
  67. else
  68. DEL=rm
  69. endif
  70. endif
  71. # To install programs
  72. ifndef INSTALL
  73. ifeq ($(DOS),YES)
  74. INSTALL=cp
  75. else
  76. INSTALL=install -m 644
  77. endif
  78. endif
  79. ifndef MKDIR
  80. ifeq ($(DOS),YES)
  81. MKDIR=mkdir
  82. else
  83. MKDIR=install -m 755 -d
  84. endif
  85. endif
  86. # Check for crosscompile
  87. ifeq ($(CROSSCOMPILE),YES)
  88. OPT:=$(OPT) -dCROSSCOMPILE -T$(OS_TARGET)
  89. endif
  90. # check config file
  91. ifdef CFGFILE
  92. OPT:=$(OPT) @$(CFGFILE)
  93. endif
  94. # to be sure to be able to compile with an older
  95. # compiler version
  96. OPT:=$(OPT) -dFPC
  97. # diff program
  98. ifndef REFPATH
  99. REFPATH=h:/cvs/rtl
  100. endif
  101. ifndef DIFF
  102. DIFF=diff
  103. endif
  104. ifndef DIFFOPTS
  105. DIFFOPTS=-b -c
  106. endif
  107. # os independent depends
  108. SYSTEMDEPS=$(INC)/system.inc $(INC)/systemh.inc $(INC)/mathh.inc $(INC)/real2str.inc \
  109. $(INC)/heaph.inc $(INC)/innr.inc $(INC)/sstrings.inc $(INC)/file.inc \
  110. $(INC)/text.inc $(INC)/typefile.inc $(INC)/version.inc $(INC)/filerec.inc \
  111. $(INC)/textrec.inc $(INC)/objpas.inc $(INC)/objpash.inc \
  112. $(PROCINC)/math.inc $(PROCINC)/set.inc $(PROCINC)/heap.inc $(PROCINC)/$(CPU).inc
  113. PPUEXT=.ppu
  114. PPLEXT=.ppl
  115. # At this moment only static libs under go32v2. When shared libs are made then
  116. # we should ask what kind of lib user wants, and then set the correct
  117. # extension... (see linux makefile for example)
  118. LIBEXT=.a
  119. OEXT=.o
  120. .PHONY: all clean install diffs diffclean
  121. all : system$(PPUEXT) prt0$(OEXT) crt$(PPUEXT) go32$(PPUEXT) strings$(PPUEXT) \
  122. dos$(PPUEXT) printer$(PPUEXT) objects$(PPUEXT) \
  123. mouse$(PPUEXT) fmouse$(PPUEXT) getopts$(PPUEXT) graph$(PPUEXT) \
  124. dpmiexcp$(PPUEXT) exceptn$(OEXT) profile$(PPUEXT) \
  125. dxeload$(PPUEXT) fpu$(OEXT) emu387$(PPUEXT) mmx$(PPUEXT) cpu$(PPUEXT) \
  126. objpas$(PPUEXT)
  127. dxeload$(PPUEXT) : system$(PPUEXT)
  128. $(PP) $(OPT) dxeload $(REDIR)
  129. emu387$(PPUEXT) : system$(PPUEXT) fpu$(OEXT) dxeload$(PPUEXT) dpmiexcp$(PPUEXT)
  130. $(PP) $(OPT) emu387 $(REDIR)
  131. fpu$(OEXT) : fpu.as
  132. as -o fpu$(OEXT) fpu.as
  133. printer$(PPUEXT) : ../printer.pp system$(PPUEXT)
  134. $(COPY) ../printer.pp .
  135. $(PP) $(OPT) printer $(REDIR)
  136. $(DEL) printer.pp
  137. getopts$(PPUEXT) : $(PROCINC)/getopts.pp system$(PPUEXT)
  138. $(COPY) $(PROCINC)/getopts.pp .
  139. $(PP) $(OPT) getopts $(REDIR)
  140. $(DEL) getopts.pp
  141. graph$(PPUEXT) : ../graph.pp mmx$(PPUEXT) go32$(PPUEXT) system$(PPUEXT) \
  142. $(PPI)/arc.ppi $(PPI)/colors.ppi $(PPI)/dpmi2raw.ppi $(PPI)/ellipse.ppi \
  143. $(PPI)/fill.ppi $(PPI)/font.ppi $(PPI)/global.ppi $(PPI)/ibm.ppi \
  144. $(PPI)/image.ppi $(PPI)/line.ppi $(PPI)/modes.ppi $(PPI)/move.ppi \
  145. $(PPI)/palette.ppi $(PPI)/pixel.ppi $(PPI)/stdcolor.ppi $(PPI)/text.ppi \
  146. $(PPI)/triangle.ppi $(PPI)/vesadeb.ppi
  147. $(COPY) ../graph.pp $(PPI)/*.ppi .
  148. $(PP) $(OPT) graph $(REDIR)
  149. $(DEL) graph.pp *.ppi
  150. strings$(PPUEXT) : $(PROCINC)/strings.pp system$(PPUEXT)
  151. $(COPY) $(PROCINC)/strings.pp .
  152. $(PP) $(OPT) strings $(REDIR)
  153. $(DEL) strings.pp
  154. dos$(PPUEXT) : ../dos.pp $(INC)/filerec.inc $(INC)/textrec.inc \
  155. go32$(PPUEXT) system$(PPUEXT) strings$(PPUEXT)
  156. $(COPY) ../dos.pp $(INC)/filerec.inc $(INC)/textrec.inc .
  157. $(PP) $(OPT) dos $(REDIR)
  158. $(DEL) dos.pp filerec.inc textrec.inc
  159. exceptn$(OEXT) : exceptn.as
  160. as -o exceptn$(OEXT) exceptn.as
  161. # gcc not need anymore
  162. # gcc -c -x assembler-with-cpp -o exceptn$(OEXT) exceptn.AS
  163. dpmiexcp$(PPUEXT) : dpmiexcp.pp exceptn$(OEXT)
  164. $(PP) $(OPT) -Sg dpmiexcp $(REDIR)
  165. profile$(PPUEXT) : profile.pp dpmiexcp$(PPUEXT) go32$(PPUEXT)
  166. $(PP) $(OPT) profile $(REDIR)
  167. system$(PPUEXT) : system.pp $(SYSTEMDEPS)
  168. $(COPY) $(INC)/*.inc $(PROCINC)/*.inc .
  169. $(PP) $(OPT) -dI386 -Us -Sg system $(REDIR)
  170. $(DEL) systemh.inc system.inc real2str.inc version.inc $(CPU).inc sstrings.inc
  171. $(DEL) mathh.inc math.inc set.inc innr.inc heap.inc heaph.inc objpash.inc
  172. $(DEL) filerec.inc textrec.inc file.inc typefile.inc text.inc objpas.inc
  173. prt0$(OEXT) : v2prt0.as
  174. as -o prt0$(OEXT) v2prt0.as
  175. # gcc not need anymore
  176. # gcc -c -x assembler-with-cpp -o prt0$(OEXT) v2prt0.AS
  177. crt$(PPUEXT) : ../crt.pp $(INC)/textrec.inc go32$(PPUEXT) system$(PPUEXT)
  178. $(COPY) ../crt.pp $(INC)/textrec.inc .
  179. $(PP) $(OPT) crt $(REDIR)
  180. $(DEL) crt.pp textrec.inc
  181. go32$(PPUEXT) : ../go32.pp system$(PPUEXT)
  182. $(COPY) ../go32.pp .
  183. $(PP) $(OPT) go32 $(REDIR)
  184. $(DEL) go32.pp
  185. mmx$(PPUEXT) : ../../i386/mmx.pp cpu$(PPUEXT) system$(PPUEXT)
  186. $(COPY) ../../i386/mmx.pp .
  187. $(PP) $(OPT) mmx $(REDIR)
  188. $(DEL) mmx.pp
  189. cpu$(PPUEXT) : ../../i386/cpu.pp system$(PPUEXT)
  190. $(COPY) ../../i386/cpu.pp .
  191. $(PP) $(OPT) cpu $(REDIR)
  192. $(DEL) cpu.pp
  193. objpas$(PPUEXT) : ../../objpas/objpas.pp system$(PPUEXT)
  194. $(COPY) ../../objpas/objpas.pp .
  195. $(PP) $(OPT) objpas $(REDIR)
  196. $(DEL) objpas.pp
  197. objects$(PPUEXT) : ../objects.pp system$(PPUEXT)
  198. $(COPY) ../objects.pp .
  199. $(PP) $(OPT) objects $(REDIR)
  200. $(DEL) objects.pp
  201. mouse$(PPUEXT) : ../mouse.pp system$(PPUEXT)
  202. $(COPY) ../mouse.pp .
  203. $(PP) $(OPT) mouse $(REDIR)
  204. $(DEL) mouse.pp
  205. fmouse$(PPUEXT) : ../fmouse.pp system$(PPUEXT)
  206. $(COPY) ../fmouse.pp .
  207. $(PP) $(OPT) fmouse $(REDIR)
  208. $(DEL) fmouse.pp
  209. libs: libfpc$(LIBEXT)
  210. libfpc.a: all
  211. $(PPUMOVE) -s -o fpc *.ppu
  212. clean:
  213. -$(DEL) *$(OEXT) *$(PPUEXT) *.dif log *.s
  214. diffclean:
  215. -$(DEL) *.dif
  216. install: all
  217. -$(MKDIR) $(UNITINSTALLDIR)/go32unit
  218. $(INSTALL) *$(PPUEXT) $(UNITINSTALLDIR)/go32unit
  219. $(INSTALL) *$(OEXT) $(UNITINSTALLDIR)/go32unit
  220. libinstall: libs
  221. $(INSTALL) libfpc$(LIBEXT) $(LIBINSTALLDIR)
  222. $(INSTALL) *$(PPLEXT) $(UNITINSTALLDIR)
  223. %.dif : %.pp
  224. -$(DIFF) $(DIFFOPTS) $*.pp $(REFPATH)/dos/go32v2/$*.pp > $*.dif
  225. %.dif : %.inc
  226. -$(DIFF) $(DIFFOPTS) $*.inc $(REFPATH)/dos/go32v2/$*.inc > $*.dif
  227. # these must have the lowest priority
  228. %.dif : %.as
  229. -$(DIFF) $(DIFFOPTS) $*.as $(REFPATH)/dos/go32v2/$*.as > $*.dif
  230. %.dif : %.asm
  231. -$(DIFF) $(DIFFOPTS) $*.asm $(REFPATH)/dos/go32v2/$*.asm > $*.dif
  232. makefile.dif : makefile
  233. -$(DIFF) $(DIFFOPTS) makefile $(REFPATH)/dos/go32v2/makefile > makefile.dif
  234. diffs: system.dif v2prt0.dif dpmiexcp.dif exceptn.dif profile.dif os.dif \
  235. sbrk16.dif exit16.dif makefile.dif