makefile 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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 Amiga 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=amiga
  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=ppc68k
  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. # Use smartlinking ?
  45. ifndef SMARTLINK
  46. SMARTLINK=NO
  47. endif
  48. # Name of library ?
  49. # If this is set, all units will be put in the same library.
  50. # If it is empty (default), the units will be left in separate files.
  51. ifndef LIBNAME
  52. LIBNAME=
  53. #LIBNAME=fpc
  54. endif
  55. # Should the library be shared or static (only if LIBNAME is set).
  56. # Set this to 'shared' or 'static' to create a librrary
  57. # Setting this to shared will disable smart linking.
  58. ifndef LIBTYPE
  59. LIBTYPE=
  60. #LIBTYPE=static
  61. endif
  62. # Where is the PPUMOVE program ?
  63. ifndef PPUMOVE
  64. PPUMOVE=ppumove
  65. endif
  66. #####################################################################
  67. # End of configurable section.
  68. # Do not edit after this line.
  69. #####################################################################
  70. #####################################################################
  71. # System independent
  72. #####################################################################
  73. # Where are the include files ?
  74. INC=../inc
  75. PROCINC=../$(CPU)
  76. CFG=../cfg
  77. OBJPASDIR=../objpas
  78. # Get some defaults for Programs and OSes.
  79. # This will set the following variables :
  80. # inlinux indos COPY REPLACE DEL INSTALL INSTALLEXE MKDIR
  81. # It will also set OPT for cross-compilation, and add required options.
  82. # also checks for config file.
  83. # it expects INC PROCINC to be set !!
  84. include $(CFG)/makefile.cfg
  85. # Get the system independent include file names.
  86. # This will set the following variables :
  87. # SYSINCNAMES
  88. include $(INC)/makefile.inc
  89. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  90. # Get the processor dependent include file names.
  91. # This will set the following variables :
  92. # CPUINCNAMES
  93. include $(PROCINC)/makefile.cpu
  94. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  95. # Put system unit dependencies together.
  96. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  97. #####################################################################
  98. # System dependent
  99. #####################################################################
  100. # Override extensions
  101. PPUEXT=.ppa
  102. ASMEXT=.asm
  103. # Define Linux Units
  104. SYSTEMPPU=sysamiga$(PPUEXT)
  105. OBJECTS=strings
  106. PRT=prt0
  107. LOADERAS=$(PRT).as
  108. # Define Loaders
  109. LOADERS=prt0
  110. # Add Prefix and Suffixes
  111. OBJLOADERS=$(addsuffix $(OEXT), $(LOADERS))
  112. PPUOBJECTS=$(addsuffix $(PPUEXT), $(OBJECTS))
  113. .PHONY : all install clean \
  114. libs libsclean \
  115. diffs diffclean \
  116. all : $(OBJLOADERS) $(PPUOBJECTS)
  117. install : all
  118. $(MKDIR) $(UNITINSTALLDIR)
  119. $(INSTALL) *$(PPUEXT) *$(OEXT) $(UNITINSTALLDIR)
  120. clean :
  121. -$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) *.PPS log
  122. #####################################################################
  123. # Files
  124. #####################################################################
  125. #
  126. # Loaders
  127. #
  128. prt0$(OEXT) : $(LOADERAS)
  129. -as $(LOADERAS) -o prt0$(OEXT)
  130. #gprt0$(OEXT) : $(GLOADERAS)
  131. # -as $(GLOADERAS) -o gprt0$(OEXT)
  132. #
  133. # Base Units (System, strings, os-dependent-base-unit)
  134. #
  135. $(SYSTEMPPU) : sysamiga.pas $(SYSLINUXDEPS) $(SYSDEPS)
  136. $(PP) $(OPT) -Us -Sg sysamiga.pas $(REDIR)
  137. strings$(PPUEXT) : ../template/strings.pp $(SYSTEMPPU)
  138. $(COPY) ../template/strings.pp .
  139. $(PP) $(OPT) strings $(REDIR)
  140. $(DEL) strings.pp
  141. #
  142. # Delphi Object Model
  143. #
  144. objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(SYSTEMPPU)
  145. $(COPY) $(OBJPASDIR)/objpas.pp .
  146. $(PP) $(OPT) objpas $(REDIR)
  147. $(DEL) objpas.pp
  148. #
  149. # System Dependent Units
  150. #
  151. #
  152. # TP7 Compatible RTL Units
  153. #
  154. #dos$(PPUEXT) : $(DOSDEPS) $(SYSTEMPPU)
  155. # $(PP) $(OPT) dos $(REDIR)
  156. crt$(PPUEXT) : crt.pp $(INC)/textrec.inc $(SYSTEMPPU)
  157. $(PP) $(OPT) crt $(REDIR)
  158. objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
  159. $(COPY) $(INC)/objects.pp .
  160. $(PP) $(OPT) objects $(REDIR)
  161. $(DEL) objects.pp
  162. #
  163. # Other RTL Units
  164. #
  165. #####################################################################
  166. # Libs
  167. #####################################################################
  168. staticlib:
  169. make clean
  170. make all SMARTLINK=YES LIBNAME=fpc LIBTYPE=static
  171. sharedlib:
  172. make clean
  173. make all
  174. $(PPUMOVE) -o fpc $(SHAREDLIBFILES)
  175. staticlibinstall: staticlib
  176. $(MKDIR) $(STATIC_LIBINSTALLDIR)
  177. $(MKDIR) $(STATIC_UNITINSTALLDIR)
  178. $(INSTALLEXE) libfpc$(STATICLIBEXT) $(STATIC_LIBINSTALLDIR)
  179. $(INSTALL) *$(PPUEXT) *$(OEXT) $(STATIC_UNITINSTALLDIR)
  180. sharedlibinstall: sharedlib
  181. $(MKDIR) $(SHARED_LIBINSTALLDIR)
  182. $(MKDIR) $(SHARED_UNITINSTALLDIR)
  183. $(INSTALLEXE) libfpc$(SHAREDLIBEXT) $(SHARED_LIBINSTALLDIR)
  184. $(INSTALL) *$(PPUEXT) *$(OEXT) $(SHARED_UNITINSTALLDIR)
  185. ldconfig
  186. libinstall: staticlibinstall sharedlibinstall
  187. libsclean : clean
  188. -$(DEL) *$(SMARTLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  189. #####################################################################
  190. # Default targets
  191. #####################################################################
  192. include $(CFG)/makefile.def