Makefile 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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 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. #####################################################################
  18. # Default place of makefile.fpc
  19. DEFAULTFPCDIR=..
  20. # Set redir to YES if you want a log file to be kept.
  21. ifndef REDIR
  22. REDIR=NO
  23. endif
  24. # Set NODEBUG to YES if you DON'T want debugging
  25. ifndef NODEBUG
  26. NODEBUG=YES
  27. endif
  28. # Optional : Specify the place of the log file.
  29. # default is 'log' in the source directory
  30. ifndef REDIRFILE
  31. REDIRFILE=
  32. endif
  33. # Optional: Error definitions file you want the compiler to use.
  34. # !! If you specify a path, specify an absolute path. !!
  35. ifndef ERRORFILE
  36. ERRORFILE=
  37. endif
  38. #######################################################################
  39. # Fix options
  40. #######################################################################
  41. # Check debugging.
  42. ifneq ($(NODEBUG),YES)
  43. override OPT+=-g
  44. endif
  45. # Check error definitions file.
  46. ifdef ERRORFILE
  47. override OPT+=-Fr$(ERRORFILE)
  48. endif
  49. # Check logfile.
  50. ifeq ($(REDIR),YES)
  51. ifndef inlinux
  52. override PP=redir -eo $(PP)
  53. endif
  54. # set the verbosity to max
  55. override OPT+=-va
  56. ifdef REDIRFILE
  57. override REDIR:= >> $(REDIRFILE)
  58. else
  59. override REDIR:= >> log
  60. endif
  61. else
  62. override REDIR:=
  63. endif
  64. # Variables to export
  65. export PP OPT REDIR REDIRFILE ERRORFILE
  66. ############################################################################
  67. # Defaults
  68. ############################################################################
  69. .PHONY: rtl_go32v1 rtl_go32v2 rtl_linux rtl_os2 rtl_win32 \
  70. install_go32v1 install_go32v2 install_linux install_os2 install_win32 \
  71. go32v1libs go32v2libs linuxlibs os2libs win32libs \
  72. clean install native diffs diffclean \
  73. libs libinstall \
  74. all: native
  75. clean:
  76. $(MAKE) -C go32v1 clean
  77. $(MAKE) -C go32v2 clean
  78. $(MAKE) -C linux clean
  79. $(MAKE) -C win32 clean
  80. $(MAKE) -C os2 clean
  81. -$(DEL) *.dif
  82. #####################################################################
  83. # Include default makefile
  84. #####################################################################
  85. # test if FPCMAKE is still valid
  86. ifndef FPCMAKE
  87. ifdef FPCDIR
  88. FPCMAKE=$(FPCDIR)/makefile.fpc
  89. endif
  90. endif
  91. ifdef FPCMAKE
  92. ifeq ($(strip $(wildcard $(FPCMAKE))),)
  93. FPCDIR=
  94. FPCMAKE=
  95. endif
  96. endif
  97. ifndef FPCDIR
  98. ifdef DEFAULTFPCDIR
  99. FPCDIR=$(DEFAULTFPCDIR)
  100. endif
  101. endif
  102. ifndef FPCMAKE
  103. ifdef FPCDIR
  104. FPCMAKE=$(FPCDIR)/makefile.fpc
  105. else
  106. FPCMAKE=makefile.fpc
  107. endif
  108. endif
  109. override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
  110. ifndef FPCMAKE
  111. testfpcmake:
  112. @echo makefile.fpc not found!
  113. @echo Check the FPCMAKE and FPCDIR environment variables.
  114. @stopnow
  115. ifndef NODEFAULTALL
  116. all: testfpcmake
  117. endif
  118. install: testfpcmake
  119. clean: testfpcmake
  120. else
  121. include $(FPCMAKE)
  122. testfpcmake:
  123. endif
  124. ############################################################################
  125. # RTLs
  126. ############################################################################
  127. native: rtl$(OS_SOURCE)
  128. rtls: rtlgo32v1 rtlgo32v2 rtllinux rtlos2 rtlwin32
  129. rtlgo32v1:
  130. $(MAKE) -C go32v1
  131. rtlgo32v2:
  132. $(MAKE) -C go32v2
  133. rtllinux:
  134. $(MAKE) -C linux
  135. rtlos2:
  136. $(MAKE) -C os2
  137. rtlwin32:
  138. $(MAKE) -C win32
  139. rtlamiga:
  140. $(MAKE) -C amiga
  141. ############################################################################
  142. # Libs
  143. ############################################################################
  144. nativelibs : $(OS_SOURCE)libs
  145. libs: go32v1libs go32v2libs linuxlibs os2libs win32libs
  146. go32v1libs:
  147. $(MAKE) -C go32v1 libs
  148. go32v2libs:
  149. $(MAKE) -C go32v2 libs
  150. linuxlibs:
  151. $(MAKE) -C linux libs
  152. os2libs:
  153. $(MAKE) -C os2 libs
  154. win32libs:
  155. $(MAKE) -C win32 libs
  156. ############################################################################
  157. # Install
  158. ############################################################################
  159. install: install_linux install_go32v1 install_go32v2 install_os2 install_win32
  160. native_install: install_$(OS_SRC)
  161. install_go32v1:
  162. $(MAKE) -C go32v1 install
  163. install_go32v2:
  164. $(MAKE) -C go32v2 install
  165. install_linux:
  166. $(MAKE) -C linux install
  167. install_os2:
  168. $(MAKE) -C os2 install
  169. install_win32:
  170. $(MAKE) -C win32 install
  171. ############################################################################
  172. # LibInstall
  173. ############################################################################
  174. libinstall: libinstall_linux libinstall_go32v1 libinstall_go32v2 \
  175. libinstall_os2 libinstall_win32
  176. native_libinstall: libinstall_$(OS_SOURCE)
  177. libinstall_go32v1:
  178. $(MAKE) -C go32v1 libinstall
  179. libinstall_go32v2:
  180. $(MAKE) -C go32v2 libinstall
  181. libinstall_linux:
  182. $(MAKE) -C linux libinstall
  183. libinstall_os2:
  184. $(MAKE) -C os2 libinstall
  185. libinstall_win32:
  186. $(MAKE) -C win32 libinstall
  187. ############################################################################
  188. # Diffs
  189. ############################################################################
  190. diffs: diffs_rtl diffs_inc diffs_i386 diffs_m68k diffs_dos diffs_cfg \
  191. diffs_os2 diffs_go32v1 diffs_go32v2 diffs_linux diffs_win32 \
  192. diffs_template
  193. makefile.dif : makefile
  194. -$(DIFF) $(DIFFOPTS) makefile $(REFPATH)/makefile > makefile.dif
  195. diffs_rtl: makefile.dif
  196. diffs_inc:
  197. $(MAKE) -C inc diffs
  198. diffs_i386:
  199. $(MAKE) -C i386 diffs
  200. diffs_m68k:
  201. $(MAKE) -C m68k diffs
  202. diffs_cfg:
  203. $(MAKE) -C cfg diffs
  204. diffs_template:
  205. $(MAKE) -C template diffs
  206. diffs_go32v1:
  207. $(MAKE) -C go32v1 diffs
  208. diffs_go32v2:
  209. $(MAKE) -C go32v2 diffs
  210. diffs_linux:
  211. $(MAKE) -C linux diffs
  212. diffs_os2:
  213. $(MAKE) -C os2 diffs
  214. diffs_win32:
  215. $(MAKE) -C win32 diffs
  216. diffclean:
  217. $(MAKE) -C template diffclean
  218. $(MAKE) -C dos diffclean
  219. $(MAKE) -C go32v1 diffclean
  220. $(MAKE) -C go32v2 diffclean
  221. $(MAKE) -C linux diffclean
  222. $(MAKE) -C os2 diffclean
  223. $(MAKE) -C win32 diffclean
  224. -$(DEL) *.dif
  225. #
  226. # $Log$
  227. # Revision 1.7 1999-06-01 13:23:07 peter
  228. # * fixes to work with the new makefile
  229. # * os2 compiles now correct under linux
  230. #
  231. #