Makefile 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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 OS/2 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. # Start of configurable section.
  20. # Please note that all these must be set in the main makefile, and
  21. # should be set there.
  22. # Don't remove the indef statements. They serve to avoid conflicts
  23. # with the main makefile.
  24. #####################################################################
  25. # What is the target operating system ?
  26. ifndef OS_TARGET
  27. OS_TARGET=os2
  28. endif
  29. # What is the target processor :
  30. ifndef CPU
  31. CPU=i386
  32. #CPU=m68k
  33. endif
  34. # What compiler to use ?
  35. ifndef PP
  36. PP=ppc386
  37. endif
  38. # What options to pass to the compiler ?
  39. # You may want to specify a config file or error definitions file here.
  40. ifndef OPT
  41. OPT=
  42. endif
  43. # Where is the PPUMOVE program ?
  44. ifndef PPUMOVE
  45. PPUMOVE=ppumove
  46. endif
  47. # Set this to 'shared' or 'static'
  48. # LIBTYPE=shared
  49. # AOUT should be defined in main makefile.
  50. # But you can set it here too.
  51. # AOUT = -DAOUT
  52. # Do you want to link to the C library ?
  53. # Standard it is NO. You can set it to YES to link in th C library.
  54. ifndef LINK_TO_C
  55. LINK_TO_C=NO
  56. endif
  57. #####################################################################
  58. # End of configurable section.
  59. # Do not edit after this line.
  60. #####################################################################
  61. #####################################################################
  62. # System independent
  63. #####################################################################
  64. # Where are the include files ?
  65. INC=../inc
  66. PROCINC=../$(CPU)
  67. CFG=../cfg
  68. OBJPASDIR=../objpas
  69. # Get some defaults for Programs and OSes.
  70. # This will set the following variables :
  71. # inlinux indos COPY REPLACE DEL INSTALL INSTALLEXE MKDIR
  72. # It will also set OPT for cross-compilation, and add required options.
  73. # also checks for config file.
  74. # it expects INC PROCINC to be set !!
  75. include $(CFG)/makefile.cfg
  76. # Get the system independent include file names.
  77. # This will set the following variables :
  78. # SYSINCNAMES
  79. include $(INC)/makefile.inc
  80. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  81. # Get the processor dependent include file names.
  82. # This will set the following variables :
  83. # CPUINCNAMES
  84. include $(PROCINC)/makefile.cpu
  85. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  86. # Put system unit dependencies together.
  87. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  88. #####################################################################
  89. # System dependent
  90. #####################################################################
  91. PPUEXT=.ppo
  92. ASMEXT=.so2
  93. OEXT=.oo2
  94. # Define Linux Units
  95. SYSTEMPPU=sysos2$(PPUEXT)
  96. OBJECTS=strings dos crt objpas sysutils
  97. # objects still not implemented !!
  98. LOADERS=prt0 prt1 code2 code3
  99. #####################################################################
  100. # System independent Makefile
  101. #####################################################################
  102. # Add Prefix and Suffixes
  103. OBJLOADERS=$(addsuffix $(OEXT), $(LOADERS))
  104. PPUOBJECTS=$(addsuffix $(PPUEXT), $(OBJECTS))
  105. .PHONY : all install clean \
  106. libs libsclean \
  107. diffs diffclean \
  108. all : $(OBJLOADERS) $(PPUOBJECTS)
  109. install : all
  110. $(MKDIR) $(UNITINSTALLDIR)
  111. $(INSTALL) *$(PPUEXT) *$(OEXT) $(UNITINSTALLDIR)
  112. clean :
  113. -$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) log
  114. #####################################################################
  115. # Files
  116. #####################################################################
  117. #
  118. # Loaders
  119. #
  120. %$(OEXT) : %.as
  121. as -o $*$(OEXT) $*.as
  122. #
  123. # Base Units (System, strings, os-dependent-base-unit)
  124. #
  125. $(SYSTEMPPU) : sysos2.pas $(SYSDEPS)
  126. $(COMPILER) -Us -Sg sysos2.pas $(REDIR)
  127. strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
  128. $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
  129. $(SYSTEMPPU)
  130. $(COMPILER) $(INC)/strings.pp $(REDIR)
  131. #
  132. # Delphi Object Model
  133. #
  134. objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(INC)/except.inc
  135. $(COPY) $(OBJPASDIR)/objpas.pp .
  136. $(COMPILER) -S2 -I$(OBJPASDIR) objpas $(REDIR)
  137. $(DEL) objpas.pp
  138. SYSUTILINC = $(wildcard $(OBJPASDIR)/*.inc)
  139. sysutils$(PPUEXT) : $(OBJPASDIR)/sysutils.pp $(SYSUTILINC) filutil.inc disk.inc
  140. $(COPY) $(OBJPASDIR)/sysutils.pp .
  141. $(COMPILER) -S2 -I$(OBJPASDIR) sysutils $(REDIR)
  142. $(DEL) sysutils.pp
  143. #
  144. # System Dependent Units
  145. #
  146. #
  147. # TP7 Compatible RTL Units
  148. #
  149. dos$(PPUEXT) : dos.pas $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) $(SYSTEMPPU)
  150. $(COMPILER) dos.pas $(REDIR)
  151. crt$(PPUEXT) : crt.pas dos$(PPUEXT)
  152. $(COMPILER) crt.pas $(REDIR)
  153. #objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
  154. # $(COPY) $(INC)/objects.pp .
  155. # $(COMPILER) $(OPT) objects $(REDIR)
  156. # $(DEL) objects.pp
  157. #
  158. # Other RTL Units
  159. #
  160. #####################################################################
  161. # Libs
  162. #####################################################################
  163. libs : all libfpc$(LIBEXT)
  164. libfpc.so:
  165. $(PPUMOVE) -o fpc *.ppu
  166. libfpc.a:
  167. $(PPUMOVE) -s -o fpc *.ppu
  168. libinstall : libs
  169. $(INSTALLEXE) libfpc$(LIBEXT) $(LIBINSTALLDIR)
  170. $(INSTALL) *$(PPLEXT) $(UNITINSTALLDIR)
  171. ldconfig
  172. libsclean : clean
  173. -$(DEL) *.a *.so *$(PPLEXT)
  174. #####################################################################
  175. # Default targets
  176. #####################################################################
  177. include $(CFG)/makefile.def
  178. #
  179. # $Log$
  180. # Revision 1.6 1999-02-25 10:01:25 michael
  181. # + Fixed type in strings target
  182. #
  183. # Revision 1.5 1999/02/25 07:39:22 michael
  184. # * Joined strings and sysutils
  185. #
  186. # Revision 1.4 1998/11/24 19:51:21 jonas
  187. # + added warning about TABs
  188. #
  189. # Revision 1.3 1998/10/27 15:14:03 pierre
  190. # * update sys_os2 so that it compiles with current RTL
  191. # (do_isdevice might be wrong !! Daniel could you check this !!)
  192. # * fixed makefile (works from go32v2 compiler)
  193. # I had to remove library=shared !!
  194. # (it tried to use ld with -CD !!)
  195. #
  196. # Revision 1.2 1998/10/11 13:46:31 michael
  197. # Sysutils changes
  198. #
  199. # Revision 1.1 1998/09/10 14:17:51 peter
  200. # -renamed
  201. #
  202. #