Makefile 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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 graph
  57. #####################################################################
  58. # Common targets
  59. #####################################################################
  60. .PHONY: all clean install info \
  61. staticlib sharedlib libsclean \
  62. staticinstall sharedinstall libinstall \
  63. all: testfpcmake fpc_all
  64. clean: testfpcmake fpc_clean
  65. install: testfpcmake fpc_install
  66. info: testfpcmake fpc_info
  67. staticlib: testfpcmake fpc_staticlib
  68. sharedlib: testfpcmake fpc_sharedlib
  69. libsclean: testfpcmake fpc_libsclean
  70. staticinstall: testfpcmake fpc_staticinstall
  71. sharedinstall: testfpcmake fpc_sharedinstall
  72. libinstall: testfpcmake fpc_libinstall
  73. #####################################################################
  74. # Include default makefile
  75. #####################################################################
  76. # test if FPCMAKE is still valid
  77. ifdef FPCMAKE
  78. ifeq ($(strip $(wildcard $(FPCMAKE))),)
  79. FPCDIR=
  80. FPCMAKE=
  81. endif
  82. endif
  83. ifndef FPCDIR
  84. ifdef DEFAULTFPCDIR
  85. FPCDIR=$(DEFAULTFPCDIR)
  86. endif
  87. endif
  88. ifndef FPCMAKE
  89. ifdef FPCDIR
  90. FPCMAKE=$(FPCDIR)/makefile.fpc
  91. else
  92. FPCMAKE=makefile.fpc
  93. endif
  94. endif
  95. override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
  96. ifeq ($(FPCMAKE),)
  97. testfpcmake:
  98. @echo makefile.fpc not found!
  99. @echo Check the FPCMAKE and FPCDIR environment variables.
  100. @exit
  101. else
  102. include $(FPCMAKE)
  103. testfpcmake:
  104. endif
  105. #####################################################################
  106. # Include system unit dependencies
  107. #####################################################################
  108. SYSTEMPPU=$(addsuffix $(PPUEXT),$(SYSTEMUNIT))
  109. # Get the system independent include file names.
  110. # This will set the following variables :
  111. # SYSINCNAMES
  112. include $(INC)/makefile.inc
  113. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  114. # Get the processor dependent include file names.
  115. # This will set the following variables :
  116. # CPUINCNAMES
  117. include $(PROCINC)/makefile.cpu
  118. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  119. # Put system unit dependencies together.
  120. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  121. #####################################################################
  122. # Dependencies
  123. #####################################################################
  124. vpath %$(PASEXT) $(INC) $(PROCINC)
  125. #
  126. # Loaders
  127. #
  128. prt0$(OEXT) : $(LOADERAS)
  129. $(AS) -o prt0$(OEXT) $(LOADERAS)
  130. cprt0$(OEXT) : $(CLOADERAS)
  131. $(AS) -o cprt0$(OEXT) $(CLOADERAS)
  132. gprt0$(OEXT) : $(GLOADERAS)
  133. $(AS) -o gprt0$(OEXT) $(GLOADERAS)
  134. #
  135. # Base Units (System, strings, os-dependent-base-unit)
  136. #
  137. $(SYSTEMPPU) : syslinux.pp sysconst.inc systypes.inc syscalls.inc $(SYSDEPS)
  138. $(COMPILER) -Us -Sg syslinux.pp $(REDIR)
  139. strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
  140. $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
  141. $($(SYSTEMPPU)
  142. linux$(PPUEXT) : linux.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
  143. syscalls.inc systypes.inc sysconst.inc $(SYSTEMPPU)
  144. #
  145. # Delphi Object Model
  146. #
  147. include $(OBJPASDIR)/makefile.op
  148. #
  149. # System Dependent Units
  150. #
  151. sockets$(PPUEXT) : sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
  152. linux$(PPUEXT) $(SYSTEMPPU)
  153. errors$(PPUEXT) : errors.pp strings$(PPUEXT) $(SYSTEMPPU)
  154. ipc$(PPUEXT) : ipc.pp linux$(PPUEXT) $(SYSTEMPPU)
  155. #
  156. # TP7 Compatible RTL Units
  157. #
  158. dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
  159. linux$(PPUEXT) $(SYSTEMPPU)
  160. crt$(PPUEXT) : crt.pp $(INC)/textrec.inc linux$(PPUEXT) $(SYSTEMPPU)
  161. objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
  162. printer$(PPUEXT) : printer.pp $(INC)/textrec.inc linux$(PPUEXT) $(SYSTEMPPU)
  163. ports$(PPUEXT) : ports.pp linux$(PPUEXT) objpas$(PPUEXT)
  164. graph$(PPUEXT) : graph.pp linux$(PPUEXT) objects$(PPUEXT)
  165. #
  166. # Other RTL Units
  167. #
  168. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMPPU)
  169. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMPPU)
  170. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMPPU)
  171. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMPPU)
  172. #######################################################################
  173. # clean
  174. #######################################################################
  175. clean: fpc_clean
  176. libsclean: fpc_libsclean
  177. #
  178. # $Log$
  179. # Revision 1.18 1999-03-22 13:09:10 peter
  180. # - ipc unit because it crashes on 0.99.10
  181. #
  182. # Revision 1.17 1999/03/16 00:47:09 peter
  183. # * makefile.fpc targets start with fpc_
  184. # * small updates for install scripts
  185. #
  186. # Revision 1.16 1999/03/12 21:07:51 michael
  187. # + clean and libsclean added
  188. #
  189. # Revision 1.15 1999/03/09 01:35:55 peter
  190. # * makefile.fpc updates and defaultfpcdir var
  191. #
  192. #