Makefile 42 KB

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