Makefile.fpc 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. #
  2. # Makefile.fpc for Free Pascal Linux RTL
  3. #
  4. [package]
  5. main=rtl
  6. [target]
  7. loaders=prt0 cprt0 gprt0 cprt21 gprt21
  8. units=$(SYSTEMUNIT) objpas strings \
  9. $(LINUXUNIT) unix ports initc \
  10. dos crt objects printer graph ggigraph \
  11. sysutils typinfo math varutils \
  12. cpu mmx getopts heaptrc lineinfo \
  13. errors sockets gpm ipc serial terminfo dl dynlibs \
  14. video mouse keyboard
  15. rsts=math varutils
  16. [require]
  17. nortl=y
  18. [clean]
  19. units=syslinux linux
  20. [install]
  21. fpcpackage=y
  22. [default]
  23. fpcdir=../..
  24. target=linux
  25. cpu=i386
  26. [compiler]
  27. includedir=$(INC) $(PROCINC) $(UNIXINC)
  28. sourcedir=$(INC) $(PROCINC) $(UNIXINC)
  29. targetdir=.
  30. [lib]
  31. libname=libfprtl.so
  32. libversion=1.0
  33. libunits=$(SYSTEMUNIT) objpas strings \
  34. unix ports \
  35. dos crt objects printer \
  36. sysutils typinfo math \
  37. cpu mmx getopts heaptrc \
  38. errors sockets ipc dl dynlibs varutils
  39. [prerules]
  40. RTL=..
  41. INC=$(RTL)/inc
  42. PROCINC=$(RTL)/$(CPU_TARGET)
  43. UNIXINC=$(RTL)/unix
  44. UNITPREFIX=rtl
  45. ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
  46. SYSTEMUNIT=system
  47. LINUXUNIT=
  48. PRT0=prt0
  49. else
  50. SYSTEMUNIT=syslinux
  51. LINUXUNIT=linux
  52. PRT0=prt0_10
  53. override FPCOPT+=-dUNIX
  54. endif
  55. # Paths
  56. OBJPASDIR=$(RTL)/objpas
  57. GRAPHDIR=$(INC)/graph
  58. # Use new graph unit ?
  59. # NEWGRAPH=YES
  60. # Use LibGGI ?
  61. # Use
  62. #
  63. ifndef USELIBGGI
  64. USELIBGGI=NO
  65. endif
  66. [rules]
  67. # Get the $(SYSTEMUNIT) independent include file names.
  68. # This will set the following variables :
  69. # SYSINCNAMES
  70. include $(INC)/makefile.inc
  71. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  72. # Get the processor dependent include file names.
  73. # This will set the following variables :
  74. # CPUINCNAMES
  75. include $(PROCINC)/makefile.cpu
  76. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  77. # Put $(SYSTEMUNIT) unit dependencies together.
  78. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  79. #
  80. # Loaders
  81. #
  82. prt0$(OEXT) : $(CPU_TARGET)/$(PRT0).as
  83. $(AS) -o prt0$(OEXT) $(CPU_TARGET)/$(PRT0).as
  84. gprt0$(OEXT) : $(CPU_TARGET)/gprt0.as
  85. $(AS) -o gprt0$(OEXT) $(CPU_TARGET)/gprt0.as
  86. cprt0$(OEXT) : $(CPU_TARGET)/cprt0.as
  87. $(AS) -o cprt0$(OEXT) $(CPU_TARGET)/cprt0.as
  88. cprt21$(OEXT) : $(CPU_TARGET)/cprt21.as
  89. $(AS) -o cprt21$(OEXT) $(CPU_TARGET)/cprt21.as
  90. # still need to use gprt1, because gprt21 crashes
  91. gprt21$(OEXT) : $(CPU_TARGET)/gprt0.as
  92. $(AS) -o gprt21$(OEXT) $(CPU_TARGET)/gprt0.as
  93. #
  94. # $(SYSTEMUNIT) Units ($(SYSTEMUNIT), Objpas, Strings)
  95. #
  96. $(SYSTEMUNIT)$(PPUEXT) : $(SYSTEMUNIT).pp sysconst.inc systypes.inc syscalls.inc $(SYSDEPS)
  97. $(COMPILER) -Us -Sg $(SYSTEMUNIT).pp
  98. objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
  99. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
  100. strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
  101. $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
  102. $(SYSTEMUNIT)$(PPUEXT)
  103. #
  104. # $(SYSTEMUNIT) Dependent Units
  105. #
  106. unix$(PPUEXT) : unix.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
  107. syscalls.inc systypes.inc sysconst.inc $(UNIXINC)/timezone.inc $(SYSTEMUNIT)$(PPUEXT) \
  108. $(UNIXINC)/linsysca.inc
  109. ports$(PPUEXT) : ports.pp unix$(PPUEXT) objpas$(PPUEXT)
  110. dl$(PPUEXT) : $(UNIXINC)/dl.pp
  111. dynlibs$(PPUEXT) : $(INC)/dynlibs.pp $(UNIXINC)/dynlibs.inc dl$(PPUEXT) objpas$(PPUEXT)
  112. #
  113. # TP7 Compatible RTL Units
  114. #
  115. dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
  116. unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  117. crt$(PPUEXT) : crt.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  118. objects$(PPUEXT) : $(INC)/objects.pp $(UNIXINC)/objinc.inc $(SYSTEMUNIT)$(PPUEXT)
  119. printer$(PPUEXT) : printer.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  120. #
  121. # Graph
  122. #
  123. include $(GRAPHDIR)/makefile.inc
  124. GRAPHINCDEPS=$(addprefix $(GRAPHDIR)/,$(GRAPHINCNAMES))
  125. graph$(PPUEXT) : graph.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
  126. $(GRAPHINCDEPS) $(UNIXINC)/graph16.inc
  127. $(COMPILER) -I$(GRAPHDIR) $(UNIXINC)/graph.pp
  128. ggigraph$(PPUEXT) : $(UNIXINC)/ggigraph.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
  129. $(GRAPHINCDEPS)
  130. $(COMPILER) -I$(GRAPHDIR) $(UNIXINC)/ggigraph.pp
  131. #
  132. # Delphi Compatible Units
  133. #
  134. sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/*.inc) \
  135. objpas$(PPUEXT) unix$(PPUEXT) errors$(PPUEXT)
  136. $(COMPILER) -I$(OBJPASDIR) $(UNIXINC)/sysutils.pp
  137. typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
  138. $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp
  139. math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  140. $(COMPILER) $(OBJPASDIR)/math.pp
  141. gettext$(PPUEXT): $(OBJPASDIR)/gettext.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  142. $(COMPILER) $(OBJPASDIR)/gettext.pp
  143. varutils$(PPUEXT) : $(OBJPASDIR)/cvarutil.inc $(OBJPASDIR)/varutils.inc \
  144. $(OBJPASDIR)/varutilh.inc varutils.pp
  145. $(COMPILER) -I$(OBJPASDIR) $(UNIXINC)/varutils.pp
  146. #
  147. # Other $(SYSTEMUNIT)-independent RTL Units
  148. #
  149. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT)
  150. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  151. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
  152. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
  153. $(COMPILER) -Sg $(INC)/heaptrc.pp
  154. lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT)
  155. #
  156. # Other $(SYSTEMUNIT)-dependent RTL Units
  157. #
  158. sockets$(PPUEXT) : sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
  159. unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  160. errors$(PPUEXT) : errors.pp strings$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  161. ipc$(PPUEXT) : ipc.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  162. terminfo$(PPUEXT) : terminfo.pp unix$(PPUEXT)
  163. callspec$(PPUEXT) : $(INC)/callspec.pp $(SYSTEMUNIT)$(PPUEXT)