Makefile 49 KB

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