Makefile.fpc 5.5 KB

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