Makefile 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. #
  2. # Makefile generated by fpcmake v0.99.13 on 1999-12-23 20:20
  3. #
  4. defaultrule: all
  5. #####################################################################
  6. # Autodetect OS (Linux or Dos or Windows NT)
  7. # define inlinux when running under linux
  8. # define inWinNT when running under WinNT
  9. #####################################################################
  10. # We need only / in the path
  11. override PATH:=$(subst \,/,$(PATH))
  12. # Search for PWD and determine also if we are under linux
  13. PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(subst ;, ,$(PATH)))))
  14. ifeq ($(PWD),)
  15. PWD:=$(strip $(wildcard $(addsuffix /pwd,$(subst :, ,$(PATH)))))
  16. ifeq ($(PWD),)
  17. nopwd:
  18. @echo You need the GNU utils package to use this Makefile!
  19. @echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
  20. @exit
  21. else
  22. inlinux=1
  23. endif
  24. else
  25. PWD:=$(firstword $(PWD))
  26. endif
  27. # Detect NT - NT sets OS to Windows_NT
  28. ifndef inlinux
  29. ifeq ($(OS),Windows_NT)
  30. inWinNT=1
  31. endif
  32. endif
  33. # Detect OS/2 - OS/2 has OS2_SHELL defined
  34. ifndef inlinux
  35. ifndef inWinNT
  36. ifdef OS2_SHELL
  37. inOS2=1
  38. endif
  39. endif
  40. endif
  41. # The extension of executables
  42. ifdef inlinux
  43. EXEEXT=
  44. else
  45. EXEEXT=.exe
  46. endif
  47. # The path which is search separated by spaces
  48. ifdef inlinux
  49. SEARCHPATH=$(subst :, ,$(PATH))
  50. else
  51. SEARCHPATH=$(subst ;, ,$(PATH))
  52. endif
  53. #####################################################################
  54. # FPC version/target Detection
  55. #####################################################################
  56. # What compiler to use ?
  57. ifndef FPC
  58. # Compatibility with old makefiles
  59. ifdef PP
  60. export FPC=$(PP)
  61. else
  62. ifdef inOS2
  63. export FPC=ppos2$(EXEEXT)
  64. else
  65. export FPC=ppc386$(EXEEXT)
  66. endif
  67. endif
  68. endif
  69. # Target OS
  70. ifndef OS_TARGET
  71. export OS_TARGET:=$(shell $(FPC) -iTO)
  72. endif
  73. # Source OS
  74. ifndef OS_SOURCE
  75. export OS_SOURCE:=$(shell $(FPC) -iSO)
  76. endif
  77. # Target CPU
  78. ifndef CPU_TARGET
  79. export CPU_TARGET:=$(shell $(FPC) -iTP)
  80. endif
  81. # Source CPU
  82. ifndef CPU_SOURCE
  83. export CPU_SOURCE:=$(shell $(FPC) -iSP)
  84. endif
  85. # FPC version
  86. ifndef FPC_VERSION
  87. export FPC_VERSION:=$(shell $(FPC) -iV)
  88. endif
  89. #####################################################################
  90. # Default Settings
  91. #####################################################################
  92. # Release ? Then force OPT and don't use extra opts via commandline
  93. ifndef REDIRFILE
  94. REDIRFILE=log
  95. endif
  96. ifdef RELEASE
  97. override OPT:=-Xs -OG2p3 -n
  98. endif
  99. # Verbose settings (warning,note,info)
  100. ifdef VERBOSE
  101. override OPT+=-vwni
  102. endif
  103. ifdef REDIR
  104. ifndef inlinux
  105. override FPC=redir -eo $(FPC)
  106. endif
  107. # set the verbosity to max
  108. override OPT+=-va
  109. override REDIR:= >> $(REDIRFILE)
  110. endif
  111. #####################################################################
  112. # User Settings
  113. #####################################################################
  114. # Targets
  115. override DIROBJECTS+=$(wildcard fake text)
  116. # Clean
  117. # Install
  118. ZIPTARGET=install
  119. # Defaults
  120. # Directories
  121. ifndef PACKAGEDIR
  122. PACKAGEDIR=$(FPCDIR)/packages
  123. endif
  124. ifndef COMPONENTDIR
  125. COMPONENTDIR=$(FPCDIR)/components
  126. endif
  127. # Packages
  128. # Libraries
  129. #####################################################################
  130. # Standard rules
  131. #####################################################################
  132. debug: $(addsuffix _debug,$(DIROBJECTS))
  133. examples: $(addsuffix _examples,$(DIROBJECTS))
  134. test: $(addsuffix _test,$(DIROBJECTS))
  135. smart: $(addsuffix _smart,$(DIROBJECTS))
  136. shared: $(addsuffix _shared,$(DIROBJECTS))
  137. showinstall: $(addsuffix _showinstall,$(DIROBJECTS))
  138. install: $(addsuffix _install,$(DIROBJECTS))
  139. sourceinstall: $(addsuffix _sourceinstall,$(DIROBJECTS))
  140. clean: $(addsuffix _clean,$(DIROBJECTS))
  141. cleanall: $(addsuffix _cleanall,$(DIROBJECTS))
  142. depend: $(addsuffix _depend,$(DIROBJECTS))
  143. .PHONY: debug examples test smart shared showinstall install sourceinstall clean cleanall depend
  144. #####################################################################
  145. # Package depends
  146. #####################################################################
  147. ifneq ($(wildcard $(RTLDIR)),)
  148. ifeq ($(wildcard $(RTLDIR)/$(FPCMADE)),)
  149. override COMPILEPACKAGES+=rtl
  150. rtl_package:
  151. $(MAKE) -C $(RTLDIR) all
  152. endif
  153. endif
  154. .PHONY: rtl_package
  155. # Target Dirs
  156. OBJECTDIRFAKE=1
  157. OBJECTDIRTEXT=1
  158. # Dir fake
  159. ifdef OBJECTDIRFAKE
  160. .PHONY: fake_all fake_debug fake_examples fake_test fake_smart fake_shared fake_showinstall fake_install fake_sourceinstall fake_zipinstall fake_zipinstalladd fake_clean fake_cleanall fake_depend fake_info
  161. fake_all:
  162. $(MAKE) -C fake all
  163. fake_debug:
  164. $(MAKE) -C fake debug
  165. fake_examples:
  166. $(MAKE) -C fake examples
  167. fake_test:
  168. $(MAKE) -C fake test
  169. fake_smart:
  170. $(MAKE) -C fake smart
  171. fake_shared:
  172. $(MAKE) -C fake shared
  173. fake_showinstall:
  174. $(MAKE) -C fake showinstall
  175. fake_install:
  176. $(MAKE) -C fake install
  177. fake_sourceinstall:
  178. $(MAKE) -C fake sourceinstall
  179. fake_zipinstall:
  180. $(MAKE) -C fake zipinstall
  181. fake_zipinstalladd:
  182. $(MAKE) -C fake zipinstalladd
  183. fake_clean:
  184. $(MAKE) -C fake clean
  185. fake_cleanall:
  186. $(MAKE) -C fake cleanall
  187. fake_depend:
  188. $(MAKE) -C fake depend
  189. fake_info:
  190. $(MAKE) -C fake info
  191. endif
  192. # Dir text
  193. ifdef OBJECTDIRTEXT
  194. .PHONY: text_all text_debug text_examples text_test text_smart text_shared text_showinstall text_install text_sourceinstall text_zipinstall text_zipinstalladd text_clean text_cleanall text_depend text_info
  195. text_all:
  196. $(MAKE) -C text all
  197. text_debug:
  198. $(MAKE) -C text debug
  199. text_examples:
  200. $(MAKE) -C text examples
  201. text_test:
  202. $(MAKE) -C text test
  203. text_smart:
  204. $(MAKE) -C text smart
  205. text_shared:
  206. $(MAKE) -C text shared
  207. text_showinstall:
  208. $(MAKE) -C text showinstall
  209. text_install:
  210. $(MAKE) -C text install
  211. text_sourceinstall:
  212. $(MAKE) -C text sourceinstall
  213. text_zipinstall:
  214. $(MAKE) -C text zipinstall
  215. text_zipinstalladd:
  216. $(MAKE) -C text zipinstalladd
  217. text_clean:
  218. $(MAKE) -C text clean
  219. text_cleanall:
  220. $(MAKE) -C text cleanall
  221. text_depend:
  222. $(MAKE) -C text depend
  223. text_info:
  224. $(MAKE) -C text info
  225. endif
  226. #####################################################################
  227. # Users rules
  228. #####################################################################
  229. .PHONY: gdb full fullgdb clean_compiler
  230. all:
  231. $(MAKE) -C text all
  232. gdb:
  233. $(MAKE) -C text all GDB=1
  234. full:
  235. $(MAKE) -C text all FULL=1 "NEEDOPT+=-Sg -dGDB -dBROWSERCOL"
  236. fullgdb:
  237. $(MAKE) -C text all FULL=1 GDB=1 "NEEDOPT+=-Sg -dGDB -dBROWSERCOL"
  238. #
  239. # Misc
  240. #
  241. clean_compiler:
  242. make -C ../../compiler clean