Makefile 55 KB

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