makefile 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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. # 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=sysamiga$(PPUEXT)
  98. OBJECTS=strings
  99. PRT=prt0
  100. LOADERAS=$(PRT).as
  101. # Define Loaders
  102. ifeq ($(LINK_TO_C),NO)
  103. LOADERS=prt0
  104. else
  105. LOADERS=lprt
  106. endif
  107. # Add Prefix and Suffixes
  108. OBJLOADERS=$(addsuffix $(OEXT), $(LOADERS))
  109. PPUOBJECTS=$(addsuffix $(PPUEXT), $(OBJECTS))
  110. .PHONY : all install clean \
  111. libs libsclean \
  112. diffs diffclean \
  113. all : $(OBJLOADERS) $(PPUOBJECTS)
  114. install : all
  115. $(MKDIR) $(UNITINSTALLDIR)
  116. $(INSTALL) *$(PPUEXT) *$(OEXT) $(UNITINSTALLDIR)
  117. clean :
  118. -$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) *.PPS log
  119. #####################################################################
  120. # Files
  121. #####################################################################
  122. #
  123. # Loaders
  124. #
  125. prt0$(OEXT) : $(LOADERAS)
  126. -as $(LOADERAS) -o prt0$(OEXT)
  127. #gprt0$(OEXT) : $(GLOADERAS)
  128. # -as $(GLOADERAS) -o gprt0$(OEXT)
  129. #
  130. # Base Units (System, strings, os-dependent-base-unit)
  131. #
  132. $(SYSTEMPPU) : sysamiga.pas $(SYSLINUXDEPS) $(SYSDEPS)
  133. $(PP) $(OPT) -Us -Sg sysamiga.pas $(REDIR)
  134. strings$(PPUEXT) : $(PROCINC)/strings.pp $(SYSTEMPPU)
  135. $(COPY) $(PROCINC)/strings.pp .
  136. $(PP) $(OPT) strings $(REDIR)
  137. $(DEL) strings.pp
  138. #
  139. # Delphi Object Model
  140. #
  141. objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(SYSTEMPPU)
  142. $(COPY) $(OBJPASDIR)/objpas.pp .
  143. $(PP) $(OPT) objpas $(REDIR)
  144. $(DEL) objpas.pp
  145. #
  146. # System Dependent Units
  147. #
  148. #
  149. # TP7 Compatible RTL Units
  150. #
  151. #dos$(PPUEXT) : $(DOSDEPS) $(SYSTEMPPU)
  152. # $(PP) $(OPT) dos $(REDIR)
  153. crt$(PPUEXT) : crt.pp $(INC)/textrec.inc $(INC)/filerec.inc $(SYSTEMPPU)
  154. $(PP) $(OPT) crt $(REDIR)
  155. objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
  156. $(COPY) $(INC)/objects.pp .
  157. $(PP) $(OPT) objects $(REDIR)
  158. $(DEL) objects.pp
  159. #
  160. # Other RTL Units
  161. #
  162. #####################################################################
  163. # Libs
  164. #####################################################################
  165. libs : all libfpc$(LIBEXT)
  166. libfpc.so:
  167. $(PPUMOVE) -o fpc *.ppu
  168. libfpc.a:
  169. $(PPUMOVE) -s -o fpc *.ppu
  170. libinstall : libs
  171. $(INSTALLEXE) libfpc$(LIBEXT) $(LIBINSTALLDIR)
  172. $(INSTALL) *$(PPLEXT) $(UNITINSTALLDIR)
  173. ldconfig
  174. libsclean : clean
  175. -$(DEL) *.a *.so *$(PPLEXT)
  176. #####################################################################
  177. # Default targets
  178. #####################################################################
  179. include $(CFG)/makefile.def