Makefile 52 KB

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