Makefile 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722
  1. #
  2. # Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/04/30]
  3. #
  4. default: all
  5. MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
  6. BSDs = freebsd netbsd openbsd darwin
  7. UNIXs = linux $(BSDs) solaris qnx
  8. LIMIT83fs = go32v2 os2 emx watcom
  9. OSNeedsComspecToRunBatch = go32v2 watcom
  10. FORCE:
  11. .PHONY: FORCE
  12. override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
  13. ifneq ($(findstring darwin,$(OSTYPE)),)
  14. inUnix=1 #darwin
  15. SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
  16. else
  17. ifeq ($(findstring ;,$(PATH)),)
  18. inUnix=1
  19. SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
  20. else
  21. SEARCHPATH:=$(subst ;, ,$(PATH))
  22. endif
  23. endif
  24. SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
  25. PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
  26. ifeq ($(PWD),)
  27. PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
  28. ifeq ($(PWD),)
  29. $(error You need the GNU utils package to use this Makefile)
  30. else
  31. PWD:=$(firstword $(PWD))
  32. SRCEXEEXT=
  33. endif
  34. else
  35. PWD:=$(firstword $(PWD))
  36. SRCEXEEXT=.exe
  37. endif
  38. ifndef inUnix
  39. ifeq ($(OS),Windows_NT)
  40. inWinNT=1
  41. else
  42. ifdef OS2_SHELL
  43. inOS2=1
  44. endif
  45. endif
  46. else
  47. ifneq ($(findstring cygdrive,$(PATH)),)
  48. inCygWin=1
  49. endif
  50. endif
  51. ifdef inUnix
  52. SRCBATCHEXT=.sh
  53. else
  54. ifdef inOS2
  55. SRCBATCHEXT=.cmd
  56. else
  57. SRCBATCHEXT=.bat
  58. endif
  59. endif
  60. ifdef COMSPEC
  61. ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
  62. RUNBATCH=$(COMSPEC) /C
  63. endif
  64. endif
  65. ifdef inUnix
  66. PATHSEP=/
  67. else
  68. PATHSEP:=$(subst /,\,/)
  69. ifdef inCygWin
  70. PATHSEP=/
  71. endif
  72. endif
  73. ifdef PWD
  74. BASEDIR:=$(subst \,/,$(shell $(PWD)))
  75. ifdef inCygWin
  76. ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
  77. BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
  78. BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
  79. BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
  80. endif
  81. endif
  82. else
  83. BASEDIR=.
  84. endif
  85. ifdef inOS2
  86. ifndef ECHO
  87. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  88. ifeq ($(ECHO),)
  89. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  90. ifeq ($(ECHO),)
  91. ECHO=echo
  92. else
  93. ECHO:=$(firstword $(ECHO))
  94. endif
  95. else
  96. ECHO:=$(firstword $(ECHO))
  97. endif
  98. endif
  99. export ECHO
  100. endif
  101. override DEFAULT_FPCDIR=../../../..
  102. ifndef FPC
  103. ifdef PP
  104. FPC=$(PP)
  105. endif
  106. endif
  107. ifndef FPC
  108. FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
  109. ifneq ($(FPCPROG),)
  110. FPCPROG:=$(firstword $(FPCPROG))
  111. ifneq ($(CPU_TARGET),)
  112. FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
  113. else
  114. FPC:=$(shell $(FPCPROG) -PB)
  115. endif
  116. ifneq ($(findstring Error,$(FPC)),)
  117. override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
  118. endif
  119. else
  120. override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
  121. endif
  122. endif
  123. override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
  124. override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
  125. FOUNDFPC:=$(strip $(wildcard $(FPC)))
  126. ifeq ($(FOUNDFPC),)
  127. FOUNDFPC=$(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))
  128. ifeq ($(FOUNDFPC),)
  129. $(error Compiler $(FPC) not found)
  130. endif
  131. endif
  132. ifndef FPC_COMPILERINFO
  133. FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
  134. endif
  135. ifndef FPC_VERSION
  136. FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
  137. endif
  138. export FPC FPC_VERSION FPC_COMPILERINFO
  139. unexport CHECKDEPEND ALLDEPENDENCIES
  140. ifndef CPU_TARGET
  141. ifdef CPU_TARGET_DEFAULT
  142. CPU_TARGET=$(CPU_TARGET_DEFAULT)
  143. endif
  144. endif
  145. ifndef OS_TARGET
  146. ifdef OS_TARGET_DEFAULT
  147. OS_TARGET=$(OS_TARGET_DEFAULT)
  148. endif
  149. endif
  150. ifneq ($(words $(FPC_COMPILERINFO)),5)
  151. FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
  152. FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
  153. FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
  154. FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
  155. endif
  156. ifndef CPU_SOURCE
  157. CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
  158. endif
  159. ifndef CPU_TARGET
  160. CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
  161. endif
  162. ifndef OS_SOURCE
  163. OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
  164. endif
  165. ifndef OS_TARGET
  166. OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
  167. endif
  168. FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
  169. FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
  170. ifeq ($(CPU_TARGET),armeb)
  171. ARCH=arm
  172. override FPCOPT+=-Cb
  173. else
  174. ifeq ($(CPU_TARGET),armel)
  175. ARCH=arm
  176. override FPCOPT+=-CaEABI
  177. else
  178. ARCH=$(CPU_TARGET)
  179. endif
  180. endif
  181. ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
  182. TARGETSUFFIX=$(OS_TARGET)
  183. SOURCESUFFIX=$(OS_SOURCE)
  184. else
  185. TARGETSUFFIX=$(FULL_TARGET)
  186. SOURCESUFFIX=$(FULL_SOURCE)
  187. endif
  188. ifneq ($(FULL_TARGET),$(FULL_SOURCE))
  189. CROSSCOMPILE=1
  190. endif
  191. ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
  192. ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),)
  193. $(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
  194. endif
  195. endif
  196. ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
  197. BSDhier=1
  198. endif
  199. ifeq ($(OS_TARGET),linux)
  200. linuxHier=1
  201. endif
  202. export OS_TARGET OS_SOURCE ARCH CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE
  203. ifdef FPCDIR
  204. override FPCDIR:=$(subst \,/,$(FPCDIR))
  205. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  206. override FPCDIR=wrong
  207. endif
  208. else
  209. override FPCDIR=wrong
  210. endif
  211. ifdef DEFAULT_FPCDIR
  212. ifeq ($(FPCDIR),wrong)
  213. override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
  214. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  215. override FPCDIR=wrong
  216. endif
  217. endif
  218. endif
  219. ifeq ($(FPCDIR),wrong)
  220. ifdef inUnix
  221. override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
  222. ifeq ($(wildcard $(FPCDIR)/units),)
  223. override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
  224. endif
  225. else
  226. override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
  227. override FPCDIR:=$(FPCDIR)/..
  228. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  229. override FPCDIR:=$(FPCDIR)/..
  230. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  231. override FPCDIR:=$(BASEDIR)
  232. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  233. override FPCDIR=c:/pp
  234. endif
  235. endif
  236. endif
  237. endif
  238. endif
  239. ifndef CROSSBINDIR
  240. CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
  241. endif
  242. ifndef BINUTILSPREFIX
  243. ifndef CROSSBINDIR
  244. ifdef CROSSCOMPILE
  245. BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)-
  246. endif
  247. endif
  248. endif
  249. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX))
  250. ifeq ($(UNITSDIR),)
  251. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
  252. endif
  253. PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
  254. override INSTALL_FPCPACKAGE=y
  255. ifdef REQUIRE_UNITSDIR
  256. override UNITSDIR+=$(REQUIRE_UNITSDIR)
  257. endif
  258. ifdef REQUIRE_PACKAGESDIR
  259. override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
  260. endif
  261. ifdef ZIPINSTALL
  262. ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
  263. UNIXHier=1
  264. endif
  265. else
  266. ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
  267. UNIXHier=1
  268. endif
  269. endif
  270. ifndef INSTALL_PREFIX
  271. ifdef PREFIX
  272. INSTALL_PREFIX=$(PREFIX)
  273. endif
  274. endif
  275. ifndef INSTALL_PREFIX
  276. ifdef UNIXHier
  277. INSTALL_PREFIX=/usr/local
  278. else
  279. ifdef INSTALL_FPCPACKAGE
  280. INSTALL_BASEDIR:=/pp
  281. else
  282. INSTALL_BASEDIR:=/$(PACKAGE_NAME)
  283. endif
  284. endif
  285. endif
  286. export INSTALL_PREFIX
  287. ifdef INSTALL_FPCSUBDIR
  288. export INSTALL_FPCSUBDIR
  289. endif
  290. ifndef DIST_DESTDIR
  291. DIST_DESTDIR:=$(BASEDIR)
  292. endif
  293. export DIST_DESTDIR
  294. ifndef COMPILER_UNITTARGETDIR
  295. ifdef PACKAGEDIR_MAIN
  296. COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX)
  297. else
  298. COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX)
  299. endif
  300. endif
  301. ifndef COMPILER_TARGETDIR
  302. COMPILER_TARGETDIR=.
  303. endif
  304. ifndef INSTALL_BASEDIR
  305. ifdef UNIXHier
  306. ifdef INSTALL_FPCPACKAGE
  307. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
  308. else
  309. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
  310. endif
  311. else
  312. INSTALL_BASEDIR:=$(INSTALL_PREFIX)
  313. endif
  314. endif
  315. ifndef INSTALL_BINDIR
  316. ifdef UNIXHier
  317. INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
  318. else
  319. INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
  320. ifdef INSTALL_FPCPACKAGE
  321. ifdef CROSSCOMPILE
  322. ifdef CROSSINSTALL
  323. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX)
  324. else
  325. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
  326. endif
  327. else
  328. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
  329. endif
  330. endif
  331. endif
  332. endif
  333. ifndef INSTALL_UNITDIR
  334. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX)
  335. ifdef INSTALL_FPCPACKAGE
  336. ifdef PACKAGE_NAME
  337. INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
  338. endif
  339. endif
  340. endif
  341. ifndef INSTALL_LIBDIR
  342. ifdef UNIXHier
  343. INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
  344. else
  345. INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
  346. endif
  347. endif
  348. ifndef INSTALL_SOURCEDIR
  349. ifdef UNIXHier
  350. ifdef BSDhier
  351. SRCPREFIXDIR=share/src
  352. else
  353. ifdef linuxHier
  354. SRCPREFIXDIR=share/src
  355. else
  356. SRCPREFIXDIR=src
  357. endif
  358. endif
  359. ifdef INSTALL_FPCPACKAGE
  360. ifdef INSTALL_FPCSUBDIR
  361. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  362. else
  363. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  364. endif
  365. else
  366. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  367. endif
  368. else
  369. ifdef INSTALL_FPCPACKAGE
  370. ifdef INSTALL_FPCSUBDIR
  371. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  372. else
  373. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
  374. endif
  375. else
  376. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
  377. endif
  378. endif
  379. endif
  380. ifndef INSTALL_DOCDIR
  381. ifdef UNIXHier
  382. ifdef BSDhier
  383. DOCPREFIXDIR=share/doc
  384. else
  385. ifdef linuxHier
  386. DOCPREFIXDIR=share/doc
  387. else
  388. DOCPREFIXDIR=doc
  389. endif
  390. endif
  391. ifdef INSTALL_FPCPACKAGE
  392. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  393. else
  394. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  395. endif
  396. else
  397. ifdef INSTALL_FPCPACKAGE
  398. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
  399. else
  400. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
  401. endif
  402. endif
  403. endif
  404. ifndef INSTALL_EXAMPLEDIR
  405. ifdef UNIXHier
  406. ifdef INSTALL_FPCPACKAGE
  407. ifdef BSDhier
  408. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  409. else
  410. ifdef linuxHier
  411. INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples
  412. else
  413. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
  414. endif
  415. endif
  416. else
  417. ifdef BSDhier
  418. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  419. else
  420. ifdef linuxHier
  421. INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  422. else
  423. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  424. endif
  425. endif
  426. endif
  427. else
  428. ifdef INSTALL_FPCPACKAGE
  429. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
  430. else
  431. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
  432. endif
  433. endif
  434. endif
  435. ifndef INSTALL_DATADIR
  436. INSTALL_DATADIR=$(INSTALL_BASEDIR)
  437. endif
  438. ifndef INSTALL_SHAREDDIR
  439. INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
  440. endif
  441. ifdef CROSSCOMPILE
  442. ifndef CROSSBINDIR
  443. CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
  444. ifeq ($(CROSSBINDIR),)
  445. CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE))
  446. endif
  447. endif
  448. else
  449. CROSSBINDIR=
  450. endif
  451. ifeq ($(OS_SOURCE),linux)
  452. ifndef GCCLIBDIR
  453. ifeq ($(CPU_TARGET),i386)
  454. ifneq ($(findstring x86_64,$(shell uname -a)),)
  455. ifeq ($(BINUTILSPREFIX),)
  456. GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
  457. endif
  458. endif
  459. endif
  460. ifeq ($(CPU_TARGET),powerpc64)
  461. ifeq ($(BINUTILSPREFIX),)
  462. GCCLIBDIR:=$(shell dirname `gcc -m64 -print-libgcc-file-name`)
  463. endif
  464. endif
  465. endif
  466. ifndef GCCLIBDIR
  467. CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
  468. ifneq ($(CROSSGCC),)
  469. GCCLIBDIR:=$(shell dirname `$(CROSSGCC) -print-libgcc-file-name`)
  470. endif
  471. endif
  472. ifndef OTHERLIBDIR
  473. OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
  474. endif
  475. endif
  476. ifdef inUnix
  477. ifeq ($(OS_SOURCE),netbsd)
  478. OTHERLIBDIR+=/usr/pkg/lib
  479. endif
  480. export GCCLIBDIR OTHERLIB
  481. endif
  482. BATCHEXT=.bat
  483. LOADEREXT=.as
  484. EXEEXT=.exe
  485. PPLEXT=.ppl
  486. PPUEXT=.ppu
  487. OEXT=.o
  488. ASMEXT=.s
  489. SMARTEXT=.sl
  490. STATICLIBEXT=.a
  491. SHAREDLIBEXT=.so
  492. SHAREDLIBPREFIX=libfp
  493. STATICLIBPREFIX=libp
  494. IMPORTLIBPREFIX=libimp
  495. RSTEXT=.rst
  496. ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
  497. ifeq ($(OS_TARGET),go32v1)
  498. STATICLIBPREFIX=
  499. SHORTSUFFIX=v1
  500. endif
  501. ifeq ($(OS_TARGET),go32v2)
  502. STATICLIBPREFIX=
  503. SHORTSUFFIX=dos
  504. endif
  505. ifeq ($(OS_TARGET),watcom)
  506. STATICLIBPREFIX=
  507. OEXT=.obj
  508. ASMEXT=.asm
  509. SHAREDLIBEXT=.dll
  510. SHORTSUFFIX=wat
  511. endif
  512. ifeq ($(OS_TARGET),linux)
  513. BATCHEXT=.sh
  514. EXEEXT=
  515. HASSHAREDLIB=1
  516. SHORTSUFFIX=lnx
  517. endif
  518. ifeq ($(OS_TARGET),freebsd)
  519. BATCHEXT=.sh
  520. EXEEXT=
  521. HASSHAREDLIB=1
  522. SHORTSUFFIX=fbs
  523. endif
  524. ifeq ($(OS_TARGET),netbsd)
  525. BATCHEXT=.sh
  526. EXEEXT=
  527. HASSHAREDLIB=1
  528. SHORTSUFFIX=nbs
  529. endif
  530. ifeq ($(OS_TARGET),openbsd)
  531. BATCHEXT=.sh
  532. EXEEXT=
  533. HASSHAREDLIB=1
  534. SHORTSUFFIX=obs
  535. endif
  536. ifeq ($(OS_TARGET),win32)
  537. SHAREDLIBEXT=.dll
  538. SHORTSUFFIX=w32
  539. endif
  540. ifeq ($(OS_TARGET),os2)
  541. BATCHEXT=.cmd
  542. AOUTEXT=.out
  543. STATICLIBPREFIX=
  544. SHAREDLIBEXT=.dll
  545. SHORTSUFFIX=os2
  546. ECHO=echo
  547. endif
  548. ifeq ($(OS_TARGET),emx)
  549. BATCHEXT=.cmd
  550. AOUTEXT=.out
  551. STATICLIBPREFIX=
  552. SHAREDLIBEXT=.dll
  553. SHORTSUFFIX=emx
  554. ECHO=echo
  555. endif
  556. ifeq ($(OS_TARGET),amiga)
  557. EXEEXT=
  558. SHAREDLIBEXT=.library
  559. SHORTSUFFIX=amg
  560. endif
  561. ifeq ($(OS_TARGET),morphos)
  562. EXEEXT=
  563. SHAREDLIBEXT=.library
  564. SHORTSUFFIX=mos
  565. endif
  566. ifeq ($(OS_TARGET),atari)
  567. EXEEXT=.ttp
  568. SHORTSUFFIX=ata
  569. endif
  570. ifeq ($(OS_TARGET),beos)
  571. BATCHEXT=.sh
  572. EXEEXT=
  573. SHORTSUFFIX=be
  574. endif
  575. ifeq ($(OS_TARGET),solaris)
  576. BATCHEXT=.sh
  577. EXEEXT=
  578. SHORTSUFFIX=sun
  579. endif
  580. ifeq ($(OS_TARGET),qnx)
  581. BATCHEXT=.sh
  582. EXEEXT=
  583. SHORTSUFFIX=qnx
  584. endif
  585. ifeq ($(OS_TARGET),netware)
  586. EXEEXT=.nlm
  587. STATICLIBPREFIX=
  588. SHORTSUFFIX=nw
  589. endif
  590. ifeq ($(OS_TARGET),netwlibc)
  591. EXEEXT=.nlm
  592. STATICLIBPREFIX=
  593. SHORTSUFFIX=nwl
  594. endif
  595. ifeq ($(OS_TARGET),macos)
  596. BATCHEXT=
  597. EXEEXT=
  598. DEBUGSYMEXT=.xcoff
  599. SHORTSUFFIX=mac
  600. endif
  601. ifeq ($(OS_TARGET),darwin)
  602. BATCHEXT=.sh
  603. EXEEXT=
  604. HASSHAREDLIB=1
  605. SHORTSUFFIX=dwn
  606. endif
  607. ifeq ($(OS_TARGET),gba)
  608. EXEEXT=.gba
  609. SHAREDLIBEXT=.so
  610. SHORTSUFFIX=gba
  611. endif
  612. ifeq ($(OS_TARGET),symbian)
  613. SHAREDLIBEXT=.dll
  614. SHORTSUFFIX=symbian
  615. endif
  616. else
  617. ifeq ($(OS_TARGET),go32v1)
  618. PPUEXT=.pp1
  619. OEXT=.o1
  620. ASMEXT=.s1
  621. SMARTEXT=.sl1
  622. STATICLIBEXT=.a1
  623. SHAREDLIBEXT=.so1
  624. STATICLIBPREFIX=
  625. SHORTSUFFIX=v1
  626. endif
  627. ifeq ($(OS_TARGET),go32v2)
  628. STATICLIBPREFIX=
  629. SHORTSUFFIX=dos
  630. endif
  631. ifeq ($(OS_TARGET),watcom)
  632. STATICLIBPREFIX=
  633. SHORTSUFFIX=wat
  634. endif
  635. ifeq ($(OS_TARGET),linux)
  636. BATCHEXT=.sh
  637. EXEEXT=
  638. HASSHAREDLIB=1
  639. SHORTSUFFIX=lnx
  640. endif
  641. ifeq ($(OS_TARGET),freebsd)
  642. BATCHEXT=.sh
  643. EXEEXT=
  644. HASSHAREDLIB=1
  645. SHORTSUFFIX=fbs
  646. endif
  647. ifeq ($(OS_TARGET),netbsd)
  648. BATCHEXT=.sh
  649. EXEEXT=
  650. HASSHAREDLIB=1
  651. SHORTSUFFIX=nbs
  652. endif
  653. ifeq ($(OS_TARGET),openbsd)
  654. BATCHEXT=.sh
  655. EXEEXT=
  656. HASSHAREDLIB=1
  657. SHORTSUFFIX=obs
  658. endif
  659. ifeq ($(OS_TARGET),win32)
  660. PPUEXT=.ppw
  661. OEXT=.ow
  662. ASMEXT=.sw
  663. SMARTEXT=.slw
  664. STATICLIBEXT=.aw
  665. SHAREDLIBEXT=.dll
  666. SHORTSUFFIX=w32
  667. endif
  668. ifeq ($(OS_TARGET),os2)
  669. BATCHEXT=.cmd
  670. PPUEXT=.ppo
  671. ASMEXT=.so2
  672. OEXT=.oo2
  673. AOUTEXT=.out
  674. SMARTEXT=.sl2
  675. STATICLIBPREFIX=
  676. STATICLIBEXT=.ao2
  677. SHAREDLIBEXT=.dll
  678. SHORTSUFFIX=os2
  679. ECHO=echo
  680. endif
  681. ifeq ($(OS_TARGET),amiga)
  682. EXEEXT=
  683. PPUEXT=.ppu
  684. ASMEXT=.s
  685. OEXT=.o
  686. SMARTEXT=.sl
  687. STATICLIBEXT=.a
  688. SHAREDLIBEXT=.library
  689. SHORTSUFFIX=amg
  690. endif
  691. ifeq ($(OS_TARGET),atari)
  692. PPUEXT=.ppu
  693. ASMEXT=.s
  694. OEXT=.o
  695. SMARTEXT=.sl
  696. STATICLIBEXT=.a
  697. EXEEXT=.ttp
  698. SHORTSUFFIX=ata
  699. endif
  700. ifeq ($(OS_TARGET),beos)
  701. BATCHEXT=.sh
  702. PPUEXT=.ppu
  703. ASMEXT=.s
  704. OEXT=.o
  705. SMARTEXT=.sl
  706. STATICLIBEXT=.a
  707. EXEEXT=
  708. SHORTSUFFIX=be
  709. endif
  710. ifeq ($(OS_TARGET),solaris)
  711. BATCHEXT=.sh
  712. PPUEXT=.ppu
  713. ASMEXT=.s
  714. OEXT=.o
  715. SMARTEXT=.sl
  716. STATICLIBEXT=.a
  717. EXEEXT=
  718. SHORTSUFFIX=sun
  719. endif
  720. ifeq ($(OS_TARGET),qnx)
  721. BATCHEXT=.sh
  722. PPUEXT=.ppu
  723. ASMEXT=.s
  724. OEXT=.o
  725. SMARTEXT=.sl
  726. STATICLIBEXT=.a
  727. EXEEXT=
  728. SHORTSUFFIX=qnx
  729. endif
  730. ifeq ($(OS_TARGET),netware)
  731. STATICLIBPREFIX=
  732. PPUEXT=.ppu
  733. OEXT=.o
  734. ASMEXT=.s
  735. SMARTEXT=.sl
  736. STATICLIBEXT=.a
  737. SHAREDLIBEXT=.nlm
  738. EXEEXT=.nlm
  739. SHORTSUFFIX=nw
  740. endif
  741. ifeq ($(OS_TARGET),netwlibc)
  742. STATICLIBPREFIX=
  743. PPUEXT=.ppu
  744. OEXT=.o
  745. ASMEXT=.s
  746. SMARTEXT=.sl
  747. STATICLIBEXT=.a
  748. SHAREDLIBEXT=.nlm
  749. EXEEXT=.nlm
  750. SHORTSUFFIX=nwl
  751. endif
  752. ifeq ($(OS_TARGET),macos)
  753. BATCHEXT=
  754. PPUEXT=.ppu
  755. ASMEXT=.s
  756. OEXT=.o
  757. SMARTEXT=.sl
  758. STATICLIBEXT=.a
  759. EXEEXT=
  760. DEBUGSYMEXT=.xcoff
  761. SHORTSUFFIX=mac
  762. endif
  763. endif
  764. ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
  765. FPCMADE=fpcmade.$(SHORTSUFFIX)
  766. ZIPSUFFIX=$(SHORTSUFFIX)
  767. ZIPCROSSPREFIX=
  768. ZIPSOURCESUFFIX=src
  769. ZIPEXAMPLESUFFIX=exm
  770. else
  771. FPCMADE=fpcmade.$(TARGETSUFFIX)
  772. ZIPSOURCESUFFIX=.source
  773. ZIPEXAMPLESUFFIX=.examples
  774. ifdef CROSSCOMPILE
  775. ZIPSUFFIX=.$(SOURCESUFFIX)
  776. ZIPCROSSPREFIX=$(TARGETSUFFIX)-
  777. else
  778. ZIPSUFFIX=.$(TARGETSUFFIX)
  779. ZIPCROSSPREFIX=
  780. endif
  781. endif
  782. ifndef ECHO
  783. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  784. ifeq ($(ECHO),)
  785. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  786. ifeq ($(ECHO),)
  787. ECHO= __missing_command_ECHO
  788. else
  789. ECHO:=$(firstword $(ECHO))
  790. endif
  791. else
  792. ECHO:=$(firstword $(ECHO))
  793. endif
  794. endif
  795. export ECHO
  796. ifndef DATE
  797. DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
  798. ifeq ($(DATE),)
  799. DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
  800. ifeq ($(DATE),)
  801. DATE= __missing_command_DATE
  802. else
  803. DATE:=$(firstword $(DATE))
  804. endif
  805. else
  806. DATE:=$(firstword $(DATE))
  807. endif
  808. endif
  809. export DATE
  810. ifndef GINSTALL
  811. GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
  812. ifeq ($(GINSTALL),)
  813. GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
  814. ifeq ($(GINSTALL),)
  815. GINSTALL= __missing_command_GINSTALL
  816. else
  817. GINSTALL:=$(firstword $(GINSTALL))
  818. endif
  819. else
  820. GINSTALL:=$(firstword $(GINSTALL))
  821. endif
  822. endif
  823. export GINSTALL
  824. ifndef CPPROG
  825. CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
  826. ifeq ($(CPPROG),)
  827. CPPROG= __missing_command_CPPROG
  828. else
  829. CPPROG:=$(firstword $(CPPROG))
  830. endif
  831. endif
  832. export CPPROG
  833. ifndef RMPROG
  834. RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
  835. ifeq ($(RMPROG),)
  836. RMPROG= __missing_command_RMPROG
  837. else
  838. RMPROG:=$(firstword $(RMPROG))
  839. endif
  840. endif
  841. export RMPROG
  842. ifndef MVPROG
  843. MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
  844. ifeq ($(MVPROG),)
  845. MVPROG= __missing_command_MVPROG
  846. else
  847. MVPROG:=$(firstword $(MVPROG))
  848. endif
  849. endif
  850. export MVPROG
  851. ifndef MKDIRPROG
  852. MKDIRPROG:=$(strip $(wildcard $(addsuffix /gmkdir$(SRCEXEEXT),$(SEARCHPATH))))
  853. ifeq ($(MKDIRPROG),)
  854. MKDIRPROG:=$(strip $(wildcard $(addsuffix /mkdir$(SRCEXEEXT),$(SEARCHPATH))))
  855. ifeq ($(MKDIRPROG),)
  856. MKDIRPROG= __missing_command_MKDIRPROG
  857. else
  858. MKDIRPROG:=$(firstword $(MKDIRPROG))
  859. endif
  860. else
  861. MKDIRPROG:=$(firstword $(MKDIRPROG))
  862. endif
  863. endif
  864. export MKDIRPROG
  865. ifndef ECHOREDIR
  866. ifndef inUnix
  867. ECHOREDIR=echo
  868. else
  869. ECHOREDIR=$(ECHO)
  870. endif
  871. endif
  872. ifndef COPY
  873. COPY:=$(CPPROG) -fp
  874. endif
  875. ifndef COPYTREE
  876. COPYTREE:=$(CPPROG) -Rfp
  877. endif
  878. ifndef MKDIRTREE
  879. MKDIRTREE:=$(MKDIRPROG) -p
  880. endif
  881. ifndef MOVE
  882. MOVE:=$(MVPROG) -f
  883. endif
  884. ifndef DEL
  885. DEL:=$(RMPROG) -f
  886. endif
  887. ifndef DELTREE
  888. DELTREE:=$(RMPROG) -rf
  889. endif
  890. ifndef INSTALL
  891. ifdef inUnix
  892. INSTALL:=$(GINSTALL) -c -m 644
  893. else
  894. INSTALL:=$(COPY)
  895. endif
  896. endif
  897. ifndef INSTALLEXE
  898. ifdef inUnix
  899. INSTALLEXE:=$(GINSTALL) -c -m 755
  900. else
  901. INSTALLEXE:=$(COPY)
  902. endif
  903. endif
  904. ifndef MKDIR
  905. MKDIR:=$(GINSTALL) -m 755 -d
  906. endif
  907. export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
  908. ifndef PPUMOVE
  909. PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
  910. ifeq ($(PPUMOVE),)
  911. PPUMOVE= __missing_command_PPUMOVE
  912. else
  913. PPUMOVE:=$(firstword $(PPUMOVE))
  914. endif
  915. endif
  916. export PPUMOVE
  917. ifndef FPCMAKE
  918. FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
  919. ifeq ($(FPCMAKE),)
  920. FPCMAKE= __missing_command_FPCMAKE
  921. else
  922. FPCMAKE:=$(firstword $(FPCMAKE))
  923. endif
  924. endif
  925. export FPCMAKE
  926. ifndef ZIPPROG
  927. ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
  928. ifeq ($(ZIPPROG),)
  929. ZIPPROG= __missing_command_ZIPPROG
  930. else
  931. ZIPPROG:=$(firstword $(ZIPPROG))
  932. endif
  933. endif
  934. export ZIPPROG
  935. ifndef TARPROG
  936. TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
  937. ifeq ($(TARPROG),)
  938. TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
  939. ifeq ($(TARPROG),)
  940. TARPROG= __missing_command_TARPROG
  941. else
  942. TARPROG:=$(firstword $(TARPROG))
  943. endif
  944. else
  945. TARPROG:=$(firstword $(TARPROG))
  946. endif
  947. endif
  948. export TARPROG
  949. ASNAME=$(BINUTILSPREFIX)as
  950. LDNAME=$(BINUTILSPREFIX)ld
  951. ARNAME=$(BINUTILSPREFIX)ar
  952. RCNAME=$(BINUTILSPREFIX)rc
  953. ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
  954. ifeq ($(OS_TARGET),win32)
  955. ifeq ($(CROSSBINDIR),)
  956. ASNAME=asw
  957. LDNAME=ldw
  958. ARNAME=arw
  959. endif
  960. endif
  961. endif
  962. ifndef ASPROG
  963. ifdef CROSSBINDIR
  964. ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
  965. else
  966. ASPROG=$(ASNAME)
  967. endif
  968. endif
  969. ifndef LDPROG
  970. ifdef CROSSBINDIR
  971. LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
  972. else
  973. LDPROG=$(LDNAME)
  974. endif
  975. endif
  976. ifndef RCPROG
  977. ifdef CROSSBINDIR
  978. RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
  979. else
  980. RCPROG=$(RCNAME)
  981. endif
  982. endif
  983. ifndef ARPROG
  984. ifdef CROSSBINDIR
  985. ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
  986. else
  987. ARPROG=$(ARNAME)
  988. endif
  989. endif
  990. AS=$(ASPROG)
  991. LD=$(LDPROG)
  992. RC=$(RCPROG)
  993. AR=$(ARPROG)
  994. PPAS=ppas$(SRCBATCHEXT)
  995. ifdef inUnix
  996. LDCONFIG=ldconfig
  997. else
  998. LDCONFIG=
  999. endif
  1000. ifdef DATE
  1001. DATESTR:=$(shell $(DATE) +%Y%m%d)
  1002. else
  1003. DATESTR=
  1004. endif
  1005. ifndef UPXPROG
  1006. ifeq ($(OS_TARGET),go32v2)
  1007. UPXPROG:=1
  1008. endif
  1009. ifeq ($(OS_TARGET),win32)
  1010. UPXPROG:=1
  1011. endif
  1012. ifdef UPXPROG
  1013. UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
  1014. ifeq ($(UPXPROG),)
  1015. UPXPROG=
  1016. else
  1017. UPXPROG:=$(firstword $(UPXPROG))
  1018. endif
  1019. else
  1020. UPXPROG=
  1021. endif
  1022. endif
  1023. export UPXPROG
  1024. ZIPOPT=-9
  1025. ZIPEXT=.zip
  1026. ifeq ($(USETAR),bz2)
  1027. TAROPT=vj
  1028. TAREXT=.tar.bz2
  1029. else
  1030. TAROPT=vz
  1031. TAREXT=.tar.gz
  1032. endif
  1033. override REQUIRE_PACKAGES=gtk1
  1034. ifeq ($(FULL_TARGET),i386-linux)
  1035. REQUIRE_PACKAGES_X11=1
  1036. REQUIRE_PACKAGES_OPENGL=1
  1037. REQUIRE_PACKAGES_GTK1=1
  1038. endif
  1039. ifeq ($(FULL_TARGET),i386-go32v2)
  1040. REQUIRE_PACKAGES_OPENGL=1
  1041. REQUIRE_PACKAGES_GTK1=1
  1042. endif
  1043. ifeq ($(FULL_TARGET),i386-win32)
  1044. REQUIRE_PACKAGES_OPENGL=1
  1045. REQUIRE_PACKAGES_GTK1=1
  1046. endif
  1047. ifeq ($(FULL_TARGET),i386-os2)
  1048. REQUIRE_PACKAGES_OPENGL=1
  1049. REQUIRE_PACKAGES_GTK1=1
  1050. endif
  1051. ifeq ($(FULL_TARGET),i386-freebsd)
  1052. REQUIRE_PACKAGES_X11=1
  1053. REQUIRE_PACKAGES_OPENGL=1
  1054. REQUIRE_PACKAGES_GTK1=1
  1055. endif
  1056. ifeq ($(FULL_TARGET),i386-beos)
  1057. REQUIRE_PACKAGES_OPENGL=1
  1058. REQUIRE_PACKAGES_GTK1=1
  1059. endif
  1060. ifeq ($(FULL_TARGET),i386-netbsd)
  1061. REQUIRE_PACKAGES_X11=1
  1062. REQUIRE_PACKAGES_OPENGL=1
  1063. REQUIRE_PACKAGES_GTK1=1
  1064. endif
  1065. ifeq ($(FULL_TARGET),i386-solaris)
  1066. REQUIRE_PACKAGES_OPENGL=1
  1067. REQUIRE_PACKAGES_GTK1=1
  1068. endif
  1069. ifeq ($(FULL_TARGET),i386-qnx)
  1070. REQUIRE_PACKAGES_OPENGL=1
  1071. REQUIRE_PACKAGES_GTK1=1
  1072. endif
  1073. ifeq ($(FULL_TARGET),i386-netware)
  1074. REQUIRE_PACKAGES_OPENGL=1
  1075. REQUIRE_PACKAGES_GTK1=1
  1076. endif
  1077. ifeq ($(FULL_TARGET),i386-openbsd)
  1078. REQUIRE_PACKAGES_X11=1
  1079. REQUIRE_PACKAGES_OPENGL=1
  1080. REQUIRE_PACKAGES_GTK1=1
  1081. endif
  1082. ifeq ($(FULL_TARGET),i386-wdosx)
  1083. REQUIRE_PACKAGES_OPENGL=1
  1084. REQUIRE_PACKAGES_GTK1=1
  1085. endif
  1086. ifeq ($(FULL_TARGET),i386-darwin)
  1087. REQUIRE_PACKAGES_X11=1
  1088. REQUIRE_PACKAGES_OPENGL=1
  1089. REQUIRE_PACKAGES_GTK1=1
  1090. endif
  1091. ifeq ($(FULL_TARGET),i386-emx)
  1092. REQUIRE_PACKAGES_OPENGL=1
  1093. REQUIRE_PACKAGES_GTK1=1
  1094. endif
  1095. ifeq ($(FULL_TARGET),i386-watcom)
  1096. REQUIRE_PACKAGES_OPENGL=1
  1097. REQUIRE_PACKAGES_GTK1=1
  1098. endif
  1099. ifeq ($(FULL_TARGET),i386-netwlibc)
  1100. REQUIRE_PACKAGES_OPENGL=1
  1101. REQUIRE_PACKAGES_GTK1=1
  1102. endif
  1103. ifeq ($(FULL_TARGET),i386-wince)
  1104. REQUIRE_PACKAGES_OPENGL=1
  1105. REQUIRE_PACKAGES_GTK1=1
  1106. endif
  1107. ifeq ($(FULL_TARGET),i386-embedded)
  1108. REQUIRE_PACKAGES_OPENGL=1
  1109. REQUIRE_PACKAGES_GTK1=1
  1110. endif
  1111. ifeq ($(FULL_TARGET),i386-symbian)
  1112. REQUIRE_PACKAGES_OPENGL=1
  1113. REQUIRE_PACKAGES_GTK1=1
  1114. endif
  1115. ifeq ($(FULL_TARGET),m68k-linux)
  1116. REQUIRE_PACKAGES_X11=1
  1117. REQUIRE_PACKAGES_OPENGL=1
  1118. REQUIRE_PACKAGES_GTK1=1
  1119. endif
  1120. ifeq ($(FULL_TARGET),m68k-freebsd)
  1121. REQUIRE_PACKAGES_X11=1
  1122. REQUIRE_PACKAGES_OPENGL=1
  1123. REQUIRE_PACKAGES_GTK1=1
  1124. endif
  1125. ifeq ($(FULL_TARGET),m68k-netbsd)
  1126. REQUIRE_PACKAGES_X11=1
  1127. REQUIRE_PACKAGES_OPENGL=1
  1128. REQUIRE_PACKAGES_GTK1=1
  1129. endif
  1130. ifeq ($(FULL_TARGET),m68k-amiga)
  1131. REQUIRE_PACKAGES_OPENGL=1
  1132. REQUIRE_PACKAGES_GTK1=1
  1133. endif
  1134. ifeq ($(FULL_TARGET),m68k-atari)
  1135. REQUIRE_PACKAGES_OPENGL=1
  1136. REQUIRE_PACKAGES_GTK1=1
  1137. endif
  1138. ifeq ($(FULL_TARGET),m68k-openbsd)
  1139. REQUIRE_PACKAGES_X11=1
  1140. REQUIRE_PACKAGES_OPENGL=1
  1141. REQUIRE_PACKAGES_GTK1=1
  1142. endif
  1143. ifeq ($(FULL_TARGET),m68k-palmos)
  1144. REQUIRE_PACKAGES_OPENGL=1
  1145. REQUIRE_PACKAGES_GTK1=1
  1146. endif
  1147. ifeq ($(FULL_TARGET),m68k-embedded)
  1148. REQUIRE_PACKAGES_OPENGL=1
  1149. REQUIRE_PACKAGES_GTK1=1
  1150. endif
  1151. ifeq ($(FULL_TARGET),powerpc-linux)
  1152. REQUIRE_PACKAGES_X11=1
  1153. REQUIRE_PACKAGES_OPENGL=1
  1154. REQUIRE_PACKAGES_GTK1=1
  1155. endif
  1156. ifeq ($(FULL_TARGET),powerpc-netbsd)
  1157. REQUIRE_PACKAGES_X11=1
  1158. REQUIRE_PACKAGES_OPENGL=1
  1159. REQUIRE_PACKAGES_GTK1=1
  1160. endif
  1161. ifeq ($(FULL_TARGET),powerpc-amiga)
  1162. REQUIRE_PACKAGES_OPENGL=1
  1163. REQUIRE_PACKAGES_GTK1=1
  1164. endif
  1165. ifeq ($(FULL_TARGET),powerpc-macos)
  1166. REQUIRE_PACKAGES_OPENGL=1
  1167. REQUIRE_PACKAGES_GTK1=1
  1168. endif
  1169. ifeq ($(FULL_TARGET),powerpc-darwin)
  1170. REQUIRE_PACKAGES_X11=1
  1171. REQUIRE_PACKAGES_OPENGL=1
  1172. REQUIRE_PACKAGES_GTK1=1
  1173. endif
  1174. ifeq ($(FULL_TARGET),powerpc-morphos)
  1175. REQUIRE_PACKAGES_OPENGL=1
  1176. REQUIRE_PACKAGES_GTK1=1
  1177. endif
  1178. ifeq ($(FULL_TARGET),powerpc-embedded)
  1179. REQUIRE_PACKAGES_OPENGL=1
  1180. REQUIRE_PACKAGES_GTK1=1
  1181. endif
  1182. ifeq ($(FULL_TARGET),sparc-linux)
  1183. REQUIRE_PACKAGES_X11=1
  1184. REQUIRE_PACKAGES_OPENGL=1
  1185. REQUIRE_PACKAGES_GTK1=1
  1186. endif
  1187. ifeq ($(FULL_TARGET),sparc-netbsd)
  1188. REQUIRE_PACKAGES_X11=1
  1189. REQUIRE_PACKAGES_OPENGL=1
  1190. REQUIRE_PACKAGES_GTK1=1
  1191. endif
  1192. ifeq ($(FULL_TARGET),sparc-solaris)
  1193. REQUIRE_PACKAGES_OPENGL=1
  1194. REQUIRE_PACKAGES_GTK1=1
  1195. endif
  1196. ifeq ($(FULL_TARGET),sparc-embedded)
  1197. REQUIRE_PACKAGES_OPENGL=1
  1198. REQUIRE_PACKAGES_GTK1=1
  1199. endif
  1200. ifeq ($(FULL_TARGET),x86_64-linux)
  1201. REQUIRE_PACKAGES_X11=1
  1202. REQUIRE_PACKAGES_OPENGL=1
  1203. REQUIRE_PACKAGES_GTK1=1
  1204. endif
  1205. ifeq ($(FULL_TARGET),x86_64-freebsd)
  1206. REQUIRE_PACKAGES_X11=1
  1207. REQUIRE_PACKAGES_OPENGL=1
  1208. REQUIRE_PACKAGES_GTK1=1
  1209. endif
  1210. ifeq ($(FULL_TARGET),x86_64-darwin)
  1211. REQUIRE_PACKAGES_X11=1
  1212. REQUIRE_PACKAGES_OPENGL=1
  1213. REQUIRE_PACKAGES_GTK1=1
  1214. endif
  1215. ifeq ($(FULL_TARGET),x86_64-win64)
  1216. REQUIRE_PACKAGES_OPENGL=1
  1217. REQUIRE_PACKAGES_GTK1=1
  1218. endif
  1219. ifeq ($(FULL_TARGET),x86_64-embedded)
  1220. REQUIRE_PACKAGES_OPENGL=1
  1221. REQUIRE_PACKAGES_GTK1=1
  1222. endif
  1223. ifeq ($(FULL_TARGET),arm-linux)
  1224. REQUIRE_PACKAGES_X11=1
  1225. REQUIRE_PACKAGES_OPENGL=1
  1226. REQUIRE_PACKAGES_GTK1=1
  1227. endif
  1228. ifeq ($(FULL_TARGET),arm-palmos)
  1229. REQUIRE_PACKAGES_OPENGL=1
  1230. REQUIRE_PACKAGES_GTK1=1
  1231. endif
  1232. ifeq ($(FULL_TARGET),arm-darwin)
  1233. REQUIRE_PACKAGES_X11=1
  1234. REQUIRE_PACKAGES_OPENGL=1
  1235. REQUIRE_PACKAGES_GTK1=1
  1236. endif
  1237. ifeq ($(FULL_TARGET),arm-wince)
  1238. REQUIRE_PACKAGES_OPENGL=1
  1239. REQUIRE_PACKAGES_GTK1=1
  1240. endif
  1241. ifeq ($(FULL_TARGET),arm-gba)
  1242. REQUIRE_PACKAGES_OPENGL=1
  1243. REQUIRE_PACKAGES_GTK1=1
  1244. endif
  1245. ifeq ($(FULL_TARGET),arm-nds)
  1246. REQUIRE_PACKAGES_OPENGL=1
  1247. REQUIRE_PACKAGES_GTK1=1
  1248. endif
  1249. ifeq ($(FULL_TARGET),arm-embedded)
  1250. REQUIRE_PACKAGES_OPENGL=1
  1251. REQUIRE_PACKAGES_GTK1=1
  1252. endif
  1253. ifeq ($(FULL_TARGET),arm-symbian)
  1254. REQUIRE_PACKAGES_OPENGL=1
  1255. REQUIRE_PACKAGES_GTK1=1
  1256. endif
  1257. ifeq ($(FULL_TARGET),powerpc64-linux)
  1258. REQUIRE_PACKAGES_X11=1
  1259. REQUIRE_PACKAGES_OPENGL=1
  1260. REQUIRE_PACKAGES_GTK1=1
  1261. endif
  1262. ifeq ($(FULL_TARGET),powerpc64-darwin)
  1263. REQUIRE_PACKAGES_X11=1
  1264. REQUIRE_PACKAGES_OPENGL=1
  1265. REQUIRE_PACKAGES_GTK1=1
  1266. endif
  1267. ifeq ($(FULL_TARGET),powerpc64-embedded)
  1268. REQUIRE_PACKAGES_OPENGL=1
  1269. REQUIRE_PACKAGES_GTK1=1
  1270. endif
  1271. ifeq ($(FULL_TARGET),avr-embedded)
  1272. REQUIRE_PACKAGES_OPENGL=1
  1273. REQUIRE_PACKAGES_GTK1=1
  1274. endif
  1275. ifeq ($(FULL_TARGET),armeb-linux)
  1276. REQUIRE_PACKAGES_X11=1
  1277. REQUIRE_PACKAGES_OPENGL=1
  1278. REQUIRE_PACKAGES_GTK1=1
  1279. endif
  1280. ifeq ($(FULL_TARGET),armeb-embedded)
  1281. REQUIRE_PACKAGES_OPENGL=1
  1282. REQUIRE_PACKAGES_GTK1=1
  1283. endif
  1284. ifdef REQUIRE_PACKAGES_X11
  1285. PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
  1286. ifneq ($(PACKAGEDIR_X11),)
  1287. ifneq ($(wildcard $(PACKAGEDIR_X11)/units/$(TARGETSUFFIX)),)
  1288. UNITDIR_X11=$(PACKAGEDIR_X11)/units/$(TARGETSUFFIX)
  1289. else
  1290. UNITDIR_X11=$(PACKAGEDIR_X11)
  1291. endif
  1292. ifdef CHECKDEPEND
  1293. $(PACKAGEDIR_X11)/$(FPCMADE):
  1294. $(MAKE) -C $(PACKAGEDIR_X11) $(FPCMADE)
  1295. override ALLDEPENDENCIES+=$(PACKAGEDIR_X11)/$(FPCMADE)
  1296. endif
  1297. else
  1298. PACKAGEDIR_X11=
  1299. UNITDIR_X11:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /x11/Package.fpc,$(UNITSDIR)))))
  1300. ifneq ($(UNITDIR_X11),)
  1301. UNITDIR_X11:=$(firstword $(UNITDIR_X11))
  1302. else
  1303. UNITDIR_X11=
  1304. endif
  1305. endif
  1306. ifdef UNITDIR_X11
  1307. override COMPILER_UNITDIR+=$(UNITDIR_X11)
  1308. endif
  1309. endif
  1310. ifdef REQUIRE_PACKAGES_OPENGL
  1311. PACKAGEDIR_OPENGL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /opengl/Makefile.fpc,$(PACKAGESDIR))))))
  1312. ifneq ($(PACKAGEDIR_OPENGL),)
  1313. ifneq ($(wildcard $(PACKAGEDIR_OPENGL)/units/$(TARGETSUFFIX)),)
  1314. UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)/units/$(TARGETSUFFIX)
  1315. else
  1316. UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)
  1317. endif
  1318. ifdef CHECKDEPEND
  1319. $(PACKAGEDIR_OPENGL)/$(FPCMADE):
  1320. $(MAKE) -C $(PACKAGEDIR_OPENGL) $(FPCMADE)
  1321. override ALLDEPENDENCIES+=$(PACKAGEDIR_OPENGL)/$(FPCMADE)
  1322. endif
  1323. else
  1324. PACKAGEDIR_OPENGL=
  1325. UNITDIR_OPENGL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /opengl/Package.fpc,$(UNITSDIR)))))
  1326. ifneq ($(UNITDIR_OPENGL),)
  1327. UNITDIR_OPENGL:=$(firstword $(UNITDIR_OPENGL))
  1328. else
  1329. UNITDIR_OPENGL=
  1330. endif
  1331. endif
  1332. ifdef UNITDIR_OPENGL
  1333. override COMPILER_UNITDIR+=$(UNITDIR_OPENGL)
  1334. endif
  1335. endif
  1336. ifdef REQUIRE_PACKAGES_GTK1
  1337. PACKAGEDIR_GTK1:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /gtk1/Makefile.fpc,$(PACKAGESDIR))))))
  1338. ifneq ($(PACKAGEDIR_GTK1),)
  1339. ifneq ($(wildcard $(PACKAGEDIR_GTK1)/units/$(TARGETSUFFIX)),)
  1340. UNITDIR_GTK1=$(PACKAGEDIR_GTK1)/units/$(TARGETSUFFIX)
  1341. else
  1342. UNITDIR_GTK1=$(PACKAGEDIR_GTK1)
  1343. endif
  1344. ifdef CHECKDEPEND
  1345. $(PACKAGEDIR_GTK1)/$(FPCMADE):
  1346. $(MAKE) -C $(PACKAGEDIR_GTK1) $(FPCMADE)
  1347. override ALLDEPENDENCIES+=$(PACKAGEDIR_GTK1)/$(FPCMADE)
  1348. endif
  1349. else
  1350. PACKAGEDIR_GTK1=
  1351. UNITDIR_GTK1:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /gtk1/Package.fpc,$(UNITSDIR)))))
  1352. ifneq ($(UNITDIR_GTK1),)
  1353. UNITDIR_GTK1:=$(firstword $(UNITDIR_GTK1))
  1354. else
  1355. UNITDIR_GTK1=
  1356. endif
  1357. endif
  1358. ifdef UNITDIR_GTK1
  1359. override COMPILER_UNITDIR+=$(UNITDIR_GTK1)
  1360. endif
  1361. endif
  1362. ifndef NOCPUDEF
  1363. override FPCOPTDEF=$(ARCH)
  1364. endif
  1365. ifneq ($(OS_TARGET),$(OS_SOURCE))
  1366. override FPCOPT+=-T$(OS_TARGET)
  1367. endif
  1368. ifneq ($(CPU_TARGET),$(CPU_SOURCE))
  1369. override FPCOPT+=-P$(ARCH)
  1370. endif
  1371. ifeq ($(OS_SOURCE),openbsd)
  1372. override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
  1373. endif
  1374. ifndef CROSSBOOTSTRAP
  1375. ifneq ($(BINUTILSPREFIX),)
  1376. override FPCOPT+=-XP$(BINUTILSPREFIX)
  1377. endif
  1378. ifneq ($(BINUTILSPREFIX),)
  1379. override FPCOPT+=-Xr$(RLINKPATH)
  1380. endif
  1381. endif
  1382. ifdef UNITDIR
  1383. override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
  1384. endif
  1385. ifdef LIBDIR
  1386. override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
  1387. endif
  1388. ifdef OBJDIR
  1389. override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
  1390. endif
  1391. ifdef INCDIR
  1392. override FPCOPT+=$(addprefix -Fi,$(INCDIR))
  1393. endif
  1394. ifdef LINKSMART
  1395. override FPCOPT+=-XX
  1396. endif
  1397. ifdef CREATESMART
  1398. override FPCOPT+=-CX
  1399. endif
  1400. ifdef DEBUG
  1401. override FPCOPT+=-gl
  1402. override FPCOPTDEF+=DEBUG
  1403. endif
  1404. ifdef RELEASE
  1405. ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
  1406. ifeq ($(CPU_TARGET),i386)
  1407. FPCCPUOPT:=-OG2p3
  1408. endif
  1409. ifeq ($(CPU_TARGET),powerpc)
  1410. FPCCPUOPT:=-O1r
  1411. endif
  1412. else
  1413. FPCCPUOPT:=-O2
  1414. endif
  1415. override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
  1416. override FPCOPTDEF+=RELEASE
  1417. endif
  1418. ifdef STRIP
  1419. override FPCOPT+=-Xs
  1420. endif
  1421. ifdef OPTIMIZE
  1422. override FPCOPT+=-O2
  1423. endif
  1424. ifdef VERBOSE
  1425. override FPCOPT+=-vwni
  1426. endif
  1427. ifdef COMPILER_OPTIONS
  1428. override FPCOPT+=$(COMPILER_OPTIONS)
  1429. endif
  1430. ifdef COMPILER_UNITDIR
  1431. override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
  1432. endif
  1433. ifdef COMPILER_LIBRARYDIR
  1434. override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
  1435. endif
  1436. ifdef COMPILER_OBJECTDIR
  1437. override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
  1438. endif
  1439. ifdef COMPILER_INCLUDEDIR
  1440. override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
  1441. endif
  1442. ifdef CROSSBINDIR
  1443. override FPCOPT+=-FD$(CROSSBINDIR)
  1444. endif
  1445. ifdef COMPILER_TARGETDIR
  1446. override FPCOPT+=-FE$(COMPILER_TARGETDIR)
  1447. ifeq ($(COMPILER_TARGETDIR),.)
  1448. override TARGETDIRPREFIX=
  1449. else
  1450. override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
  1451. endif
  1452. endif
  1453. ifdef COMPILER_UNITTARGETDIR
  1454. override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
  1455. ifeq ($(COMPILER_UNITTARGETDIR),.)
  1456. override UNITTARGETDIRPREFIX=
  1457. else
  1458. override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
  1459. endif
  1460. else
  1461. ifdef COMPILER_TARGETDIR
  1462. override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
  1463. override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
  1464. endif
  1465. endif
  1466. ifdef CREATESHARED
  1467. override FPCOPT+=-Cg
  1468. ifeq ($(CPU_TARGET),i386)
  1469. override FPCOPT+=-Aas
  1470. endif
  1471. endif
  1472. ifeq ($(findstring 2.0.,$(FPC_VERSION)),)
  1473. ifeq ($(OS_TARGET),linux)
  1474. ifeq ($(CPU_TARGET),x86_64)
  1475. override FPCOPT+=-Cg
  1476. endif
  1477. endif
  1478. endif
  1479. ifdef LINKSHARED
  1480. endif
  1481. ifdef GCCLIBDIR
  1482. override FPCOPT+=-Fl$(GCCLIBDIR)
  1483. endif
  1484. ifdef OTHERLIBDIR
  1485. override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
  1486. endif
  1487. ifdef OPT
  1488. override FPCOPT+=$(OPT)
  1489. endif
  1490. ifdef FPCOPTDEF
  1491. override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
  1492. endif
  1493. ifdef CFGFILE
  1494. override FPCOPT+=@$(CFGFILE)
  1495. endif
  1496. ifdef USEENV
  1497. override FPCEXTCMD:=$(FPCOPT)
  1498. override FPCOPT:=!FPCEXTCMD
  1499. export FPCEXTCMD
  1500. endif
  1501. override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
  1502. override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
  1503. ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
  1504. override ACROSSCOMPILE=1
  1505. endif
  1506. ifdef ACROSSCOMPILE
  1507. override FPCOPT+=$(CROSSOPT)
  1508. endif
  1509. override COMPILER:=$(FPC) $(FPCOPT)
  1510. ifeq (,$(findstring -s ,$(COMPILER)))
  1511. EXECPPAS=
  1512. else
  1513. ifeq ($(FULL_SOURCE),$(FULL_TARGET))
  1514. ifdef RUNBATCH
  1515. EXECPPAS:=@$(RUNBATCH) $(PPAS)
  1516. else
  1517. EXECPPAS:=@$(PPAS)
  1518. endif
  1519. endif
  1520. endif
  1521. ifdef TARGET_RSTS
  1522. override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
  1523. override CLEANRSTFILES+=$(RSTFILES)
  1524. endif
  1525. .PHONY: fpc_clean fpc_cleanall fpc_distclean
  1526. ifdef EXEFILES
  1527. override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
  1528. endif
  1529. ifdef CLEAN_UNITS
  1530. override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
  1531. endif
  1532. ifdef CLEANPPUFILES
  1533. override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
  1534. ifdef DEBUGSYMEXT
  1535. override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
  1536. endif
  1537. override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
  1538. override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
  1539. endif
  1540. fpc_clean: $(CLEANTARGET)
  1541. ifdef CLEANEXEFILES
  1542. -$(DEL) $(CLEANEXEFILES)
  1543. endif
  1544. ifdef CLEANPPUFILES
  1545. -$(DEL) $(CLEANPPUFILES)
  1546. endif
  1547. ifneq ($(CLEANPPULINKFILES),)
  1548. -$(DEL) $(CLEANPPULINKFILES)
  1549. endif
  1550. ifdef CLEANRSTFILES
  1551. -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
  1552. endif
  1553. ifdef CLEAN_FILES
  1554. -$(DEL) $(CLEAN_FILES)
  1555. endif
  1556. ifdef LIB_NAME
  1557. -$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
  1558. endif
  1559. -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  1560. -$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT)
  1561. fpc_cleanall: $(CLEANTARGET)
  1562. ifdef CLEANEXEFILES
  1563. -$(DEL) $(CLEANEXEFILES)
  1564. endif
  1565. ifdef COMPILER_UNITTARGETDIR
  1566. ifdef CLEANPPUFILES
  1567. -$(DEL) $(CLEANPPUFILES)
  1568. endif
  1569. ifneq ($(CLEANPPULINKFILES),)
  1570. -$(DEL) $(CLEANPPULINKFILES)
  1571. endif
  1572. ifdef CLEANRSTFILES
  1573. -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
  1574. endif
  1575. endif
  1576. -$(DELTREE) units
  1577. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  1578. ifneq ($(PPUEXT),.ppu)
  1579. -$(DEL) *.o *.ppu *.a
  1580. endif
  1581. -$(DELTREE) *$(SMARTEXT)
  1582. -$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  1583. -$(DEL) *_ppas$(BATCHEXT)
  1584. ifdef AOUTEXT
  1585. -$(DEL) *$(AOUTEXT)
  1586. endif
  1587. ifdef DEBUGSYMEXT
  1588. -$(DEL) *$(DEBUGSYMEXT)
  1589. endif
  1590. fpc_distclean: cleanall
  1591. .PHONY: fpc_baseinfo
  1592. override INFORULES+=fpc_baseinfo
  1593. fpc_baseinfo:
  1594. @$(ECHO)
  1595. @$(ECHO) == Package info ==
  1596. @$(ECHO) Package Name..... $(PACKAGE_NAME)
  1597. @$(ECHO) Package Version.. $(PACKAGE_VERSION)
  1598. @$(ECHO)
  1599. @$(ECHO) == Configuration info ==
  1600. @$(ECHO)
  1601. @$(ECHO) FPC.......... $(FPC)
  1602. @$(ECHO) FPC Version.. $(FPC_VERSION)
  1603. @$(ECHO) Source CPU... $(CPU_SOURCE)
  1604. @$(ECHO) Target CPU... $(CPU_TARGET)
  1605. @$(ECHO) Source OS.... $(OS_SOURCE)
  1606. @$(ECHO) Target OS.... $(OS_TARGET)
  1607. @$(ECHO) Full Source.. $(FULL_SOURCE)
  1608. @$(ECHO) Full Target.. $(FULL_TARGET)
  1609. @$(ECHO) SourceSuffix. $(SOURCESUFFIX)
  1610. @$(ECHO) TargetSuffix. $(TARGETSUFFIX)
  1611. @$(ECHO)
  1612. @$(ECHO) == Directory info ==
  1613. @$(ECHO)
  1614. @$(ECHO) Required pkgs... $(REQUIRE_PACKAGES)
  1615. @$(ECHO)
  1616. @$(ECHO) Basedir......... $(BASEDIR)
  1617. @$(ECHO) FPCDir.......... $(FPCDIR)
  1618. @$(ECHO) CrossBinDir..... $(CROSSBINDIR)
  1619. @$(ECHO) UnitsDir........ $(UNITSDIR)
  1620. @$(ECHO) PackagesDir..... $(PACKAGESDIR)
  1621. @$(ECHO)
  1622. @$(ECHO) GCC library..... $(GCCLIBDIR)
  1623. @$(ECHO) Other library... $(OTHERLIBDIR)
  1624. @$(ECHO)
  1625. @$(ECHO) == Tools info ==
  1626. @$(ECHO)
  1627. @$(ECHO) As........ $(AS)
  1628. @$(ECHO) Ld........ $(LD)
  1629. @$(ECHO) Ar........ $(AR)
  1630. @$(ECHO) Rc........ $(RC)
  1631. @$(ECHO)
  1632. @$(ECHO) Mv........ $(MVPROG)
  1633. @$(ECHO) Cp........ $(CPPROG)
  1634. @$(ECHO) Rm........ $(RMPROG)
  1635. @$(ECHO) GInstall.. $(GINSTALL)
  1636. @$(ECHO) Echo...... $(ECHO)
  1637. @$(ECHO) Shell..... $(SHELL)
  1638. @$(ECHO) Date...... $(DATE)
  1639. @$(ECHO) FPCMake... $(FPCMAKE)
  1640. @$(ECHO) PPUMove... $(PPUMOVE)
  1641. @$(ECHO) Upx....... $(UPXPROG)
  1642. @$(ECHO) Zip....... $(ZIPPROG)
  1643. @$(ECHO)
  1644. @$(ECHO) == Object info ==
  1645. @$(ECHO)
  1646. @$(ECHO) Target Loaders........ $(TARGET_LOADERS)
  1647. @$(ECHO) Target Units.......... $(TARGET_UNITS)
  1648. @$(ECHO) Target Implicit Units. $(TARGET_IMPLICITUNITS)
  1649. @$(ECHO) Target Programs....... $(TARGET_PROGRAMS)
  1650. @$(ECHO) Target Dirs........... $(TARGET_DIRS)
  1651. @$(ECHO) Target Examples....... $(TARGET_EXAMPLES)
  1652. @$(ECHO) Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
  1653. @$(ECHO)
  1654. @$(ECHO) Clean Units......... $(CLEAN_UNITS)
  1655. @$(ECHO) Clean Files......... $(CLEAN_FILES)
  1656. @$(ECHO)
  1657. @$(ECHO) Install Units....... $(INSTALL_UNITS)
  1658. @$(ECHO) Install Files....... $(INSTALL_FILES)
  1659. @$(ECHO)
  1660. @$(ECHO) == Install info ==
  1661. @$(ECHO)
  1662. @$(ECHO) DateStr.............. $(DATESTR)
  1663. @$(ECHO) ZipName.............. $(ZIPNAME)
  1664. @$(ECHO) ZipPrefix............ $(ZIPPREFIX)
  1665. @$(ECHO) ZipCrossPrefix....... $(ZIPCROSSPREFIX)
  1666. @$(ECHO) ZipSuffix............ $(ZIPSUFFIX)
  1667. @$(ECHO) FullZipName.......... $(FULLZIPNAME)
  1668. @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE)
  1669. @$(ECHO)
  1670. @$(ECHO) Install base dir..... $(INSTALL_BASEDIR)
  1671. @$(ECHO) Install binary dir... $(INSTALL_BINDIR)
  1672. @$(ECHO) Install library dir.. $(INSTALL_LIBDIR)
  1673. @$(ECHO) Install units dir.... $(INSTALL_UNITDIR)
  1674. @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR)
  1675. @$(ECHO) Install doc dir...... $(INSTALL_DOCDIR)
  1676. @$(ECHO) Install example dir.. $(INSTALL_EXAMPLEDIR)
  1677. @$(ECHO) Install data dir..... $(INSTALL_DATADIR)
  1678. @$(ECHO)
  1679. @$(ECHO) Dist destination dir. $(DIST_DESTDIR)
  1680. @$(ECHO) Dist zip name........ $(DIST_ZIPNAME)
  1681. @$(ECHO)
  1682. .PHONY: fpc_info
  1683. fpc_info: $(INFORULES)
  1684. .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
  1685. fpc_makefile_dirs
  1686. fpc_makefile:
  1687. $(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
  1688. fpc_makefile_sub1:
  1689. ifdef TARGET_DIRS
  1690. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
  1691. endif
  1692. ifdef TARGET_EXAMPLEDIRS
  1693. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
  1694. endif
  1695. fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
  1696. fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
  1697. fpc_makefiles: fpc_makefile fpc_makefile_dirs
  1698. all:
  1699. debug:
  1700. smart:
  1701. release:
  1702. units:
  1703. examples:
  1704. shared:
  1705. install:
  1706. sourceinstall:
  1707. exampleinstall:
  1708. distinstall:
  1709. zipinstall:
  1710. zipsourceinstall:
  1711. zipexampleinstall:
  1712. zipdistinstall:
  1713. clean:
  1714. distclean:
  1715. cleanall:
  1716. info: fpc_info
  1717. makefiles: fpc_makefiles
  1718. .PHONY: all debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
  1719. ifneq ($(wildcard fpcmake.loc),)
  1720. include fpcmake.loc
  1721. endif
  1722. .NOTPARALLEL: