Makefile 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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. # Makefile Defaults
  20. #####################################################################
  21. # Default place of the makefile.fpc
  22. DEFAULTFPCDIR=../..
  23. # set target and cpu which are required
  24. override OS_TARGET=os2
  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 os2 system Unit name
  40. SYSTEMUNIT=sysos2
  41. # Loaders
  42. LOADEROBJECTS=prt0 prt1 code2 code3
  43. # Unit Objects
  44. UNITOBJECTS=$(SYSTEMUNIT) objpas strings \
  45. os2def doscalls moncalls kbdcalls viocalls \
  46. dos crt objects printer \
  47. objpas sysutils math typinfo \
  48. cpu mmx getopts heaptrc \
  49. #####################################################################
  50. # Common targets
  51. #####################################################################
  52. .PHONY: all clean install info \
  53. staticlib sharedlib libsclean \
  54. staticinstall sharedinstall libinstall \
  55. all: testfpcmake fpc_all
  56. clean: testfpcmake fpc_clean
  57. install: testfpcmake fpc_install
  58. info: testfpcmake fpc_info
  59. staticlib: testfpcmake fpc_staticlib
  60. sharedlib: testfpcmake fpc_sharedlib
  61. libsclean: testfpcmake fpc_libsclean
  62. staticinstall: testfpcmake fpc_staticinstall
  63. sharedinstall: testfpcmake fpc_sharedinstall
  64. libinstall: testfpcmake fpc_libinstall
  65. #####################################################################
  66. # Include default makef
  67. #####################################################################
  68. # test if FPCMAKE is still valid
  69. ifdef FPCMAKE
  70. ifeq ($(strip $(wildcard $(FPCMAKE))),)
  71. FPCDIR=
  72. FPCMAKE=
  73. endif
  74. endif
  75. ifndef FPCDIR
  76. ifdef DEFAULTFPCDIR
  77. FPCDIR=$(DEFAULTFPCDIR)
  78. endif
  79. endif
  80. ifndef FPCMAKE
  81. ifdef FPCDIR
  82. FPCMAKE=$(FPCDIR)/makefile.fpc
  83. else
  84. FPCMAKE=makefile.fpc
  85. endif
  86. endif
  87. override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
  88. ifeq ($(FPCMAKE),)
  89. testfpcmake:
  90. @echo makefile.fpc not found!
  91. @echo Check the FPCMAKE and FPCDIR environment variables.
  92. @exit
  93. else
  94. include $(FPCMAKE)
  95. testfpcmake:
  96. endif
  97. #####################################################################
  98. # Include system unit dependencies
  99. #####################################################################
  100. SYSTEMPPU=$(addsuffix $(PPUEXT),$(SYSTEMUNIT))
  101. # Get the system independent include file names.
  102. # This will set the following variables :
  103. # SYSINCNAMES
  104. include $(INC)/makefile.inc
  105. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  106. # Get the processor dependent include file names.
  107. # This will set the following variables :
  108. # CPUINCNAMES
  109. include $(PROCINC)/makefile.cpu
  110. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  111. # Put system unit dependencies together.
  112. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  113. #####################################################################
  114. # Dependencies
  115. #####################################################################
  116. vpath %.pas $(INC) $(PROCINC)
  117. vpath %.pp $(INC) $(PROCINC)
  118. #
  119. # Loaders
  120. #
  121. %$(OEXT) : %.as
  122. as -o $*$(OEXT) $*.as
  123. #
  124. # Base Units (System, strings, os-dependent-base-unit)
  125. #
  126. $(SYSTEMPPU) : sysos2.pas $(SYSDEPS)
  127. $(COMPILER) -Us -Sg sysos2.pas $(REDIR)
  128. objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMPPU)
  129. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp $(REDIR)
  130. strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc \
  131. $(PROCINC)/strings.inc $(PROCINC)/stringss.inc \
  132. $(SYSTEMPPU)
  133. #
  134. # System Dependent Units
  135. #
  136. doscalls$(PPUEXT) : doscalls.pas strings$(PPUEXT) objects$(PPUEXT) $(SYSTEMPPU)
  137. kbdcalls$(PPUEXT) : kbdcalls.pas $(SYSTEMPPU)
  138. moncalls$(PPUEXT) : moncalls.pas strings$(PPUEXT) $(SYSTEMPPU)
  139. #
  140. # TP7 Compatible RTL Units
  141. #
  142. dos$(PPUEXT) : dos.pas $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
  143. $(SYSTEMPPU)
  144. crt$(PPUEXT) : crt.pas $(INC)/textrec.inc $(SYSTEMPPU)
  145. objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
  146. printer$(PPUEXT) : printer.pas $(INC)/textrec.inc $(SYSTEMPPU)
  147. #graph$(PPUEXT) : graph.pp
  148. #
  149. # Delphi Compatible Units
  150. #
  151. sysutils$(PPUEXT) : $(OBJPASDIR)/sysutils.pp $(wildcard $(OBJPASDIR)/*.inc) \
  152. filutil.inc disk.inc objpas$(PPUEXT)
  153. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/sysutils.pp $(REDIR)
  154. typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
  155. $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp $(REDIR)
  156. math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  157. $(COMPILER) $(OBJPASDIR)/math.pp $(REDIR)
  158. #
  159. # Other system-independent RTL Units
  160. #
  161. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMPPU)
  162. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMPPU)
  163. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMPPU)
  164. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMPPU)
  165. $(COMPILER) -Sg $(INC)/heaptrc.pp $(REDIR)
  166. #
  167. # Other system-dependent RTL Units
  168. #
  169. #
  170. # $Log$
  171. # Revision 1.7 1999-06-01 13:23:14 peter
  172. # * fixes to work with the new makefile
  173. # * os2 compiles now correct under linux
  174. #
  175. #