Makefile 40 KB

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