Makefile 37 KB

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