makefile 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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. #####################################################################
  16. # Start of configurable section.
  17. # Please note that all these must be set in the main makefile, and
  18. # should be set there.
  19. # Don't remove the indef statements. They serve to avoid conflicts
  20. # with the main makefile.
  21. #####################################################################
  22. # What is the Operating System ?
  23. ifndef OS_SOURCE
  24. OS_SOURCE=linux
  25. endif
  26. # What is the target operating system ?
  27. ifndef OS_TARGET
  28. OS_TARGET=linux
  29. endif
  30. # What is the target processor :
  31. ifndef CPU
  32. CPU=i386
  33. #CPU=m68k
  34. endif
  35. # What compiler to use ?
  36. ifndef PP
  37. PP=ppc386
  38. endif
  39. # What options to pass to the compiler ?
  40. # You may want to specify a config file or error definitions file here.
  41. ifndef OPT
  42. OPT=
  43. endif
  44. # Where is the PPUMOVE program ?
  45. ifndef PPUMOVE
  46. PPUMOVE=ppumove
  47. endif
  48. # Set this to 'shared' or 'static'
  49. LIBTYPE=shared
  50. # AOUT should be defined in main makefile.
  51. # But you can set it here too.
  52. # AOUT = -DAOUT
  53. # Do you want to link to the C library ?
  54. # Standard it is NO. You can set it to YES to link in th C library.
  55. ifndef LINK_TO_C
  56. LINK_TO_C=NO
  57. endif
  58. #####################################################################
  59. # End of configurable section.
  60. # Do not edit after this line.
  61. #####################################################################
  62. #####################################################################
  63. # System independent
  64. #####################################################################
  65. # Where are the include files ?
  66. INC=../inc
  67. PROCINC=../$(CPU)
  68. CFG=../cfg
  69. OBJPASDIR=../objpas
  70. # Get some defaults for Programs and OSes.
  71. # This will set the following variables :
  72. # inlinux indos COPY REPLACE DEL INSTALL INSTALLEXE MKDIR
  73. # It will also set OPT for cross-compilation, and add required options.
  74. # also checks for config file.
  75. # it expects INC PROCINC to be set !!
  76. include $(CFG)/makefile.cfg
  77. # Get the system independent include file names.
  78. # This will set the following variables :
  79. # SYSINCNAMES
  80. include $(INC)/makefile.inc
  81. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  82. # Get the processor dependent include file names.
  83. # This will set the following variables :
  84. # CPUINCNAMES
  85. include $(PROCINC)/makefile.cpu
  86. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  87. # Put system unit dependencies together.
  88. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  89. #####################################################################
  90. # System dependent
  91. #####################################################################
  92. # Check if we need C library.
  93. ifeq ($(LINK_TO_C),YES)
  94. override OPT:=$(OPT) -dCRTLIB
  95. endif
  96. # Define Linux Units
  97. SYSTEMPPU=syslinux$(PPUEXT)
  98. OBJECTS=strings linux objpas sysutils math\
  99. dos crt objects printer \
  100. getopts errors sockets graph\
  101. # Extra Syslinux Depends
  102. ifeq ($(LINK_TO_C),YES)
  103. SYSLINUXDEPS=lprt$(OEXT)
  104. else
  105. SYSLINUXDEPS=sysconst.inc systypes.inc syscalls.inc
  106. endif
  107. # Determine on what dos unit should depend.
  108. DOSDEPS = dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT)
  109. ifeq ($(LINK_TO_C),YES)
  110. DOSDEPS:=$(DOSDEPS) lprt$(OEXT)
  111. else
  112. DOSDEPS:=$(DOSDEPS) linux$(PPUEXT)
  113. endif
  114. # Which prt to use ?
  115. ifdef AOUT
  116. PRT=prt0
  117. else
  118. PRT=prt1
  119. endif
  120. LOADERAS=$(CPU)/$(PRT).as
  121. CLOADERAS=$(CPU)/c$(PRT).as
  122. GLOADERAS=$(CPU)/g$(PRT).as
  123. # Define Loaders
  124. ifeq ($(LINK_TO_C),NO)
  125. LOADERS=prt0 cprt0 gprt0
  126. else
  127. LOADERS=lprt
  128. endif
  129. # Add Prefix and Suffixes
  130. OBJLOADERS=$(addsuffix $(OEXT), $(LOADERS))
  131. PPUOBJECTS=$(addsuffix $(PPUEXT), $(OBJECTS))
  132. .PHONY : all install clean \
  133. libs libsclean \
  134. diffs diffclean \
  135. all : $(OBJLOADERS) $(PPUOBJECTS)
  136. install : all
  137. $(MKDIR) $(UNITINSTALLDIR)
  138. $(INSTALL) *$(PPUEXT) *$(OEXT) $(UNITINSTALLDIR)
  139. clean :
  140. -$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) *.PPS log
  141. #####################################################################
  142. # Files
  143. #####################################################################
  144. #
  145. # Loaders
  146. #
  147. prt0$(OEXT) : $(LOADERAS)
  148. -as $(LOADERAS) -o prt0$(OEXT)
  149. cprt0$(OEXT) : $(CLOADERAS)
  150. -as $(CLOADERAS) -o cprt0$(OEXT)
  151. gprt0$(OEXT) : $(GLOADERAS)
  152. -as $(GLOADERAS) -o gprt0$(OEXT)
  153. lprt$(OEXT) : lprt.c
  154. gcc $(AOUT) -c lprt.c -o lprt$(OEXT)
  155. #
  156. # Base Units (System, strings, os-dependent-base-unit)
  157. #
  158. $(SYSTEMPPU) : syslinux.pp $(SYSLINUXDEPS) $(SYSDEPS)
  159. $(PP) $(OPT) -Us -Sg syslinux.pp $(REDIR)
  160. strings$(PPUEXT) : $(PROCINC)/strings.pp $(SYSTEMPPU)
  161. $(COPY) $(PROCINC)/strings.pp .
  162. $(PP) $(OPT) strings $(REDIR)
  163. $(DEL) strings.pp
  164. linux$(PPUEXT) : linux.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
  165. syscalls.inc systypes.inc sysconst.inc $(SYSTEMPPU)
  166. $(PP) $(OPT) linux.pp $(REDIR)
  167. #
  168. # Delphi Object Model
  169. #
  170. objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(SYSTEMPPU)
  171. $(COPY) $(OBJPASDIR)/objpas.pp .
  172. $(PP) $(OPT) objpas $(REDIR)
  173. $(DEL) objpas.pp
  174. sysutils$(PPUEXT) : $(OBJPASDIR)/sysutils.pp $(SYSTEMPPU) objpas$(PPUEXT) \
  175. dos$(PPUEXT)
  176. $(COPY) $(OBJPASDIR)/sysutils.pp .
  177. $(PP) $(OPT) -I$(OBJPASDIR) sysutils $(REDIR)
  178. $(DEL) sysutils.pp
  179. math$(PPUEXT) : $(OBJPASDIR)/math.pp $(SYSTEMPPU) objpas$(PPUEXT) \
  180. dos$(PPUEXT)
  181. $(COPY) $(OBJPASDIR)/math.pp .
  182. $(PP) $(OPT) -I$(OBJPASDIR) math $(REDIR)
  183. $(DEL) math.pp
  184. #
  185. # System Dependent Units
  186. #
  187. sockets$(PPUEXT) : sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
  188. linux$(PPUEXT) $(SYSTEMPPU)
  189. $(PP) $(OPT) sockets.pp $(REDIR)
  190. errors$(PPUEXT) : errors.pp strings$(PPUEXT) $(SYSTEMPPU)
  191. $(PP) $(OPT) errors.pp $(REDIR)
  192. #
  193. # TP7 Compatible RTL Units
  194. #
  195. dos$(PPUEXT) : $(DOSDEPS) $(SYSTEMPPU)
  196. $(PP) $(OPT) dos $(REDIR)
  197. crt$(PPUEXT) : crt.pp $(INC)/textrec.inc $(INC)/filerec.inc linux$(PPUEXT)\
  198. $(SYSTEMPPU)
  199. $(PP) $(OPT) crt $(REDIR)
  200. objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
  201. $(COPY) $(INC)/objects.pp .
  202. $(PP) $(OPT) objects $(REDIR)
  203. $(DEL) objects.pp
  204. printer$(PPUEXT) : printer.pp $(INC)/textrec.inc linux$(PPUEXT) $(SYSTEMPPU)
  205. $(PP) $(OPT) printer $(REDIR)
  206. graph$(PPUEXT) : graph.pp linux$(PPUEXT) objects$(PPUEXT)
  207. $(PP) $(OPT) graph $(REDIR)
  208. #
  209. # Other RTL Units
  210. #
  211. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMPPU)
  212. $(COPY) $(INC)/getopts.pp .
  213. $(PP) $(OPT) getopts $(REDIR)
  214. $(DEL) getopts.pp
  215. #####################################################################
  216. # Libs
  217. #####################################################################
  218. libs : all libfpc$(LIBEXT)
  219. libfpc.so:
  220. $(PPUMOVE) -o fpc *.ppu
  221. libfpc.a:
  222. $(PPUMOVE) -s -o fpc *.ppu
  223. libinstall : libs
  224. $(INSTALLEXE) libfpc$(LIBEXT) $(LIBINSTALLDIR)
  225. $(INSTALL) *$(PPLEXT) $(UNITINSTALLDIR)
  226. ldconfig
  227. libsclean : clean
  228. -$(DEL) *.a *.so *$(PPLEXT)
  229. #####################################################################
  230. # Default targets
  231. #####################################################################
  232. include $(CFG)/makefile.def
  233. #
  234. # $Log$
  235. # Revision 1.17 1998-08-15 17:08:09 peter
  236. # + support for cprt0.o
  237. #
  238. #