Makefile.fpc 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. #
  2. # Makefile.fpc for Free Pascal Win32 RTL
  3. #
  4. [package]
  5. main=rtl
  6. [target]
  7. loaders=wprt0 wdllprt0 gprt0
  8. units=$(SYSTEMUNIT) systhrds objpas strings \
  9. lineinfo heaptrc \
  10. windows ole2 activex winsock initc \
  11. dos crt objects graph messages \
  12. sysutils classes typinfo math varutils variants \
  13. cpu mmx charset ucomplex getopts \
  14. wincrt winmouse winevent sockets printer dynlibs \
  15. video mouse keyboard types comobj dateutils rtlconst sysconst
  16. rsts=math varutils typinfo variants classes dateutils
  17. [require]
  18. nortl=y
  19. [install]
  20. fpcpackage=y
  21. [default]
  22. fpcdir=../..
  23. target=win32
  24. [compiler]
  25. includedir=$(INC) $(PROCINC)
  26. sourcedir=$(INC) $(PROCINC)
  27. targetdir=.
  28. [prerules]
  29. RTL=..
  30. INC=$(RTL)/inc
  31. PROCINC=$(RTL)/$(CPU_TARGET)
  32. WININC=wininc
  33. UNITPREFIX=rtl
  34. ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
  35. SYSTEMUNIT=system
  36. PRT0=wprt0
  37. override FPCOPT+=-dMT
  38. else
  39. SYSTEMUNIT=syswin32
  40. PRT0=wprt0_10
  41. endif
  42. # Use new feature from 1.0.5 version
  43. # that generates release PPU files
  44. # which will not be recompiled
  45. ifdef RELEASE
  46. override FPCOPT+=-Ur
  47. endif
  48. # Paths
  49. OBJPASDIR=$(RTL)/objpas
  50. GRAPHDIR=$(INC)/graph
  51. # Files used by windows.pp
  52. include $(WININC)/makefile.inc
  53. WINDOWS_SOURCE_FILES=$(addprefix $(WININC)/,$(addsuffix .inc,$(WINDOWS_FILES)))
  54. [rules]
  55. SYSTEMPPU=$(addsuffix $(PPUEXT),$(SYSTEMUNIT))
  56. # Get the system independent include file names.
  57. # This will set the following variables :
  58. # SYSINCNAMES
  59. include $(INC)/makefile.inc
  60. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  61. # Get the processor dependent include file names.
  62. # This will set the following variables :
  63. # CPUINCNAMES
  64. include $(PROCINC)/makefile.cpu
  65. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  66. # Put system unit dependencies together.
  67. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  68. #
  69. # Loaders
  70. #
  71. wprt0$(OEXT) : $(PRT0).as
  72. $(AS) -o wprt0$(OEXT) $(PRT0).as
  73. gprt0$(OEXT) : gprt0.as
  74. $(AS) -o gprt0$(OEXT) gprt0.as
  75. wdllprt0$(OEXT) : wdllprt0.as
  76. $(AS) -o wdllprt0$(OEXT) wdllprt0.as
  77. #
  78. # System Units (System, Objpas, Strings)
  79. #
  80. $(SYSTEMUNIT)$(PPUEXT) : $(SYSTEMUNIT).pp win32.inc $(SYSDEPS)
  81. $(COMPILER) -Us -Sg $(SYSTEMUNIT).pp
  82. systhrds$(PPUEXT): systhrds.pp $(INC)/threadh.inc $(SYSTEMUNIT)$(PPUEXT)
  83. objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
  84. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
  85. strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
  86. $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
  87. $(SYSTEMUNIT)$(PPUEXT)
  88. #
  89. # System Dependent Units
  90. #
  91. windows$(PPUEXT) : windows.pp $(WINDOWS_SOURCE_FILES) $(SYSTEMUNIT)$(PPUEXT)
  92. $(COMPILER) -I$(WININC) windows.pp
  93. messages$(PPUEXT): messages.pp $(WININC)/messages.inc $(SYSTEMUNIT)$(PPUEXT)
  94. $(COMPILER) -I$(WININC) messages.pp
  95. ole2$(PPUEXT) : ole2.pp windows$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  96. activex$(PPUEXT) : activex.pp $(WININC)/objbase.inc windows$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) types$(PPUEXT)
  97. opengl32$(PPUEXT) : opengl32.pp windows$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  98. winsock$(PPUEXT) : winsock.pp windows$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  99. sockets$(PPUEXT) : sockets.pp windows$(PPUEXT) winsock$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
  100. $(INC)/sockets.inc $(INC)/socketsh.inc
  101. initc$(PPUEXT) : initc.pp $(SYSTEMUNIT)$(PPUEXT)
  102. wincrt$(PPUEXT) : wincrt.pp $(SYSTEMUNIT)$(PPUEXT) windows$(PPUEXT) graph$(PPUEXT)
  103. winmouse$(PPUEXT) : winmouse.pp $(SYSTEMUNIT)$(PPUEXT) windows$(PPUEXT) graph$(PPUEXT)
  104. dynlibs$(PPUEXT) : $(INC)/dynlibs.pp windows$(PPUEXT)
  105. #
  106. # TP7 Compatible RTL Units
  107. #
  108. dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  109. crt$(PPUEXT) : crt.pp $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT) objpas$(PPUEXT) dos$(PPUEXT) windows$(PPUEXT)
  110. objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT)
  111. #
  112. # Graph
  113. #
  114. include $(GRAPHDIR)/makefile.inc
  115. GRAPHINCDEPS=$(addprefix $(GRAPHDIR)/,$(GRAPHINCNAMES))
  116. graph$(PPUEXT) : graph.pp strings$(PPUEXT) windows$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
  117. $(GRAPHINCDEPS)
  118. $(COMPILER) -I$(GRAPHDIR) graph.pp
  119. #
  120. # Delphi Compatible Units
  121. #
  122. sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
  123. objpas$(PPUEXT) dos$(PPUEXT) windows$(PPUEXT)
  124. $(COMPILER) -Fi$(OBJPASDIR)/sysutils sysutils.pp
  125. classes$(PPUEXT) : classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
  126. sysutils$(PPUEXT) typinfo$(PPUEXT)
  127. $(COMPILER) -Fi$(OBJPASDIR)/classes classes.pp
  128. typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
  129. $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp
  130. math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  131. $(COMPILER) $(OBJPASDIR)/math.pp
  132. varutils$(PPUEXT) : varutils.pp $(OBJPASDIR)/cvarutil.inc \
  133. objpas$(PPUEXT) $(OBJPASDIR)/varutilh.inc
  134. $(COMPILER) -I$(OBJPASDIR) varutils.pp
  135. types$(PPUEXT) : $(OBJPASDIR)/types.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  136. $(COMPILER) $(OBJPASDIR)/types.pp
  137. comobj$(PPUEXT) : comobj.pp activex$(PPUEXT) sysutils$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) $(OBJPASDIR)/comobjh.inc $(OBJPASDIR)/comobj.inc
  138. $(COMPILER) -I$(OBJPASDIR) comobj.pp
  139. rtlconst$(PPUEXT) : $(OBJPASDIR)/rtlconst.pp
  140. $(COMPILER) $(OBJPASDIR)/rtlconst.pp
  141. sysconst$(PPUEXT) : $(OBJPASDIR)/sysconst.pp
  142. $(COMPILER) $(OBJPASDIR)/sysconst.pp
  143. dateutils$(PPUEXT) : $(OBJPASDIR)/dateutils.pp
  144. $(COMPILER) $(OBJPASDIR)/dateutils.pp
  145. #
  146. # Other system-independent RTL Units
  147. #
  148. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT)
  149. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  150. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
  151. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
  152. $(COMPILER) -Sg $(INC)/heaptrc.pp
  153. lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT)
  154. charset$(PPUEXT) : $(INC)/charset.pp $(SYSTEMUNIT)$(PPUEXT)
  155. ucomplex$(PPUEXT) : $(INC)/ucomplex.pp math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  156. #
  157. # Other system-dependent RTL Units
  158. #
  159. callspec$(PPUEXT) : $(INC)/callspec.pp $(SYSTEMUNIT)$(PPUEXT)