Makefile.fpc 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. #
  2. # Makefile.fpc for Free Pascal Linux RTL
  3. #
  4. [targets]
  5. loaders=prt0 cprt0 gprt0 cprt21 gprt21
  6. units=$(SYSTEMUNIT) objpas strings \
  7. linux ports \
  8. dos crt objects printer graph \
  9. sysutils typinfo math \
  10. cpu mmx getopts heaptrc \
  11. errors sockets gpm ipc
  12. programs=
  13. [defaults]
  14. defaultunits=1
  15. defaulttarget=linux
  16. defaultcpu=i386
  17. [dirs]
  18. fpcdir=.
  19. incdir=$(INC) $(PROCINC)
  20. targetdir=.
  21. [libs]
  22. libname=fprtl
  23. libunits=$(SYSTEMUNIT) objpas strings \
  24. linux ports \
  25. dos crt objects printer \
  26. sysutils typinfo math \
  27. cpu mmx getopts heaptrc \
  28. errors sockets gpm ipc
  29. [presettings]
  30. RTL=..
  31. INC=$(RTL)/inc
  32. PROCINC=$(RTL)/$(CPU_TARGET)
  33. UNITPREFIX=rtl
  34. # Paths
  35. OBJPASDIR=$(RTL)/objpas
  36. GRAPHDIR=$(INC)/graph
  37. # Define Go32v2 Units
  38. SYSTEMUNIT=syslinux
  39. #
  40. # Use LibGGI ?
  41. #
  42. ifndef USELIBGGI
  43. USELIBGGI=NO
  44. endif
  45. [postsettings]
  46. SYSTEMPPU=$(addsuffix $(PPUEXT),$(SYSTEMUNIT))
  47. # Get the system independent include file names.
  48. # This will set the following variables :
  49. # SYSINCNAMES
  50. include $(INC)/makefile.inc
  51. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  52. # Get the processor dependent include file names.
  53. # This will set the following variables :
  54. # CPUINCNAMES
  55. include $(PROCINC)/makefile.cpu
  56. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  57. # Put system unit dependencies together.
  58. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  59. [rules]
  60. vpath %$(PASEXT) $(INC) $(PROCINC)
  61. #
  62. # Loaders
  63. #
  64. prt0$(OEXT) : $(CPU_TARGET)/prt0.as
  65. $(AS) -o prt0$(OEXT) $(CPU_TARGET)/prt0.as
  66. gprt0$(OEXT) : $(CPU_TARGET)/gprt0.as
  67. $(AS) -o gprt0$(OEXT) $(CPU_TARGET)/gprt0.as
  68. cprt0$(OEXT) : $(CPU_TARGET)/cprt0.as
  69. $(AS) -o cprt0$(OEXT) $(CPU_TARGET)/cprt0.as
  70. cprt21$(OEXT) : $(CPU_TARGET)/cprt21.as
  71. $(AS) -o cprt21$(OEXT) $(CPU_TARGET)/cprt21.as
  72. # still need to use gprt1, because gprt21 crashes
  73. gprt21$(OEXT) : $(CPU_TARGET)/gprt0.as
  74. $(AS) -o gprt21$(OEXT) $(CPU_TARGET)/gprt0.as
  75. #
  76. # System Units (System, Objpas, Strings)
  77. #
  78. $(SYSTEMPPU) : syslinux.pp sysconst.inc systypes.inc syscalls.inc $(SYSDEPS)
  79. $(COMPILER) -Us -Sg syslinux.pp $(REDIR)
  80. objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMPPU)
  81. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp $(REDIR)
  82. strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
  83. $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
  84. $(SYSTEMPPU)
  85. #
  86. # System Dependent Units
  87. #
  88. linux$(PPUEXT) : linux.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
  89. syscalls.inc systypes.inc sysconst.inc $(SYSTEMPPU)
  90. ports$(PPUEXT) : ports.pp linux$(PPUEXT) objpas$(PPUEXT)
  91. #
  92. # TP7 Compatible RTL Units
  93. #
  94. dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
  95. linux$(PPUEXT) $(SYSTEMPPU)
  96. crt$(PPUEXT) : crt.pp $(INC)/textrec.inc linux$(PPUEXT) $(SYSTEMPPU)
  97. objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
  98. printer$(PPUEXT) : printer.pp $(INC)/textrec.inc linux$(PPUEXT) $(SYSTEMPPU)
  99. #
  100. # Graph
  101. #
  102. ifndef NEWGRAPH
  103. graph$(PPUEXT) : graph.pp linux$(PPUEXT) objects$(PPUEXT)
  104. else
  105. include $(GRAPHDIR)/makefile.inc
  106. GRAPHINCDEPS=$(addprefix $(GRAPHDIR)/,$(GRAPHINCNAMES))
  107. ifeq ($(USELIBGGI),YES)
  108. GRAPHINCDEPS+=ggigraph.inc
  109. override COMPILER+=-dUSEGGI -S2
  110. else
  111. GRAPHINCDEPS+=vgagraph.inc
  112. endif
  113. graph$(PPUEXT) : $(GRAPHDIR)/graph.pp $(SYSTEMPPU) $(GRAPHINCDEPS) graph.inc
  114. $(COMPILER) -I$(GRAPHDIR) $(GRAPHDIR)/graph.pp $(REDIR)
  115. endif
  116. #
  117. # Delphi Compatible Units
  118. #
  119. sysutils$(PPUEXT) : $(OBJPASDIR)/sysutils.pp $(wildcard $(OBJPASDIR)/*.inc) \
  120. filutil.inc disk.inc objpas$(PPUEXT) linux$(PPUEXT)
  121. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/sysutils.pp $(REDIR)
  122. typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
  123. $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp $(REDIR)
  124. math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  125. $(COMPILER) $(OBJPASDIR)/math.pp $(REDIR)
  126. gettext$(PPUEXT): $(OBJPASDIR)/gettext.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  127. $(COMPILER) $(OBJPASDIR)/gettext.pp $(REDIR)
  128. #
  129. # Other system-independent RTL Units
  130. #
  131. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMPPU)
  132. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMPPU)
  133. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMPPU)
  134. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMPPU)
  135. $(COMPILER) -Sg $(INC)/heaptrc.pp $(REDIR)
  136. #
  137. # Other system-dependent RTL Units
  138. #
  139. sockets$(PPUEXT) : sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
  140. linux$(PPUEXT) $(SYSTEMPPU)
  141. errors$(PPUEXT) : errors.pp strings$(PPUEXT) $(SYSTEMPPU)
  142. ipc$(PPUEXT) : ipc.pp linux$(PPUEXT) $(SYSTEMPPU)