Makefile 52 KB

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