Makefile 37 KB

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