Makefile 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. #
  2. # $Id$
  3. # This file is part of the Free Pascal run time library.
  4. # Copyright (c) 1996-98 by Michael van Canneyt
  5. #
  6. # Makefile for the Free Pascal Linux Runtime Library
  7. #
  8. # See the file COPYING.FPC, included in this distribution,
  9. # for details about the copyright.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15. # Warning: this file contains TAB (#9) characters that are required for
  16. # make. Make sure you use an editor that does not replace TABs with
  17. # spaces, or the makefile won't work anymore after you save.
  18. #####################################################################
  19. # Makefile Defaults
  20. #####################################################################
  21. # Default place of the makefile.fpc
  22. DEFAULTFPCDIR=../..
  23. # set target and cpu which are required
  24. override OS_TARGET=linux
  25. override CPU=i386
  26. # Where are the include files
  27. RTL=..
  28. INC=$(RTL)/inc
  29. PROCINC=$(RTL)/$(CPU)
  30. # Where to place the result files
  31. TARGETDIR=.
  32. # These units belong to the RTL
  33. UNITPREFIX=rtl
  34. #####################################################################
  35. # Own defaults
  36. #####################################################################
  37. # Paths
  38. OBJPASDIR=$(RTL)/objpas
  39. # Define Go32v2 Units
  40. SYSTEMUNIT=syslinux
  41. # Define Loaders
  42. ifdef AOUT
  43. PRT=prt0
  44. else
  45. PRT=prt1
  46. endif
  47. LOADERAS=$(CPU)/$(PRT).as
  48. CLOADERAS=$(CPU)/c$(PRT).as
  49. GLOADERAS=$(CPU)/g$(PRT).as
  50. LOADEROBJECTS=prt0 cprt0 gprt0
  51. # Unit Objects
  52. UNITOBJECTS=$(SYSTEMUNIT) strings linux \
  53. dos crt objects printer ports \
  54. objpas sysutils typinfo math \
  55. cpu mmx getopts heaptrc \
  56. errors sockets ipc graph
  57. #####################################################################
  58. # Include default makefile
  59. #####################################################################
  60. # test if FPCMAKE is still valid
  61. ifdef FPCMAKE
  62. ifeq ($(strip $(wildcard $(FPCMAKE))),)
  63. FPCDIR=
  64. FPCMAKE=
  65. endif
  66. endif
  67. ifndef FPCDIR
  68. ifdef DEFAULTFPCDIR
  69. FPCDIR=$(DEFAULTFPCDIR)
  70. endif
  71. endif
  72. ifndef FPCMAKE
  73. ifdef FPCDIR
  74. FPCMAKE=$(FPCDIR)/makefile.fpc
  75. else
  76. FPCMAKE=makefile.fpc
  77. endif
  78. endif
  79. override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
  80. ifeq ($(FPCMAKE),)
  81. nofpcmake:
  82. @echo makefile.fpc not found!
  83. @echo Check the FPCMAKE and FPCDIR environment variables.
  84. @exit
  85. else
  86. include $(FPCMAKE)
  87. endif
  88. #####################################################################
  89. # Include system unit dependencies
  90. #####################################################################
  91. SYSTEMPPU=$(addsuffix $(PPUEXT),$(SYSTEMUNIT))
  92. # Get the system independent include file names.
  93. # This will set the following variables :
  94. # SYSINCNAMES
  95. include $(INC)/makefile.inc
  96. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  97. # Get the processor dependent include file names.
  98. # This will set the following variables :
  99. # CPUINCNAMES
  100. include $(PROCINC)/makefile.cpu
  101. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  102. # Put system unit dependencies together.
  103. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  104. #####################################################################
  105. # Dependencies
  106. #####################################################################
  107. vpath %$(PASEXT) $(INC) $(PROCINC)
  108. #
  109. # Loaders
  110. #
  111. prt0$(OEXT) : $(LOADERAS)
  112. $(AS) -o prt0$(OEXT) $(LOADERAS)
  113. cprt0$(OEXT) : $(CLOADERAS)
  114. $(AS) -o cprt0$(OEXT) $(CLOADERAS)
  115. gprt0$(OEXT) : $(GLOADERAS)
  116. $(AS) -o gprt0$(OEXT) $(GLOADERAS)
  117. #
  118. # Base Units (System, strings, os-dependent-base-unit)
  119. #
  120. $(SYSTEMPPU) : syslinux.pp sysconst.inc systypes.inc syscalls.inc $(SYSDEPS)
  121. $(COMPILER) -Us -Sg syslinux.pp $(REDIR)
  122. strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
  123. $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
  124. $($(SYSTEMPPU)
  125. linux$(PPUEXT) : linux.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
  126. syscalls.inc systypes.inc sysconst.inc $(SYSTEMPPU)
  127. #
  128. # Delphi Object Model
  129. #
  130. include $(OBJPASDIR)/makefile.op
  131. #
  132. # System Dependent Units
  133. #
  134. sockets$(PPUEXT) : sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
  135. linux$(PPUEXT) $(SYSTEMPPU)
  136. errors$(PPUEXT) : errors.pp strings$(PPUEXT) $(SYSTEMPPU)
  137. ipc$(PPUEXT) : ipc.pp linux$(PPUEXT) $(SYSTEMPPU)
  138. #
  139. # TP7 Compatible RTL Units
  140. #
  141. dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
  142. linux$(PPUEXT) $(SYSTEMPPU)
  143. crt$(PPUEXT) : crt.pp $(INC)/textrec.inc linux$(PPUEXT) $(SYSTEMPPU)
  144. objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
  145. printer$(PPUEXT) : printer.pp $(INC)/textrec.inc linux$(PPUEXT) $(SYSTEMPPU)
  146. ports$(PPUEXT) : ports.pp linux$(PPUEXT) objpas$(PPUEXT)
  147. graph$(PPUEXT) : graph.pp linux$(PPUEXT) objects$(PPUEXT)
  148. #
  149. # Other RTL Units
  150. #
  151. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMPPU)
  152. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMPPU)
  153. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMPPU)
  154. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMPPU)
  155. #
  156. # $Log$
  157. # Revision 1.15 1999-03-09 01:35:55 peter
  158. # * makefile.fpc updates and defaultfpcdir var
  159. #
  160. #