Makefile 57 KB

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