2
0

Makefile 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. #
  2. # Makefile generated by fpcmake v0.99.13 on 1999-12-19 16:02
  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. zipinstall: $(addsuffix _zipinstall,$(DIROBJECTS))
  141. zipinstalladd: $(addsuffix _zipinstalladd,$(DIROBJECTS))
  142. clean: $(addsuffix _clean,$(DIROBJECTS))
  143. cleanall: $(addsuffix _cleanall,$(DIROBJECTS))
  144. depend: $(addsuffix _depend,$(DIROBJECTS))
  145. info: $(addsuffix _info,$(DIROBJECTS))
  146. .PHONY: debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall depend info
  147. #####################################################################
  148. # Package depends
  149. #####################################################################
  150. ifneq ($(wildcard $(RTLDIR)),)
  151. ifeq ($(wildcard $(RTLDIR)/$(FPCMADE)),)
  152. override COMPILEPACKAGES+=rtl
  153. rtl_package:
  154. $(MAKE) -C $(RTLDIR) all
  155. endif
  156. endif
  157. .PHONY: rtl_package
  158. # Target Dirs
  159. OBJECTDIRFAKE=1
  160. OBJECTDIRTEXT=1
  161. # Dir fake
  162. ifdef OBJECTDIRFAKE
  163. .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
  164. fake_all:
  165. $(MAKE) -C fake all
  166. fake_debug:
  167. $(MAKE) -C fake debug
  168. fake_examples:
  169. $(MAKE) -C fake examples
  170. fake_test:
  171. $(MAKE) -C fake test
  172. fake_smart:
  173. $(MAKE) -C fake smart
  174. fake_shared:
  175. $(MAKE) -C fake shared
  176. fake_showinstall:
  177. $(MAKE) -C fake showinstall
  178. fake_install:
  179. $(MAKE) -C fake install
  180. fake_sourceinstall:
  181. $(MAKE) -C fake sourceinstall
  182. fake_zipinstall:
  183. $(MAKE) -C fake zipinstall
  184. fake_zipinstalladd:
  185. $(MAKE) -C fake zipinstalladd
  186. fake_clean:
  187. $(MAKE) -C fake clean
  188. fake_cleanall:
  189. $(MAKE) -C fake cleanall
  190. fake_depend:
  191. $(MAKE) -C fake depend
  192. fake_info:
  193. $(MAKE) -C fake info
  194. endif
  195. # Dir text
  196. ifdef OBJECTDIRTEXT
  197. .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
  198. text_all:
  199. $(MAKE) -C text all
  200. text_debug:
  201. $(MAKE) -C text debug
  202. text_examples:
  203. $(MAKE) -C text examples
  204. text_test:
  205. $(MAKE) -C text test
  206. text_smart:
  207. $(MAKE) -C text smart
  208. text_shared:
  209. $(MAKE) -C text shared
  210. text_showinstall:
  211. $(MAKE) -C text showinstall
  212. text_install:
  213. $(MAKE) -C text install
  214. text_sourceinstall:
  215. $(MAKE) -C text sourceinstall
  216. text_zipinstall:
  217. $(MAKE) -C text zipinstall
  218. text_zipinstalladd:
  219. $(MAKE) -C text zipinstalladd
  220. text_clean:
  221. $(MAKE) -C text clean
  222. text_cleanall:
  223. $(MAKE) -C text cleanall
  224. text_depend:
  225. $(MAKE) -C text depend
  226. text_info:
  227. $(MAKE) -C text info
  228. endif
  229. #####################################################################
  230. # Users rules
  231. #####################################################################
  232. .PHONY: gdb full fullgdb clean_compiler
  233. all:
  234. $(MAKE) -C text all
  235. gdb:
  236. $(MAKE) -C text all GDB=1
  237. full:
  238. $(MAKE) -C text all FULL=1 "NEEDOPT+=-Sg -dGDB -dBROWSERCOL"
  239. fullgdb:
  240. $(MAKE) -C text all FULL=1 GDB=1 "NEEDOPT+=-Sg -dGDB -dBROWSERCOL"
  241. #
  242. # Misc
  243. #
  244. clean_compiler:
  245. make -C ../../compiler clean