Makefile 47 KB

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