Makefile 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. #
  2. # Makefile generated by fpcmake v0.99.13 [2000/02/09]
  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 searched separated by spaces
  48. ifdef inlinux
  49. SEARCHPATH=$(subst :, ,$(PATH))
  50. else
  51. SEARCHPATH=$(subst ;, ,$(PATH))
  52. endif
  53. # Base dir
  54. ifdef PWD
  55. BASEDIR:=$(shell $(PWD))
  56. else
  57. BASEDIR=.
  58. endif
  59. #####################################################################
  60. # FPC version/target Detection
  61. #####################################################################
  62. # What compiler to use ?
  63. ifndef FPC
  64. # Compatibility with old makefiles
  65. ifdef PP
  66. FPC=$(PP)
  67. else
  68. ifdef inOS2
  69. FPC=ppos2
  70. else
  71. FPC=ppc386
  72. endif
  73. endif
  74. endif
  75. override FPC:=$(subst $(EXEEXT),,$(FPC))
  76. override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
  77. # Target OS
  78. ifndef OS_TARGET
  79. OS_TARGET:=$(shell $(FPC) -iTO)
  80. endif
  81. # Source OS
  82. ifndef OS_SOURCE
  83. OS_SOURCE:=$(shell $(FPC) -iSO)
  84. endif
  85. # Target CPU
  86. ifndef CPU_TARGET
  87. CPU_TARGET:=$(shell $(FPC) -iTP)
  88. endif
  89. # Source CPU
  90. ifndef CPU_SOURCE
  91. CPU_SOURCE:=$(shell $(FPC) -iSP)
  92. endif
  93. # FPC version
  94. ifndef FPC_VERSION
  95. FPC_VERSION:=$(shell $(FPC) -iV)
  96. endif
  97. export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
  98. #####################################################################
  99. # FPCDIR Setting
  100. #####################################################################
  101. # Test FPCDIR to look if the RTL dir exists
  102. ifdef FPCDIR
  103. override FPCDIR:=$(subst \,/,$(FPCDIR))
  104. ifeq ($(wildcard $(FPCDIR)/rtl),)
  105. ifeq ($(wildcard $(FPCDIR)/units),)
  106. override FPCDIR=wrong
  107. endif
  108. endif
  109. else
  110. override FPCDIR=wrong
  111. endif
  112. # Detect FPCDIR
  113. ifeq ($(FPCDIR),wrong)
  114. ifdef inlinux
  115. override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
  116. ifeq ($(wildcard $(FPCDIR)/units),)
  117. override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
  118. endif
  119. else
  120. override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
  121. override FPCDIR:=$(FPCDIR)/..
  122. ifeq ($(wildcard $(FPCDIR)/rtl),)
  123. ifeq ($(wildcard $(FPCDIR)/units),)
  124. override FPCDIR:=$(FPCDIR)/..
  125. ifeq ($(wildcard $(FPCDIR)/rtl),)
  126. ifeq ($(wildcard $(FPCDIR)/units),)
  127. override FPCDIR=c:/pp
  128. endif
  129. endif
  130. endif
  131. endif
  132. endif
  133. endif
  134. #####################################################################
  135. # User Settings
  136. #####################################################################
  137. # Targets
  138. override DIROBJECTS+=$(wildcard compiler gdb)
  139. # Clean
  140. # Install
  141. ZIPTARGET=install
  142. # Defaults
  143. # Directories
  144. # Packages
  145. # Libraries
  146. #####################################################################
  147. # Default Directories
  148. #####################################################################
  149. # set the prefix directory where to install everything
  150. ifndef PREFIXINSTALLDIR
  151. ifdef inlinux
  152. PREFIXINSTALLDIR=/usr
  153. else
  154. PREFIXINSTALLDIR=/pp
  155. endif
  156. endif
  157. export PREFIXINSTALLDIR
  158. # Where to place the resulting zip files
  159. ifndef DESTZIPDIR
  160. DESTZIPDIR:=$(BASEDIR)
  161. endif
  162. export DESTZIPDIR
  163. #####################################################################
  164. # Redirection
  165. #####################################################################
  166. ifndef REDIRFILE
  167. REDIRFILE=log
  168. endif
  169. ifdef REDIR
  170. ifndef inlinux
  171. override FPC=redir -eo $(FPC)
  172. endif
  173. # set the verbosity to max
  174. override FPCOPT+=-va
  175. override REDIR:= >> $(REDIRFILE)
  176. endif
  177. #####################################################################
  178. # Standard rules
  179. #####################################################################
  180. all: $(addsuffix _all,$(DIROBJECTS))
  181. debug: $(addsuffix _debug,$(DIROBJECTS))
  182. examples: $(addsuffix _examples,$(DIROBJECTS))
  183. test: $(addsuffix _test,$(DIROBJECTS))
  184. smart: $(addsuffix _smart,$(DIROBJECTS))
  185. shared: $(addsuffix _shared,$(DIROBJECTS))
  186. showinstall: $(addsuffix _showinstall,$(DIROBJECTS))
  187. install: $(addsuffix _install,$(DIROBJECTS))
  188. sourceinstall: $(addsuffix _sourceinstall,$(DIROBJECTS))
  189. clean: $(addsuffix _clean,$(DIROBJECTS))
  190. distclean: $(addsuffix _distclean,$(DIROBJECTS))
  191. cleanall: $(addsuffix _cleanall,$(DIROBJECTS))
  192. require: $(addsuffix _require,$(DIROBJECTS))
  193. .PHONY: all debug examples test smart shared showinstall install sourceinstall clean distclean cleanall require
  194. #####################################################################
  195. # Directories
  196. #####################################################################
  197. OBJECTDIRCOMPILER=1
  198. OBJECTDIRGDB=1
  199. # Dir compiler
  200. ifdef OBJECTDIRCOMPILER
  201. .PHONY: compiler_all compiler_debug compiler_examples compiler_test compiler_smart compiler_shared compiler_showinstall compiler_install compiler_sourceinstall compiler_zipinstall compiler_zipsourceinstall compiler_clean compiler_distclean compiler_cleanall compiler_require compiler_info
  202. compiler_all:
  203. $(MAKE) -C compiler all
  204. compiler_debug:
  205. $(MAKE) -C compiler debug
  206. compiler_examples:
  207. $(MAKE) -C compiler examples
  208. compiler_test:
  209. $(MAKE) -C compiler test
  210. compiler_smart:
  211. $(MAKE) -C compiler smart
  212. compiler_shared:
  213. $(MAKE) -C compiler shared
  214. compiler_showinstall:
  215. $(MAKE) -C compiler showinstall
  216. compiler_install:
  217. $(MAKE) -C compiler install
  218. compiler_sourceinstall:
  219. $(MAKE) -C compiler sourceinstall
  220. compiler_zipinstall:
  221. $(MAKE) -C compiler zipinstall
  222. compiler_zipsourceinstall:
  223. $(MAKE) -C compiler zipsourceinstall
  224. compiler_clean:
  225. $(MAKE) -C compiler clean
  226. compiler_distclean:
  227. $(MAKE) -C compiler distclean
  228. compiler_cleanall:
  229. $(MAKE) -C compiler cleanall
  230. compiler_require:
  231. $(MAKE) -C compiler require
  232. compiler_info:
  233. $(MAKE) -C compiler info
  234. endif
  235. # Dir gdb
  236. ifdef OBJECTDIRGDB
  237. .PHONY: gdb_all gdb_debug gdb_examples gdb_test gdb_smart gdb_shared gdb_showinstall gdb_install gdb_sourceinstall gdb_zipinstall gdb_zipsourceinstall gdb_clean gdb_distclean gdb_cleanall gdb_require gdb_info
  238. gdb_all:
  239. $(MAKE) -C gdb all
  240. gdb_debug:
  241. $(MAKE) -C gdb debug
  242. gdb_examples:
  243. $(MAKE) -C gdb examples
  244. gdb_test:
  245. $(MAKE) -C gdb test
  246. gdb_smart:
  247. $(MAKE) -C gdb smart
  248. gdb_shared:
  249. $(MAKE) -C gdb shared
  250. gdb_showinstall:
  251. $(MAKE) -C gdb showinstall
  252. gdb_install:
  253. $(MAKE) -C gdb install
  254. gdb_sourceinstall:
  255. $(MAKE) -C gdb sourceinstall
  256. gdb_zipinstall:
  257. $(MAKE) -C gdb zipinstall
  258. gdb_zipsourceinstall:
  259. $(MAKE) -C gdb zipsourceinstall
  260. gdb_clean:
  261. $(MAKE) -C gdb clean
  262. gdb_distclean:
  263. $(MAKE) -C gdb distclean
  264. gdb_cleanall:
  265. $(MAKE) -C gdb cleanall
  266. gdb_require:
  267. $(MAKE) -C gdb require
  268. gdb_info:
  269. $(MAKE) -C gdb info
  270. endif
  271. #####################################################################
  272. # Local Makefile
  273. #####################################################################
  274. ifneq ($(wildcard fpcmake.loc),)
  275. include fpcmake.loc
  276. endif