Makefile 48 KB

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