Makefile 92 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620
  1. #
  2. # Don't edit, this file is generated by FPCMake Version 2.0.0 [2013/10/30]
  3. #
  4. default: all
  5. MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
  6. BSDs = freebsd netbsd openbsd darwin
  7. UNIXs = linux $(BSDs) solaris qnx haiku
  8. LIMIT83fs = go32v2 os2 emx watcom
  9. OSNeedsComspecToRunBatch = go32v2 watcom
  10. FORCE:
  11. .PHONY: FORCE
  12. override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
  13. ifneq ($(findstring darwin,$(OSTYPE)),)
  14. inUnix=1 #darwin
  15. SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
  16. else
  17. ifeq ($(findstring ;,$(PATH)),)
  18. inUnix=1
  19. SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
  20. else
  21. SEARCHPATH:=$(subst ;, ,$(PATH))
  22. endif
  23. endif
  24. SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
  25. PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
  26. ifeq ($(PWD),)
  27. PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
  28. ifeq ($(PWD),)
  29. $(error You need the GNU utils package to use this Makefile)
  30. else
  31. PWD:=$(firstword $(PWD))
  32. SRCEXEEXT=
  33. endif
  34. else
  35. PWD:=$(firstword $(PWD))
  36. SRCEXEEXT=.exe
  37. endif
  38. ifndef inUnix
  39. ifeq ($(OS),Windows_NT)
  40. inWinNT=1
  41. else
  42. ifdef OS2_SHELL
  43. inOS2=1
  44. endif
  45. endif
  46. else
  47. ifneq ($(findstring cygdrive,$(PATH)),)
  48. inCygWin=1
  49. endif
  50. endif
  51. ifdef inUnix
  52. SRCBATCHEXT=.sh
  53. else
  54. ifdef inOS2
  55. SRCBATCHEXT=.cmd
  56. else
  57. SRCBATCHEXT=.bat
  58. endif
  59. endif
  60. ifdef COMSPEC
  61. ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
  62. ifndef RUNBATCH
  63. RUNBATCH=$(COMSPEC) /C
  64. endif
  65. endif
  66. endif
  67. ifdef inUnix
  68. PATHSEP=/
  69. else
  70. PATHSEP:=$(subst /,\,/)
  71. ifdef inCygWin
  72. PATHSEP=/
  73. endif
  74. endif
  75. ifdef PWD
  76. BASEDIR:=$(subst \,/,$(shell $(PWD)))
  77. ifdef inCygWin
  78. ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
  79. BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
  80. BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
  81. BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
  82. endif
  83. endif
  84. else
  85. BASEDIR=.
  86. endif
  87. ifdef inOS2
  88. ifndef ECHO
  89. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  90. ifeq ($(ECHO),)
  91. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  92. ifeq ($(ECHO),)
  93. ECHO=echo
  94. else
  95. ECHO:=$(firstword $(ECHO))
  96. endif
  97. else
  98. ECHO:=$(firstword $(ECHO))
  99. endif
  100. endif
  101. export ECHO
  102. endif
  103. override DEFAULT_FPCDIR=..
  104. ifndef FPC
  105. ifdef PP
  106. FPC=$(PP)
  107. endif
  108. endif
  109. ifndef FPC
  110. FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
  111. ifneq ($(FPCPROG),)
  112. FPCPROG:=$(firstword $(FPCPROG))
  113. ifneq ($(CPU_TARGET),)
  114. FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
  115. else
  116. FPC:=$(shell $(FPCPROG) -PB)
  117. endif
  118. ifneq ($(findstring Error,$(FPC)),)
  119. override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
  120. else
  121. ifeq ($(strip $(wildcard $(FPC))),)
  122. FPC:=$(firstword $(FPCPROG))
  123. endif
  124. endif
  125. else
  126. override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
  127. endif
  128. endif
  129. override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
  130. override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
  131. FOUNDFPC:=$(strip $(wildcard $(FPC)))
  132. ifeq ($(FOUNDFPC),)
  133. FOUNDFPC=$(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))
  134. ifeq ($(FOUNDFPC),)
  135. $(error Compiler $(FPC) not found)
  136. endif
  137. endif
  138. ifndef FPC_COMPILERINFO
  139. FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
  140. endif
  141. ifndef FPC_VERSION
  142. FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
  143. endif
  144. export FPC FPC_VERSION FPC_COMPILERINFO
  145. unexport CHECKDEPEND ALLDEPENDENCIES
  146. ifndef CPU_TARGET
  147. ifdef CPU_TARGET_DEFAULT
  148. CPU_TARGET=$(CPU_TARGET_DEFAULT)
  149. endif
  150. endif
  151. ifndef OS_TARGET
  152. ifdef OS_TARGET_DEFAULT
  153. OS_TARGET=$(OS_TARGET_DEFAULT)
  154. endif
  155. endif
  156. ifndef CPU_SOURCE
  157. CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
  158. endif
  159. ifndef CPU_TARGET
  160. CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
  161. endif
  162. ifndef OS_SOURCE
  163. OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
  164. endif
  165. ifndef OS_TARGET
  166. OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
  167. endif
  168. FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
  169. FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
  170. ifeq ($(CPU_TARGET),armeb)
  171. ARCH=arm
  172. override FPCOPT+=-Cb
  173. else
  174. ifeq ($(CPU_TARGET),armel)
  175. ARCH=arm
  176. override FPCOPT+=-CaEABI
  177. else
  178. ARCH=$(CPU_TARGET)
  179. endif
  180. endif
  181. ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
  182. TARGETSUFFIX=$(OS_TARGET)
  183. SOURCESUFFIX=$(OS_SOURCE)
  184. else
  185. ifneq ($(findstring $(OS_TARGET),$(LIMIT83fs)),)
  186. TARGETSUFFIX=$(OS_TARGET)
  187. else
  188. TARGETSUFFIX=$(FULL_TARGET)
  189. endif
  190. SOURCESUFFIX=$(FULL_SOURCE)
  191. endif
  192. ifneq ($(FULL_TARGET),$(FULL_SOURCE))
  193. CROSSCOMPILE=1
  194. endif
  195. ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
  196. ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),)
  197. $(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
  198. endif
  199. endif
  200. ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
  201. BSDhier=1
  202. endif
  203. ifeq ($(OS_TARGET),linux)
  204. linuxHier=1
  205. endif
  206. export OS_TARGET OS_SOURCE ARCH CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE
  207. ifdef FPCDIR
  208. override FPCDIR:=$(subst \,/,$(FPCDIR))
  209. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  210. override FPCDIR=wrong
  211. endif
  212. else
  213. override FPCDIR=wrong
  214. endif
  215. ifdef DEFAULT_FPCDIR
  216. ifeq ($(FPCDIR),wrong)
  217. override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
  218. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  219. override FPCDIR=wrong
  220. endif
  221. endif
  222. endif
  223. ifeq ($(FPCDIR),wrong)
  224. ifdef inUnix
  225. override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
  226. ifeq ($(wildcard $(FPCDIR)/units),)
  227. override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
  228. endif
  229. else
  230. override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
  231. override FPCDIR:=$(FPCDIR)/..
  232. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  233. override FPCDIR:=$(FPCDIR)/..
  234. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  235. override FPCDIR:=$(BASEDIR)
  236. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  237. override FPCDIR=c:/pp
  238. endif
  239. endif
  240. endif
  241. endif
  242. endif
  243. ifndef CROSSBINDIR
  244. CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
  245. endif
  246. ifneq ($(findstring $(OS_TARGET),darwin iphonesim),)
  247. ifeq ($(OS_SOURCE),darwin)
  248. DARWIN2DARWIN=1
  249. endif
  250. endif
  251. ifndef BINUTILSPREFIX
  252. ifndef CROSSBINDIR
  253. ifdef CROSSCOMPILE
  254. ifndef DARWIN2DARWIN
  255. BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)-
  256. endif
  257. endif
  258. endif
  259. endif
  260. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX))
  261. ifeq ($(UNITSDIR),)
  262. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
  263. endif
  264. PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
  265. ifndef FPCFPMAKE
  266. ifdef CROSSCOMPILE
  267. ifeq ($(strip $(wildcard $(addsuffix /compiler/ppc$(SRCEXEEXT),$(FPCDIR)))),)
  268. FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
  269. ifneq ($(FPCPROG),)
  270. FPCPROG:=$(firstword $(FPCPROG))
  271. FPCFPMAKE:=$(shell $(FPCPROG) -PB)
  272. ifeq ($(strip $(wildcard $(FPCFPMAKE))),)
  273. FPCFPMAKE:=$(firstword $(FPCPROG))
  274. endif
  275. else
  276. override FPCFPMAKE=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
  277. endif
  278. else
  279. FPCFPMAKE=$(strip $(wildcard $(addsuffix /compiler/ppc$(SRCEXEEXT),$(FPCDIR))))
  280. FPMAKE_SKIP_CONFIG=-n
  281. export FPCFPMAKE
  282. export FPMAKE_SKIP_CONFIG
  283. endif
  284. else
  285. FPMAKE_SKIP_CONFIG=-n
  286. FPCFPMAKE=$(FPC)
  287. endif
  288. endif
  289. override PACKAGE_NAME=compiler
  290. override PACKAGE_VERSION=2.6.4
  291. unexport FPC_VERSION FPC_COMPILERINFO
  292. CYCLETARGETS=i386 powerpc sparc arm x86_64 powerpc64 m68k armeb mipsel mips avr
  293. ALLTARGETS=$(CYCLETARGETS)
  294. ifdef ALPHA
  295. PPC_TARGET=alpha
  296. endif
  297. ifdef POWERPC
  298. PPC_TARGET=powerpc
  299. endif
  300. ifdef POWERPC64
  301. PPC_TARGET=powerpc64
  302. endif
  303. ifdef SPARC
  304. PPC_TARGET=sparc
  305. endif
  306. ifdef M68K
  307. PPC_TARGET=m68k
  308. endif
  309. ifdef I386
  310. PPC_TARGET=i386
  311. endif
  312. ifdef X86_64
  313. PPC_TARGET=x86_64
  314. endif
  315. ifdef ARM
  316. PPC_TARGET=arm
  317. endif
  318. ifdef ARMEB
  319. PPC_TARGET=armeb
  320. endif
  321. ifdef MIPS
  322. PPC_TARGET=mips
  323. endif
  324. ifdef MIPSEL
  325. PPC_TARGET=mipsel
  326. endif
  327. ifndef PPC_TARGET
  328. PPC_TARGET=$(CPU_TARGET)
  329. endif
  330. ifeq ($(PPC_TARGET),armeb)
  331. CPC_TARGET=arm
  332. else
  333. CPC_TARGET=$(PPC_TARGET)
  334. endif
  335. ifndef PPC_OS
  336. PPC_OS=$(OS_TARGET)
  337. endif
  338. CPU_UNITDIR=$(CPC_TARGET)
  339. UTILSDIR=../utils
  340. COMPILERSOURCEDIR=$(CPC_TARGET) systems
  341. COMPILERUTILSDIR=utils
  342. ifndef FPCLANG
  343. FPCLANG=e
  344. endif
  345. ifndef LOCALOPT
  346. LOCALOPT:=$(OPT)
  347. endif
  348. ifndef RTLOPT
  349. RTLOPT:=$(OPT)
  350. endif
  351. override OPT=
  352. MSGFILES=$(wildcard msg/error*.msg)
  353. ifeq ($(CPC_TARGET),i386)
  354. CPUSUF=386
  355. endif
  356. ifeq ($(CPC_TARGET),alpha)
  357. CPUSUF=axp
  358. endif
  359. ifeq ($(CPC_TARGET),m68k)
  360. CPUSUF=68k
  361. endif
  362. ifeq ($(CPC_TARGET),powerpc)
  363. CPUSUF=ppc
  364. endif
  365. ifeq ($(CPC_TARGET),powerpc64)
  366. CPUSUF=ppc64
  367. endif
  368. ifeq ($(CPC_TARGET),sparc)
  369. CPUSUF=sparc
  370. endif
  371. ifeq ($(CPC_TARGET),x86_64)
  372. CPUSUF=x64
  373. endif
  374. ifeq ($(CPC_TARGET),arm)
  375. CPUSUF=arm
  376. endif
  377. ifeq ($(CPC_TARGET),mips)
  378. CPUSUF=mips
  379. endif
  380. ifeq ($(CPC_TARGET),mipsel)
  381. CPUSUF=mipsel
  382. endif
  383. NOCPUDEF=1
  384. MSGFILE=msg/error$(FPCLANG).msg
  385. SVNVERSION:=$(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH)))
  386. REVINC:=$(wildcard revision.inc)
  387. ifneq ($(REVINC),)
  388. override LOCALOPT+=-dREVINC
  389. ifeq ($(REVSTR),)
  390. ifneq ($(SVNVERSION),)
  391. REVSTR:=$(shell $(SVNVERSION) -c .)
  392. export REVSTR
  393. else
  394. ifeq ($(REVINC),force)
  395. REVSTR:=exported
  396. export REVSTR
  397. endif
  398. endif
  399. endif
  400. endif
  401. override LOCALOPT+=-d$(CPC_TARGET) -dGDB -dBROWSERLOG
  402. ifeq ($(PPC_TARGET),i386)
  403. override LOCALOPT+=-Fux86
  404. endif
  405. ifeq ($(PPC_TARGET),x86_64)
  406. override LOCALOPT+=-Fux86
  407. endif
  408. ifeq ($(PPC_TARGET),powerpc)
  409. override LOCALOPT+=-Fuppcgen
  410. endif
  411. ifeq ($(PPC_TARGET),powerpc64)
  412. override LOCALOPT+=-Fuppcgen
  413. endif
  414. ifeq ($(PPC_TARGET),m68k)
  415. override LOCALOPT+=-dNOOPT
  416. endif
  417. ifeq ($(PPC_TARGET),sparc)
  418. override LOCALOPT+=
  419. endif
  420. ifeq ($(PPC_TARGET),m68k)
  421. ifeq ($(OS_TARGET),amiga)
  422. override LOCALOPT+=-Ct
  423. endif
  424. endif
  425. ifeq ($(PPC_TARGET),arm)
  426. override LOCALOPT+=
  427. endif
  428. ifeq ($(PPC_TARGET),mipsel)
  429. override LOCALOPT+=-Fumips
  430. endif
  431. OPTWPOCOLLECT=-OWdevirtcalls,optvmts -FW$(BASEDIR)/pp1.wpo
  432. OPTWPOPERFORM=-Owdevirtcalls,optvmts -Fw$(BASEDIR)/pp1.wpo
  433. ifneq ($(findstring $(OS_TARGET),darwin linux freebsd solaris),)
  434. ifdef LINKSMART
  435. ifdef CREATESMART
  436. OPTWPOCOLLECT+=-OWsymbolliveness -Xs-
  437. OPTWPOPERFORM+=-Owsymbolliveness
  438. endif
  439. endif
  440. endif
  441. ifeq ($(FULL_TARGET),i386-linux)
  442. override TARGET_DIRS+=utils
  443. endif
  444. ifeq ($(FULL_TARGET),i386-go32v2)
  445. override TARGET_DIRS+=utils
  446. endif
  447. ifeq ($(FULL_TARGET),i386-win32)
  448. override TARGET_DIRS+=utils
  449. endif
  450. ifeq ($(FULL_TARGET),i386-os2)
  451. override TARGET_DIRS+=utils
  452. endif
  453. ifeq ($(FULL_TARGET),i386-freebsd)
  454. override TARGET_DIRS+=utils
  455. endif
  456. ifeq ($(FULL_TARGET),i386-beos)
  457. override TARGET_DIRS+=utils
  458. endif
  459. ifeq ($(FULL_TARGET),i386-haiku)
  460. override TARGET_DIRS+=utils
  461. endif
  462. ifeq ($(FULL_TARGET),i386-netbsd)
  463. override TARGET_DIRS+=utils
  464. endif
  465. ifeq ($(FULL_TARGET),i386-solaris)
  466. override TARGET_DIRS+=utils
  467. endif
  468. ifeq ($(FULL_TARGET),i386-qnx)
  469. override TARGET_DIRS+=utils
  470. endif
  471. ifeq ($(FULL_TARGET),i386-netware)
  472. override TARGET_DIRS+=utils
  473. endif
  474. ifeq ($(FULL_TARGET),i386-openbsd)
  475. override TARGET_DIRS+=utils
  476. endif
  477. ifeq ($(FULL_TARGET),i386-wdosx)
  478. override TARGET_DIRS+=utils
  479. endif
  480. ifeq ($(FULL_TARGET),i386-darwin)
  481. override TARGET_DIRS+=utils
  482. endif
  483. ifeq ($(FULL_TARGET),i386-emx)
  484. override TARGET_DIRS+=utils
  485. endif
  486. ifeq ($(FULL_TARGET),i386-watcom)
  487. override TARGET_DIRS+=utils
  488. endif
  489. ifeq ($(FULL_TARGET),i386-netwlibc)
  490. override TARGET_DIRS+=utils
  491. endif
  492. ifeq ($(FULL_TARGET),i386-wince)
  493. override TARGET_DIRS+=utils
  494. endif
  495. ifeq ($(FULL_TARGET),i386-embedded)
  496. override TARGET_DIRS+=utils
  497. endif
  498. ifeq ($(FULL_TARGET),i386-symbian)
  499. override TARGET_DIRS+=utils
  500. endif
  501. ifeq ($(FULL_TARGET),i386-nativent)
  502. override TARGET_DIRS+=utils
  503. endif
  504. ifeq ($(FULL_TARGET),i386-iphonesim)
  505. override TARGET_DIRS+=utils
  506. endif
  507. ifeq ($(FULL_TARGET),m68k-linux)
  508. override TARGET_DIRS+=utils
  509. endif
  510. ifeq ($(FULL_TARGET),m68k-freebsd)
  511. override TARGET_DIRS+=utils
  512. endif
  513. ifeq ($(FULL_TARGET),m68k-netbsd)
  514. override TARGET_DIRS+=utils
  515. endif
  516. ifeq ($(FULL_TARGET),m68k-amiga)
  517. override TARGET_DIRS+=utils
  518. endif
  519. ifeq ($(FULL_TARGET),m68k-atari)
  520. override TARGET_DIRS+=utils
  521. endif
  522. ifeq ($(FULL_TARGET),m68k-openbsd)
  523. override TARGET_DIRS+=utils
  524. endif
  525. ifeq ($(FULL_TARGET),m68k-palmos)
  526. override TARGET_DIRS+=utils
  527. endif
  528. ifeq ($(FULL_TARGET),m68k-embedded)
  529. override TARGET_DIRS+=utils
  530. endif
  531. ifeq ($(FULL_TARGET),powerpc-linux)
  532. override TARGET_DIRS+=utils
  533. endif
  534. ifeq ($(FULL_TARGET),powerpc-netbsd)
  535. override TARGET_DIRS+=utils
  536. endif
  537. ifeq ($(FULL_TARGET),powerpc-amiga)
  538. override TARGET_DIRS+=utils
  539. endif
  540. ifeq ($(FULL_TARGET),powerpc-macos)
  541. override TARGET_DIRS+=utils
  542. endif
  543. ifeq ($(FULL_TARGET),powerpc-darwin)
  544. override TARGET_DIRS+=utils
  545. endif
  546. ifeq ($(FULL_TARGET),powerpc-morphos)
  547. override TARGET_DIRS+=utils
  548. endif
  549. ifeq ($(FULL_TARGET),powerpc-embedded)
  550. override TARGET_DIRS+=utils
  551. endif
  552. ifeq ($(FULL_TARGET),powerpc-wii)
  553. override TARGET_DIRS+=utils
  554. endif
  555. ifeq ($(FULL_TARGET),sparc-linux)
  556. override TARGET_DIRS+=utils
  557. endif
  558. ifeq ($(FULL_TARGET),sparc-netbsd)
  559. override TARGET_DIRS+=utils
  560. endif
  561. ifeq ($(FULL_TARGET),sparc-solaris)
  562. override TARGET_DIRS+=utils
  563. endif
  564. ifeq ($(FULL_TARGET),sparc-embedded)
  565. override TARGET_DIRS+=utils
  566. endif
  567. ifeq ($(FULL_TARGET),x86_64-linux)
  568. override TARGET_DIRS+=utils
  569. endif
  570. ifeq ($(FULL_TARGET),x86_64-freebsd)
  571. override TARGET_DIRS+=utils
  572. endif
  573. ifeq ($(FULL_TARGET),x86_64-netbsd)
  574. override TARGET_DIRS+=utils
  575. endif
  576. ifeq ($(FULL_TARGET),x86_64-solaris)
  577. override TARGET_DIRS+=utils
  578. endif
  579. ifeq ($(FULL_TARGET),x86_64-openbsd)
  580. override TARGET_DIRS+=utils
  581. endif
  582. ifeq ($(FULL_TARGET),x86_64-darwin)
  583. override TARGET_DIRS+=utils
  584. endif
  585. ifeq ($(FULL_TARGET),x86_64-win64)
  586. override TARGET_DIRS+=utils
  587. endif
  588. ifeq ($(FULL_TARGET),x86_64-embedded)
  589. override TARGET_DIRS+=utils
  590. endif
  591. ifeq ($(FULL_TARGET),arm-linux)
  592. override TARGET_DIRS+=utils
  593. endif
  594. ifeq ($(FULL_TARGET),arm-palmos)
  595. override TARGET_DIRS+=utils
  596. endif
  597. ifeq ($(FULL_TARGET),arm-darwin)
  598. override TARGET_DIRS+=utils
  599. endif
  600. ifeq ($(FULL_TARGET),arm-wince)
  601. override TARGET_DIRS+=utils
  602. endif
  603. ifeq ($(FULL_TARGET),arm-gba)
  604. override TARGET_DIRS+=utils
  605. endif
  606. ifeq ($(FULL_TARGET),arm-nds)
  607. override TARGET_DIRS+=utils
  608. endif
  609. ifeq ($(FULL_TARGET),arm-embedded)
  610. override TARGET_DIRS+=utils
  611. endif
  612. ifeq ($(FULL_TARGET),arm-symbian)
  613. override TARGET_DIRS+=utils
  614. endif
  615. ifeq ($(FULL_TARGET),powerpc64-linux)
  616. override TARGET_DIRS+=utils
  617. endif
  618. ifeq ($(FULL_TARGET),powerpc64-darwin)
  619. override TARGET_DIRS+=utils
  620. endif
  621. ifeq ($(FULL_TARGET),powerpc64-embedded)
  622. override TARGET_DIRS+=utils
  623. endif
  624. ifeq ($(FULL_TARGET),avr-embedded)
  625. override TARGET_DIRS+=utils
  626. endif
  627. ifeq ($(FULL_TARGET),armeb-linux)
  628. override TARGET_DIRS+=utils
  629. endif
  630. ifeq ($(FULL_TARGET),armeb-embedded)
  631. override TARGET_DIRS+=utils
  632. endif
  633. ifeq ($(FULL_TARGET),mipsel-linux)
  634. override TARGET_DIRS+=utils
  635. endif
  636. ifeq ($(FULL_TARGET),i386-linux)
  637. override TARGET_PROGRAMS+=pp
  638. endif
  639. ifeq ($(FULL_TARGET),i386-go32v2)
  640. override TARGET_PROGRAMS+=pp
  641. endif
  642. ifeq ($(FULL_TARGET),i386-win32)
  643. override TARGET_PROGRAMS+=pp
  644. endif
  645. ifeq ($(FULL_TARGET),i386-os2)
  646. override TARGET_PROGRAMS+=pp
  647. endif
  648. ifeq ($(FULL_TARGET),i386-freebsd)
  649. override TARGET_PROGRAMS+=pp
  650. endif
  651. ifeq ($(FULL_TARGET),i386-beos)
  652. override TARGET_PROGRAMS+=pp
  653. endif
  654. ifeq ($(FULL_TARGET),i386-haiku)
  655. override TARGET_PROGRAMS+=pp
  656. endif
  657. ifeq ($(FULL_TARGET),i386-netbsd)
  658. override TARGET_PROGRAMS+=pp
  659. endif
  660. ifeq ($(FULL_TARGET),i386-solaris)
  661. override TARGET_PROGRAMS+=pp
  662. endif
  663. ifeq ($(FULL_TARGET),i386-qnx)
  664. override TARGET_PROGRAMS+=pp
  665. endif
  666. ifeq ($(FULL_TARGET),i386-netware)
  667. override TARGET_PROGRAMS+=pp
  668. endif
  669. ifeq ($(FULL_TARGET),i386-openbsd)
  670. override TARGET_PROGRAMS+=pp
  671. endif
  672. ifeq ($(FULL_TARGET),i386-wdosx)
  673. override TARGET_PROGRAMS+=pp
  674. endif
  675. ifeq ($(FULL_TARGET),i386-darwin)
  676. override TARGET_PROGRAMS+=pp
  677. endif
  678. ifeq ($(FULL_TARGET),i386-emx)
  679. override TARGET_PROGRAMS+=pp
  680. endif
  681. ifeq ($(FULL_TARGET),i386-watcom)
  682. override TARGET_PROGRAMS+=pp
  683. endif
  684. ifeq ($(FULL_TARGET),i386-netwlibc)
  685. override TARGET_PROGRAMS+=pp
  686. endif
  687. ifeq ($(FULL_TARGET),i386-wince)
  688. override TARGET_PROGRAMS+=pp
  689. endif
  690. ifeq ($(FULL_TARGET),i386-embedded)
  691. override TARGET_PROGRAMS+=pp
  692. endif
  693. ifeq ($(FULL_TARGET),i386-symbian)
  694. override TARGET_PROGRAMS+=pp
  695. endif
  696. ifeq ($(FULL_TARGET),i386-nativent)
  697. override TARGET_PROGRAMS+=pp
  698. endif
  699. ifeq ($(FULL_TARGET),i386-iphonesim)
  700. override TARGET_PROGRAMS+=pp
  701. endif
  702. ifeq ($(FULL_TARGET),m68k-linux)
  703. override TARGET_PROGRAMS+=pp
  704. endif
  705. ifeq ($(FULL_TARGET),m68k-freebsd)
  706. override TARGET_PROGRAMS+=pp
  707. endif
  708. ifeq ($(FULL_TARGET),m68k-netbsd)
  709. override TARGET_PROGRAMS+=pp
  710. endif
  711. ifeq ($(FULL_TARGET),m68k-amiga)
  712. override TARGET_PROGRAMS+=pp
  713. endif
  714. ifeq ($(FULL_TARGET),m68k-atari)
  715. override TARGET_PROGRAMS+=pp
  716. endif
  717. ifeq ($(FULL_TARGET),m68k-openbsd)
  718. override TARGET_PROGRAMS+=pp
  719. endif
  720. ifeq ($(FULL_TARGET),m68k-palmos)
  721. override TARGET_PROGRAMS+=pp
  722. endif
  723. ifeq ($(FULL_TARGET),m68k-embedded)
  724. override TARGET_PROGRAMS+=pp
  725. endif
  726. ifeq ($(FULL_TARGET),powerpc-linux)
  727. override TARGET_PROGRAMS+=pp
  728. endif
  729. ifeq ($(FULL_TARGET),powerpc-netbsd)
  730. override TARGET_PROGRAMS+=pp
  731. endif
  732. ifeq ($(FULL_TARGET),powerpc-amiga)
  733. override TARGET_PROGRAMS+=pp
  734. endif
  735. ifeq ($(FULL_TARGET),powerpc-macos)
  736. override TARGET_PROGRAMS+=pp
  737. endif
  738. ifeq ($(FULL_TARGET),powerpc-darwin)
  739. override TARGET_PROGRAMS+=pp
  740. endif
  741. ifeq ($(FULL_TARGET),powerpc-morphos)
  742. override TARGET_PROGRAMS+=pp
  743. endif
  744. ifeq ($(FULL_TARGET),powerpc-embedded)
  745. override TARGET_PROGRAMS+=pp
  746. endif
  747. ifeq ($(FULL_TARGET),powerpc-wii)
  748. override TARGET_PROGRAMS+=pp
  749. endif
  750. ifeq ($(FULL_TARGET),sparc-linux)
  751. override TARGET_PROGRAMS+=pp
  752. endif
  753. ifeq ($(FULL_TARGET),sparc-netbsd)
  754. override TARGET_PROGRAMS+=pp
  755. endif
  756. ifeq ($(FULL_TARGET),sparc-solaris)
  757. override TARGET_PROGRAMS+=pp
  758. endif
  759. ifeq ($(FULL_TARGET),sparc-embedded)
  760. override TARGET_PROGRAMS+=pp
  761. endif
  762. ifeq ($(FULL_TARGET),x86_64-linux)
  763. override TARGET_PROGRAMS+=pp
  764. endif
  765. ifeq ($(FULL_TARGET),x86_64-freebsd)
  766. override TARGET_PROGRAMS+=pp
  767. endif
  768. ifeq ($(FULL_TARGET),x86_64-netbsd)
  769. override TARGET_PROGRAMS+=pp
  770. endif
  771. ifeq ($(FULL_TARGET),x86_64-solaris)
  772. override TARGET_PROGRAMS+=pp
  773. endif
  774. ifeq ($(FULL_TARGET),x86_64-openbsd)
  775. override TARGET_PROGRAMS+=pp
  776. endif
  777. ifeq ($(FULL_TARGET),x86_64-darwin)
  778. override TARGET_PROGRAMS+=pp
  779. endif
  780. ifeq ($(FULL_TARGET),x86_64-win64)
  781. override TARGET_PROGRAMS+=pp
  782. endif
  783. ifeq ($(FULL_TARGET),x86_64-embedded)
  784. override TARGET_PROGRAMS+=pp
  785. endif
  786. ifeq ($(FULL_TARGET),arm-linux)
  787. override TARGET_PROGRAMS+=pp
  788. endif
  789. ifeq ($(FULL_TARGET),arm-palmos)
  790. override TARGET_PROGRAMS+=pp
  791. endif
  792. ifeq ($(FULL_TARGET),arm-darwin)
  793. override TARGET_PROGRAMS+=pp
  794. endif
  795. ifeq ($(FULL_TARGET),arm-wince)
  796. override TARGET_PROGRAMS+=pp
  797. endif
  798. ifeq ($(FULL_TARGET),arm-gba)
  799. override TARGET_PROGRAMS+=pp
  800. endif
  801. ifeq ($(FULL_TARGET),arm-nds)
  802. override TARGET_PROGRAMS+=pp
  803. endif
  804. ifeq ($(FULL_TARGET),arm-embedded)
  805. override TARGET_PROGRAMS+=pp
  806. endif
  807. ifeq ($(FULL_TARGET),arm-symbian)
  808. override TARGET_PROGRAMS+=pp
  809. endif
  810. ifeq ($(FULL_TARGET),powerpc64-linux)
  811. override TARGET_PROGRAMS+=pp
  812. endif
  813. ifeq ($(FULL_TARGET),powerpc64-darwin)
  814. override TARGET_PROGRAMS+=pp
  815. endif
  816. ifeq ($(FULL_TARGET),powerpc64-embedded)
  817. override TARGET_PROGRAMS+=pp
  818. endif
  819. ifeq ($(FULL_TARGET),avr-embedded)
  820. override TARGET_PROGRAMS+=pp
  821. endif
  822. ifeq ($(FULL_TARGET),armeb-linux)
  823. override TARGET_PROGRAMS+=pp
  824. endif
  825. ifeq ($(FULL_TARGET),armeb-embedded)
  826. override TARGET_PROGRAMS+=pp
  827. endif
  828. ifeq ($(FULL_TARGET),mipsel-linux)
  829. override TARGET_PROGRAMS+=pp
  830. endif
  831. override INSTALL_FPCPACKAGE=y
  832. ifeq ($(FULL_TARGET),i386-linux)
  833. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  834. endif
  835. ifeq ($(FULL_TARGET),i386-go32v2)
  836. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  837. endif
  838. ifeq ($(FULL_TARGET),i386-win32)
  839. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  840. endif
  841. ifeq ($(FULL_TARGET),i386-os2)
  842. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  843. endif
  844. ifeq ($(FULL_TARGET),i386-freebsd)
  845. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  846. endif
  847. ifeq ($(FULL_TARGET),i386-beos)
  848. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  849. endif
  850. ifeq ($(FULL_TARGET),i386-haiku)
  851. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  852. endif
  853. ifeq ($(FULL_TARGET),i386-netbsd)
  854. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  855. endif
  856. ifeq ($(FULL_TARGET),i386-solaris)
  857. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  858. endif
  859. ifeq ($(FULL_TARGET),i386-qnx)
  860. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  861. endif
  862. ifeq ($(FULL_TARGET),i386-netware)
  863. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  864. endif
  865. ifeq ($(FULL_TARGET),i386-openbsd)
  866. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  867. endif
  868. ifeq ($(FULL_TARGET),i386-wdosx)
  869. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  870. endif
  871. ifeq ($(FULL_TARGET),i386-darwin)
  872. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  873. endif
  874. ifeq ($(FULL_TARGET),i386-emx)
  875. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  876. endif
  877. ifeq ($(FULL_TARGET),i386-watcom)
  878. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  879. endif
  880. ifeq ($(FULL_TARGET),i386-netwlibc)
  881. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  882. endif
  883. ifeq ($(FULL_TARGET),i386-wince)
  884. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  885. endif
  886. ifeq ($(FULL_TARGET),i386-embedded)
  887. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  888. endif
  889. ifeq ($(FULL_TARGET),i386-symbian)
  890. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  891. endif
  892. ifeq ($(FULL_TARGET),i386-nativent)
  893. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  894. endif
  895. ifeq ($(FULL_TARGET),i386-iphonesim)
  896. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  897. endif
  898. ifeq ($(FULL_TARGET),m68k-linux)
  899. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  900. endif
  901. ifeq ($(FULL_TARGET),m68k-freebsd)
  902. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  903. endif
  904. ifeq ($(FULL_TARGET),m68k-netbsd)
  905. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  906. endif
  907. ifeq ($(FULL_TARGET),m68k-amiga)
  908. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  909. endif
  910. ifeq ($(FULL_TARGET),m68k-atari)
  911. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  912. endif
  913. ifeq ($(FULL_TARGET),m68k-openbsd)
  914. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  915. endif
  916. ifeq ($(FULL_TARGET),m68k-palmos)
  917. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  918. endif
  919. ifeq ($(FULL_TARGET),m68k-embedded)
  920. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  921. endif
  922. ifeq ($(FULL_TARGET),powerpc-linux)
  923. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  924. endif
  925. ifeq ($(FULL_TARGET),powerpc-netbsd)
  926. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  927. endif
  928. ifeq ($(FULL_TARGET),powerpc-amiga)
  929. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  930. endif
  931. ifeq ($(FULL_TARGET),powerpc-macos)
  932. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  933. endif
  934. ifeq ($(FULL_TARGET),powerpc-darwin)
  935. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  936. endif
  937. ifeq ($(FULL_TARGET),powerpc-morphos)
  938. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  939. endif
  940. ifeq ($(FULL_TARGET),powerpc-embedded)
  941. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  942. endif
  943. ifeq ($(FULL_TARGET),powerpc-wii)
  944. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  945. endif
  946. ifeq ($(FULL_TARGET),sparc-linux)
  947. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  948. endif
  949. ifeq ($(FULL_TARGET),sparc-netbsd)
  950. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  951. endif
  952. ifeq ($(FULL_TARGET),sparc-solaris)
  953. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  954. endif
  955. ifeq ($(FULL_TARGET),sparc-embedded)
  956. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  957. endif
  958. ifeq ($(FULL_TARGET),x86_64-linux)
  959. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  960. endif
  961. ifeq ($(FULL_TARGET),x86_64-freebsd)
  962. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  963. endif
  964. ifeq ($(FULL_TARGET),x86_64-netbsd)
  965. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  966. endif
  967. ifeq ($(FULL_TARGET),x86_64-solaris)
  968. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  969. endif
  970. ifeq ($(FULL_TARGET),x86_64-openbsd)
  971. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  972. endif
  973. ifeq ($(FULL_TARGET),x86_64-darwin)
  974. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  975. endif
  976. ifeq ($(FULL_TARGET),x86_64-win64)
  977. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  978. endif
  979. ifeq ($(FULL_TARGET),x86_64-embedded)
  980. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  981. endif
  982. ifeq ($(FULL_TARGET),arm-linux)
  983. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  984. endif
  985. ifeq ($(FULL_TARGET),arm-palmos)
  986. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  987. endif
  988. ifeq ($(FULL_TARGET),arm-darwin)
  989. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  990. endif
  991. ifeq ($(FULL_TARGET),arm-wince)
  992. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  993. endif
  994. ifeq ($(FULL_TARGET),arm-gba)
  995. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  996. endif
  997. ifeq ($(FULL_TARGET),arm-nds)
  998. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  999. endif
  1000. ifeq ($(FULL_TARGET),arm-embedded)
  1001. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  1002. endif
  1003. ifeq ($(FULL_TARGET),arm-symbian)
  1004. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  1005. endif
  1006. ifeq ($(FULL_TARGET),powerpc64-linux)
  1007. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  1008. endif
  1009. ifeq ($(FULL_TARGET),powerpc64-darwin)
  1010. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  1011. endif
  1012. ifeq ($(FULL_TARGET),powerpc64-embedded)
  1013. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  1014. endif
  1015. ifeq ($(FULL_TARGET),avr-embedded)
  1016. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  1017. endif
  1018. ifeq ($(FULL_TARGET),armeb-linux)
  1019. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  1020. endif
  1021. ifeq ($(FULL_TARGET),armeb-embedded)
  1022. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  1023. endif
  1024. ifeq ($(FULL_TARGET),mipsel-linux)
  1025. override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
  1026. endif
  1027. ifeq ($(FULL_TARGET),i386-linux)
  1028. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1029. endif
  1030. ifeq ($(FULL_TARGET),i386-go32v2)
  1031. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1032. endif
  1033. ifeq ($(FULL_TARGET),i386-win32)
  1034. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1035. endif
  1036. ifeq ($(FULL_TARGET),i386-os2)
  1037. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1038. endif
  1039. ifeq ($(FULL_TARGET),i386-freebsd)
  1040. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1041. endif
  1042. ifeq ($(FULL_TARGET),i386-beos)
  1043. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1044. endif
  1045. ifeq ($(FULL_TARGET),i386-haiku)
  1046. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1047. endif
  1048. ifeq ($(FULL_TARGET),i386-netbsd)
  1049. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1050. endif
  1051. ifeq ($(FULL_TARGET),i386-solaris)
  1052. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1053. endif
  1054. ifeq ($(FULL_TARGET),i386-qnx)
  1055. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1056. endif
  1057. ifeq ($(FULL_TARGET),i386-netware)
  1058. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1059. endif
  1060. ifeq ($(FULL_TARGET),i386-openbsd)
  1061. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1062. endif
  1063. ifeq ($(FULL_TARGET),i386-wdosx)
  1064. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1065. endif
  1066. ifeq ($(FULL_TARGET),i386-darwin)
  1067. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1068. endif
  1069. ifeq ($(FULL_TARGET),i386-emx)
  1070. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1071. endif
  1072. ifeq ($(FULL_TARGET),i386-watcom)
  1073. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1074. endif
  1075. ifeq ($(FULL_TARGET),i386-netwlibc)
  1076. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1077. endif
  1078. ifeq ($(FULL_TARGET),i386-wince)
  1079. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1080. endif
  1081. ifeq ($(FULL_TARGET),i386-embedded)
  1082. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1083. endif
  1084. ifeq ($(FULL_TARGET),i386-symbian)
  1085. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1086. endif
  1087. ifeq ($(FULL_TARGET),i386-nativent)
  1088. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1089. endif
  1090. ifeq ($(FULL_TARGET),i386-iphonesim)
  1091. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1092. endif
  1093. ifeq ($(FULL_TARGET),m68k-linux)
  1094. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1095. endif
  1096. ifeq ($(FULL_TARGET),m68k-freebsd)
  1097. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1098. endif
  1099. ifeq ($(FULL_TARGET),m68k-netbsd)
  1100. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1101. endif
  1102. ifeq ($(FULL_TARGET),m68k-amiga)
  1103. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1104. endif
  1105. ifeq ($(FULL_TARGET),m68k-atari)
  1106. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1107. endif
  1108. ifeq ($(FULL_TARGET),m68k-openbsd)
  1109. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1110. endif
  1111. ifeq ($(FULL_TARGET),m68k-palmos)
  1112. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1113. endif
  1114. ifeq ($(FULL_TARGET),m68k-embedded)
  1115. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1116. endif
  1117. ifeq ($(FULL_TARGET),powerpc-linux)
  1118. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1119. endif
  1120. ifeq ($(FULL_TARGET),powerpc-netbsd)
  1121. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1122. endif
  1123. ifeq ($(FULL_TARGET),powerpc-amiga)
  1124. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1125. endif
  1126. ifeq ($(FULL_TARGET),powerpc-macos)
  1127. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1128. endif
  1129. ifeq ($(FULL_TARGET),powerpc-darwin)
  1130. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1131. endif
  1132. ifeq ($(FULL_TARGET),powerpc-morphos)
  1133. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1134. endif
  1135. ifeq ($(FULL_TARGET),powerpc-embedded)
  1136. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1137. endif
  1138. ifeq ($(FULL_TARGET),powerpc-wii)
  1139. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1140. endif
  1141. ifeq ($(FULL_TARGET),sparc-linux)
  1142. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1143. endif
  1144. ifeq ($(FULL_TARGET),sparc-netbsd)
  1145. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1146. endif
  1147. ifeq ($(FULL_TARGET),sparc-solaris)
  1148. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1149. endif
  1150. ifeq ($(FULL_TARGET),sparc-embedded)
  1151. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1152. endif
  1153. ifeq ($(FULL_TARGET),x86_64-linux)
  1154. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1155. endif
  1156. ifeq ($(FULL_TARGET),x86_64-freebsd)
  1157. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1158. endif
  1159. ifeq ($(FULL_TARGET),x86_64-netbsd)
  1160. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1161. endif
  1162. ifeq ($(FULL_TARGET),x86_64-solaris)
  1163. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1164. endif
  1165. ifeq ($(FULL_TARGET),x86_64-openbsd)
  1166. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1167. endif
  1168. ifeq ($(FULL_TARGET),x86_64-darwin)
  1169. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1170. endif
  1171. ifeq ($(FULL_TARGET),x86_64-win64)
  1172. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1173. endif
  1174. ifeq ($(FULL_TARGET),x86_64-embedded)
  1175. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1176. endif
  1177. ifeq ($(FULL_TARGET),arm-linux)
  1178. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1179. endif
  1180. ifeq ($(FULL_TARGET),arm-palmos)
  1181. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1182. endif
  1183. ifeq ($(FULL_TARGET),arm-darwin)
  1184. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1185. endif
  1186. ifeq ($(FULL_TARGET),arm-wince)
  1187. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1188. endif
  1189. ifeq ($(FULL_TARGET),arm-gba)
  1190. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1191. endif
  1192. ifeq ($(FULL_TARGET),arm-nds)
  1193. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1194. endif
  1195. ifeq ($(FULL_TARGET),arm-embedded)
  1196. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1197. endif
  1198. ifeq ($(FULL_TARGET),arm-symbian)
  1199. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1200. endif
  1201. ifeq ($(FULL_TARGET),powerpc64-linux)
  1202. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1203. endif
  1204. ifeq ($(FULL_TARGET),powerpc64-darwin)
  1205. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1206. endif
  1207. ifeq ($(FULL_TARGET),powerpc64-embedded)
  1208. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1209. endif
  1210. ifeq ($(FULL_TARGET),avr-embedded)
  1211. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1212. endif
  1213. ifeq ($(FULL_TARGET),armeb-linux)
  1214. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1215. endif
  1216. ifeq ($(FULL_TARGET),armeb-embedded)
  1217. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1218. endif
  1219. ifeq ($(FULL_TARGET),mipsel-linux)
  1220. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  1221. endif
  1222. ifeq ($(FULL_TARGET),i386-linux)
  1223. override COMPILER_TARGETDIR+=.
  1224. endif
  1225. ifeq ($(FULL_TARGET),i386-go32v2)
  1226. override COMPILER_TARGETDIR+=.
  1227. endif
  1228. ifeq ($(FULL_TARGET),i386-win32)
  1229. override COMPILER_TARGETDIR+=.
  1230. endif
  1231. ifeq ($(FULL_TARGET),i386-os2)
  1232. override COMPILER_TARGETDIR+=.
  1233. endif
  1234. ifeq ($(FULL_TARGET),i386-freebsd)
  1235. override COMPILER_TARGETDIR+=.
  1236. endif
  1237. ifeq ($(FULL_TARGET),i386-beos)
  1238. override COMPILER_TARGETDIR+=.
  1239. endif
  1240. ifeq ($(FULL_TARGET),i386-haiku)
  1241. override COMPILER_TARGETDIR+=.
  1242. endif
  1243. ifeq ($(FULL_TARGET),i386-netbsd)
  1244. override COMPILER_TARGETDIR+=.
  1245. endif
  1246. ifeq ($(FULL_TARGET),i386-solaris)
  1247. override COMPILER_TARGETDIR+=.
  1248. endif
  1249. ifeq ($(FULL_TARGET),i386-qnx)
  1250. override COMPILER_TARGETDIR+=.
  1251. endif
  1252. ifeq ($(FULL_TARGET),i386-netware)
  1253. override COMPILER_TARGETDIR+=.
  1254. endif
  1255. ifeq ($(FULL_TARGET),i386-openbsd)
  1256. override COMPILER_TARGETDIR+=.
  1257. endif
  1258. ifeq ($(FULL_TARGET),i386-wdosx)
  1259. override COMPILER_TARGETDIR+=.
  1260. endif
  1261. ifeq ($(FULL_TARGET),i386-darwin)
  1262. override COMPILER_TARGETDIR+=.
  1263. endif
  1264. ifeq ($(FULL_TARGET),i386-emx)
  1265. override COMPILER_TARGETDIR+=.
  1266. endif
  1267. ifeq ($(FULL_TARGET),i386-watcom)
  1268. override COMPILER_TARGETDIR+=.
  1269. endif
  1270. ifeq ($(FULL_TARGET),i386-netwlibc)
  1271. override COMPILER_TARGETDIR+=.
  1272. endif
  1273. ifeq ($(FULL_TARGET),i386-wince)
  1274. override COMPILER_TARGETDIR+=.
  1275. endif
  1276. ifeq ($(FULL_TARGET),i386-embedded)
  1277. override COMPILER_TARGETDIR+=.
  1278. endif
  1279. ifeq ($(FULL_TARGET),i386-symbian)
  1280. override COMPILER_TARGETDIR+=.
  1281. endif
  1282. ifeq ($(FULL_TARGET),i386-nativent)
  1283. override COMPILER_TARGETDIR+=.
  1284. endif
  1285. ifeq ($(FULL_TARGET),i386-iphonesim)
  1286. override COMPILER_TARGETDIR+=.
  1287. endif
  1288. ifeq ($(FULL_TARGET),m68k-linux)
  1289. override COMPILER_TARGETDIR+=.
  1290. endif
  1291. ifeq ($(FULL_TARGET),m68k-freebsd)
  1292. override COMPILER_TARGETDIR+=.
  1293. endif
  1294. ifeq ($(FULL_TARGET),m68k-netbsd)
  1295. override COMPILER_TARGETDIR+=.
  1296. endif
  1297. ifeq ($(FULL_TARGET),m68k-amiga)
  1298. override COMPILER_TARGETDIR+=.
  1299. endif
  1300. ifeq ($(FULL_TARGET),m68k-atari)
  1301. override COMPILER_TARGETDIR+=.
  1302. endif
  1303. ifeq ($(FULL_TARGET),m68k-openbsd)
  1304. override COMPILER_TARGETDIR+=.
  1305. endif
  1306. ifeq ($(FULL_TARGET),m68k-palmos)
  1307. override COMPILER_TARGETDIR+=.
  1308. endif
  1309. ifeq ($(FULL_TARGET),m68k-embedded)
  1310. override COMPILER_TARGETDIR+=.
  1311. endif
  1312. ifeq ($(FULL_TARGET),powerpc-linux)
  1313. override COMPILER_TARGETDIR+=.
  1314. endif
  1315. ifeq ($(FULL_TARGET),powerpc-netbsd)
  1316. override COMPILER_TARGETDIR+=.
  1317. endif
  1318. ifeq ($(FULL_TARGET),powerpc-amiga)
  1319. override COMPILER_TARGETDIR+=.
  1320. endif
  1321. ifeq ($(FULL_TARGET),powerpc-macos)
  1322. override COMPILER_TARGETDIR+=.
  1323. endif
  1324. ifeq ($(FULL_TARGET),powerpc-darwin)
  1325. override COMPILER_TARGETDIR+=.
  1326. endif
  1327. ifeq ($(FULL_TARGET),powerpc-morphos)
  1328. override COMPILER_TARGETDIR+=.
  1329. endif
  1330. ifeq ($(FULL_TARGET),powerpc-embedded)
  1331. override COMPILER_TARGETDIR+=.
  1332. endif
  1333. ifeq ($(FULL_TARGET),powerpc-wii)
  1334. override COMPILER_TARGETDIR+=.
  1335. endif
  1336. ifeq ($(FULL_TARGET),sparc-linux)
  1337. override COMPILER_TARGETDIR+=.
  1338. endif
  1339. ifeq ($(FULL_TARGET),sparc-netbsd)
  1340. override COMPILER_TARGETDIR+=.
  1341. endif
  1342. ifeq ($(FULL_TARGET),sparc-solaris)
  1343. override COMPILER_TARGETDIR+=.
  1344. endif
  1345. ifeq ($(FULL_TARGET),sparc-embedded)
  1346. override COMPILER_TARGETDIR+=.
  1347. endif
  1348. ifeq ($(FULL_TARGET),x86_64-linux)
  1349. override COMPILER_TARGETDIR+=.
  1350. endif
  1351. ifeq ($(FULL_TARGET),x86_64-freebsd)
  1352. override COMPILER_TARGETDIR+=.
  1353. endif
  1354. ifeq ($(FULL_TARGET),x86_64-netbsd)
  1355. override COMPILER_TARGETDIR+=.
  1356. endif
  1357. ifeq ($(FULL_TARGET),x86_64-solaris)
  1358. override COMPILER_TARGETDIR+=.
  1359. endif
  1360. ifeq ($(FULL_TARGET),x86_64-openbsd)
  1361. override COMPILER_TARGETDIR+=.
  1362. endif
  1363. ifeq ($(FULL_TARGET),x86_64-darwin)
  1364. override COMPILER_TARGETDIR+=.
  1365. endif
  1366. ifeq ($(FULL_TARGET),x86_64-win64)
  1367. override COMPILER_TARGETDIR+=.
  1368. endif
  1369. ifeq ($(FULL_TARGET),x86_64-embedded)
  1370. override COMPILER_TARGETDIR+=.
  1371. endif
  1372. ifeq ($(FULL_TARGET),arm-linux)
  1373. override COMPILER_TARGETDIR+=.
  1374. endif
  1375. ifeq ($(FULL_TARGET),arm-palmos)
  1376. override COMPILER_TARGETDIR+=.
  1377. endif
  1378. ifeq ($(FULL_TARGET),arm-darwin)
  1379. override COMPILER_TARGETDIR+=.
  1380. endif
  1381. ifeq ($(FULL_TARGET),arm-wince)
  1382. override COMPILER_TARGETDIR+=.
  1383. endif
  1384. ifeq ($(FULL_TARGET),arm-gba)
  1385. override COMPILER_TARGETDIR+=.
  1386. endif
  1387. ifeq ($(FULL_TARGET),arm-nds)
  1388. override COMPILER_TARGETDIR+=.
  1389. endif
  1390. ifeq ($(FULL_TARGET),arm-embedded)
  1391. override COMPILER_TARGETDIR+=.
  1392. endif
  1393. ifeq ($(FULL_TARGET),arm-symbian)
  1394. override COMPILER_TARGETDIR+=.
  1395. endif
  1396. ifeq ($(FULL_TARGET),powerpc64-linux)
  1397. override COMPILER_TARGETDIR+=.
  1398. endif
  1399. ifeq ($(FULL_TARGET),powerpc64-darwin)
  1400. override COMPILER_TARGETDIR+=.
  1401. endif
  1402. ifeq ($(FULL_TARGET),powerpc64-embedded)
  1403. override COMPILER_TARGETDIR+=.
  1404. endif
  1405. ifeq ($(FULL_TARGET),avr-embedded)
  1406. override COMPILER_TARGETDIR+=.
  1407. endif
  1408. ifeq ($(FULL_TARGET),armeb-linux)
  1409. override COMPILER_TARGETDIR+=.
  1410. endif
  1411. ifeq ($(FULL_TARGET),armeb-embedded)
  1412. override COMPILER_TARGETDIR+=.
  1413. endif
  1414. ifeq ($(FULL_TARGET),mipsel-linux)
  1415. override COMPILER_TARGETDIR+=.
  1416. endif
  1417. ifeq ($(FULL_TARGET),i386-linux)
  1418. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1419. endif
  1420. ifeq ($(FULL_TARGET),i386-go32v2)
  1421. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1422. endif
  1423. ifeq ($(FULL_TARGET),i386-win32)
  1424. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1425. endif
  1426. ifeq ($(FULL_TARGET),i386-os2)
  1427. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1428. endif
  1429. ifeq ($(FULL_TARGET),i386-freebsd)
  1430. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1431. endif
  1432. ifeq ($(FULL_TARGET),i386-beos)
  1433. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1434. endif
  1435. ifeq ($(FULL_TARGET),i386-haiku)
  1436. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1437. endif
  1438. ifeq ($(FULL_TARGET),i386-netbsd)
  1439. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1440. endif
  1441. ifeq ($(FULL_TARGET),i386-solaris)
  1442. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1443. endif
  1444. ifeq ($(FULL_TARGET),i386-qnx)
  1445. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1446. endif
  1447. ifeq ($(FULL_TARGET),i386-netware)
  1448. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1449. endif
  1450. ifeq ($(FULL_TARGET),i386-openbsd)
  1451. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1452. endif
  1453. ifeq ($(FULL_TARGET),i386-wdosx)
  1454. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1455. endif
  1456. ifeq ($(FULL_TARGET),i386-darwin)
  1457. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1458. endif
  1459. ifeq ($(FULL_TARGET),i386-emx)
  1460. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1461. endif
  1462. ifeq ($(FULL_TARGET),i386-watcom)
  1463. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1464. endif
  1465. ifeq ($(FULL_TARGET),i386-netwlibc)
  1466. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1467. endif
  1468. ifeq ($(FULL_TARGET),i386-wince)
  1469. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1470. endif
  1471. ifeq ($(FULL_TARGET),i386-embedded)
  1472. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1473. endif
  1474. ifeq ($(FULL_TARGET),i386-symbian)
  1475. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1476. endif
  1477. ifeq ($(FULL_TARGET),i386-nativent)
  1478. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1479. endif
  1480. ifeq ($(FULL_TARGET),i386-iphonesim)
  1481. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1482. endif
  1483. ifeq ($(FULL_TARGET),m68k-linux)
  1484. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1485. endif
  1486. ifeq ($(FULL_TARGET),m68k-freebsd)
  1487. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1488. endif
  1489. ifeq ($(FULL_TARGET),m68k-netbsd)
  1490. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1491. endif
  1492. ifeq ($(FULL_TARGET),m68k-amiga)
  1493. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1494. endif
  1495. ifeq ($(FULL_TARGET),m68k-atari)
  1496. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1497. endif
  1498. ifeq ($(FULL_TARGET),m68k-openbsd)
  1499. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1500. endif
  1501. ifeq ($(FULL_TARGET),m68k-palmos)
  1502. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1503. endif
  1504. ifeq ($(FULL_TARGET),m68k-embedded)
  1505. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1506. endif
  1507. ifeq ($(FULL_TARGET),powerpc-linux)
  1508. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1509. endif
  1510. ifeq ($(FULL_TARGET),powerpc-netbsd)
  1511. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1512. endif
  1513. ifeq ($(FULL_TARGET),powerpc-amiga)
  1514. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1515. endif
  1516. ifeq ($(FULL_TARGET),powerpc-macos)
  1517. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1518. endif
  1519. ifeq ($(FULL_TARGET),powerpc-darwin)
  1520. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1521. endif
  1522. ifeq ($(FULL_TARGET),powerpc-morphos)
  1523. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1524. endif
  1525. ifeq ($(FULL_TARGET),powerpc-embedded)
  1526. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1527. endif
  1528. ifeq ($(FULL_TARGET),powerpc-wii)
  1529. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1530. endif
  1531. ifeq ($(FULL_TARGET),sparc-linux)
  1532. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1533. endif
  1534. ifeq ($(FULL_TARGET),sparc-netbsd)
  1535. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1536. endif
  1537. ifeq ($(FULL_TARGET),sparc-solaris)
  1538. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1539. endif
  1540. ifeq ($(FULL_TARGET),sparc-embedded)
  1541. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1542. endif
  1543. ifeq ($(FULL_TARGET),x86_64-linux)
  1544. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1545. endif
  1546. ifeq ($(FULL_TARGET),x86_64-freebsd)
  1547. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1548. endif
  1549. ifeq ($(FULL_TARGET),x86_64-netbsd)
  1550. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1551. endif
  1552. ifeq ($(FULL_TARGET),x86_64-solaris)
  1553. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1554. endif
  1555. ifeq ($(FULL_TARGET),x86_64-openbsd)
  1556. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1557. endif
  1558. ifeq ($(FULL_TARGET),x86_64-darwin)
  1559. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1560. endif
  1561. ifeq ($(FULL_TARGET),x86_64-win64)
  1562. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1563. endif
  1564. ifeq ($(FULL_TARGET),x86_64-embedded)
  1565. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1566. endif
  1567. ifeq ($(FULL_TARGET),arm-linux)
  1568. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1569. endif
  1570. ifeq ($(FULL_TARGET),arm-palmos)
  1571. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1572. endif
  1573. ifeq ($(FULL_TARGET),arm-darwin)
  1574. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1575. endif
  1576. ifeq ($(FULL_TARGET),arm-wince)
  1577. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1578. endif
  1579. ifeq ($(FULL_TARGET),arm-gba)
  1580. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1581. endif
  1582. ifeq ($(FULL_TARGET),arm-nds)
  1583. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1584. endif
  1585. ifeq ($(FULL_TARGET),arm-embedded)
  1586. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1587. endif
  1588. ifeq ($(FULL_TARGET),arm-symbian)
  1589. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1590. endif
  1591. ifeq ($(FULL_TARGET),powerpc64-linux)
  1592. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1593. endif
  1594. ifeq ($(FULL_TARGET),powerpc64-darwin)
  1595. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1596. endif
  1597. ifeq ($(FULL_TARGET),powerpc64-embedded)
  1598. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1599. endif
  1600. ifeq ($(FULL_TARGET),avr-embedded)
  1601. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1602. endif
  1603. ifeq ($(FULL_TARGET),armeb-linux)
  1604. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1605. endif
  1606. ifeq ($(FULL_TARGET),armeb-embedded)
  1607. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1608. endif
  1609. ifeq ($(FULL_TARGET),mipsel-linux)
  1610. override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  1611. endif
  1612. ifdef REQUIRE_UNITSDIR
  1613. override UNITSDIR+=$(REQUIRE_UNITSDIR)
  1614. endif
  1615. ifdef REQUIRE_PACKAGESDIR
  1616. override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
  1617. endif
  1618. ifdef ZIPINSTALL
  1619. ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
  1620. UNIXHier=1
  1621. endif
  1622. else
  1623. ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
  1624. UNIXHier=1
  1625. endif
  1626. endif
  1627. ifndef INSTALL_PREFIX
  1628. ifdef PREFIX
  1629. INSTALL_PREFIX=$(PREFIX)
  1630. endif
  1631. endif
  1632. ifndef INSTALL_PREFIX
  1633. ifdef UNIXHier
  1634. INSTALL_PREFIX=/usr/local
  1635. else
  1636. ifdef INSTALL_FPCPACKAGE
  1637. INSTALL_BASEDIR:=/pp
  1638. else
  1639. INSTALL_BASEDIR:=/$(PACKAGE_NAME)
  1640. endif
  1641. endif
  1642. endif
  1643. export INSTALL_PREFIX
  1644. ifdef INSTALL_FPCSUBDIR
  1645. export INSTALL_FPCSUBDIR
  1646. endif
  1647. ifndef DIST_DESTDIR
  1648. DIST_DESTDIR:=$(BASEDIR)
  1649. endif
  1650. export DIST_DESTDIR
  1651. ifndef COMPILER_UNITTARGETDIR
  1652. ifdef PACKAGEDIR_MAIN
  1653. COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX)
  1654. else
  1655. COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX)
  1656. endif
  1657. endif
  1658. ifndef COMPILER_TARGETDIR
  1659. COMPILER_TARGETDIR=.
  1660. endif
  1661. ifndef INSTALL_BASEDIR
  1662. ifdef UNIXHier
  1663. ifdef INSTALL_FPCPACKAGE
  1664. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
  1665. else
  1666. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
  1667. endif
  1668. else
  1669. INSTALL_BASEDIR:=$(INSTALL_PREFIX)
  1670. endif
  1671. endif
  1672. ifndef INSTALL_BINDIR
  1673. ifdef UNIXHier
  1674. INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
  1675. else
  1676. INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
  1677. ifdef INSTALL_FPCPACKAGE
  1678. ifdef CROSSCOMPILE
  1679. ifdef CROSSINSTALL
  1680. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX)
  1681. else
  1682. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
  1683. endif
  1684. else
  1685. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
  1686. endif
  1687. endif
  1688. endif
  1689. endif
  1690. ifndef INSTALL_UNITDIR
  1691. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX)
  1692. ifdef INSTALL_FPCPACKAGE
  1693. ifdef PACKAGE_NAME
  1694. INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
  1695. endif
  1696. endif
  1697. endif
  1698. ifndef INSTALL_LIBDIR
  1699. ifdef UNIXHier
  1700. INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
  1701. else
  1702. INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
  1703. endif
  1704. endif
  1705. ifndef INSTALL_SOURCEDIR
  1706. ifdef UNIXHier
  1707. ifdef BSDhier
  1708. SRCPREFIXDIR=share/src
  1709. else
  1710. ifdef linuxHier
  1711. SRCPREFIXDIR=share/src
  1712. else
  1713. SRCPREFIXDIR=src
  1714. endif
  1715. endif
  1716. ifdef INSTALL_FPCPACKAGE
  1717. ifdef INSTALL_FPCSUBDIR
  1718. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  1719. else
  1720. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  1721. endif
  1722. else
  1723. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  1724. endif
  1725. else
  1726. ifdef INSTALL_FPCPACKAGE
  1727. ifdef INSTALL_FPCSUBDIR
  1728. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  1729. else
  1730. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
  1731. endif
  1732. else
  1733. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
  1734. endif
  1735. endif
  1736. endif
  1737. ifndef INSTALL_DOCDIR
  1738. ifdef UNIXHier
  1739. ifdef BSDhier
  1740. DOCPREFIXDIR=share/doc
  1741. else
  1742. ifdef linuxHier
  1743. DOCPREFIXDIR=share/doc
  1744. else
  1745. DOCPREFIXDIR=doc
  1746. endif
  1747. endif
  1748. ifdef INSTALL_FPCPACKAGE
  1749. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  1750. else
  1751. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  1752. endif
  1753. else
  1754. ifdef INSTALL_FPCPACKAGE
  1755. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
  1756. else
  1757. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
  1758. endif
  1759. endif
  1760. endif
  1761. ifndef INSTALL_EXAMPLEDIR
  1762. ifdef UNIXHier
  1763. ifdef INSTALL_FPCPACKAGE
  1764. ifdef BSDhier
  1765. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  1766. else
  1767. ifdef linuxHier
  1768. INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples
  1769. else
  1770. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
  1771. endif
  1772. endif
  1773. else
  1774. ifdef BSDhier
  1775. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  1776. else
  1777. ifdef linuxHier
  1778. INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  1779. else
  1780. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  1781. endif
  1782. endif
  1783. endif
  1784. else
  1785. ifdef INSTALL_FPCPACKAGE
  1786. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
  1787. else
  1788. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
  1789. endif
  1790. endif
  1791. endif
  1792. ifndef INSTALL_DATADIR
  1793. INSTALL_DATADIR=$(INSTALL_BASEDIR)
  1794. endif
  1795. ifndef INSTALL_SHAREDDIR
  1796. INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
  1797. endif
  1798. ifdef CROSSCOMPILE
  1799. ifndef CROSSBINDIR
  1800. CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
  1801. ifeq ($(CROSSBINDIR),)
  1802. CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE))
  1803. endif
  1804. endif
  1805. else
  1806. CROSSBINDIR=
  1807. endif
  1808. BATCHEXT=.bat
  1809. LOADEREXT=.as
  1810. EXEEXT=.exe
  1811. PPLEXT=.ppl
  1812. PPUEXT=.ppu
  1813. OEXT=.o
  1814. ASMEXT=.s
  1815. SMARTEXT=.sl
  1816. STATICLIBEXT=.a
  1817. SHAREDLIBEXT=.so
  1818. SHAREDLIBPREFIX=libfp
  1819. STATICLIBPREFIX=libp
  1820. IMPORTLIBPREFIX=libimp
  1821. RSTEXT=.rst
  1822. EXEDBGEXT=.dbg
  1823. ifeq ($(OS_TARGET),go32v1)
  1824. STATICLIBPREFIX=
  1825. SHORTSUFFIX=v1
  1826. endif
  1827. ifeq ($(OS_TARGET),go32v2)
  1828. STATICLIBPREFIX=
  1829. SHORTSUFFIX=dos
  1830. IMPORTLIBPREFIX=
  1831. endif
  1832. ifeq ($(OS_TARGET),watcom)
  1833. STATICLIBPREFIX=
  1834. OEXT=.obj
  1835. ASMEXT=.asm
  1836. SHAREDLIBEXT=.dll
  1837. SHORTSUFFIX=wat
  1838. IMPORTLIBPREFIX=
  1839. endif
  1840. ifeq ($(OS_TARGET),linux)
  1841. BATCHEXT=.sh
  1842. EXEEXT=
  1843. HASSHAREDLIB=1
  1844. SHORTSUFFIX=lnx
  1845. endif
  1846. ifeq ($(OS_TARGET),freebsd)
  1847. BATCHEXT=.sh
  1848. EXEEXT=
  1849. HASSHAREDLIB=1
  1850. SHORTSUFFIX=fbs
  1851. endif
  1852. ifeq ($(OS_TARGET),netbsd)
  1853. BATCHEXT=.sh
  1854. EXEEXT=
  1855. HASSHAREDLIB=1
  1856. SHORTSUFFIX=nbs
  1857. endif
  1858. ifeq ($(OS_TARGET),openbsd)
  1859. BATCHEXT=.sh
  1860. EXEEXT=
  1861. HASSHAREDLIB=1
  1862. SHORTSUFFIX=obs
  1863. endif
  1864. ifeq ($(OS_TARGET),win32)
  1865. SHAREDLIBEXT=.dll
  1866. SHORTSUFFIX=w32
  1867. endif
  1868. ifeq ($(OS_TARGET),os2)
  1869. BATCHEXT=.cmd
  1870. AOUTEXT=.out
  1871. STATICLIBPREFIX=
  1872. SHAREDLIBEXT=.dll
  1873. SHORTSUFFIX=os2
  1874. ECHO=echo
  1875. IMPORTLIBPREFIX=
  1876. endif
  1877. ifeq ($(OS_TARGET),emx)
  1878. BATCHEXT=.cmd
  1879. AOUTEXT=.out
  1880. STATICLIBPREFIX=
  1881. SHAREDLIBEXT=.dll
  1882. SHORTSUFFIX=emx
  1883. ECHO=echo
  1884. IMPORTLIBPREFIX=
  1885. endif
  1886. ifeq ($(OS_TARGET),amiga)
  1887. EXEEXT=
  1888. SHAREDLIBEXT=.library
  1889. SHORTSUFFIX=amg
  1890. endif
  1891. ifeq ($(OS_TARGET),morphos)
  1892. EXEEXT=
  1893. SHAREDLIBEXT=.library
  1894. SHORTSUFFIX=mos
  1895. endif
  1896. ifeq ($(OS_TARGET),atari)
  1897. EXEEXT=.ttp
  1898. SHORTSUFFIX=ata
  1899. endif
  1900. ifeq ($(OS_TARGET),beos)
  1901. BATCHEXT=.sh
  1902. EXEEXT=
  1903. SHORTSUFFIX=be
  1904. endif
  1905. ifeq ($(OS_TARGET),haiku)
  1906. BATCHEXT=.sh
  1907. EXEEXT=
  1908. SHORTSUFFIX=hai
  1909. endif
  1910. ifeq ($(OS_TARGET),solaris)
  1911. BATCHEXT=.sh
  1912. EXEEXT=
  1913. SHORTSUFFIX=sun
  1914. endif
  1915. ifeq ($(OS_TARGET),qnx)
  1916. BATCHEXT=.sh
  1917. EXEEXT=
  1918. SHORTSUFFIX=qnx
  1919. endif
  1920. ifeq ($(OS_TARGET),netware)
  1921. EXEEXT=.nlm
  1922. STATICLIBPREFIX=
  1923. SHORTSUFFIX=nw
  1924. IMPORTLIBPREFIX=imp
  1925. endif
  1926. ifeq ($(OS_TARGET),netwlibc)
  1927. EXEEXT=.nlm
  1928. STATICLIBPREFIX=
  1929. SHORTSUFFIX=nwl
  1930. IMPORTLIBPREFIX=imp
  1931. endif
  1932. ifeq ($(OS_TARGET),macos)
  1933. BATCHEXT=
  1934. EXEEXT=
  1935. DEBUGSYMEXT=.xcoff
  1936. SHORTSUFFIX=mac
  1937. IMPORTLIBPREFIX=imp
  1938. endif
  1939. ifneq ($(findstring $(OS_TARGET),darwin iphonesim),)
  1940. BATCHEXT=.sh
  1941. EXEEXT=
  1942. HASSHAREDLIB=1
  1943. SHORTSUFFIX=dwn
  1944. EXEDBGEXT=.dSYM
  1945. endif
  1946. ifeq ($(OS_TARGET),gba)
  1947. EXEEXT=.gba
  1948. SHAREDLIBEXT=.so
  1949. SHORTSUFFIX=gba
  1950. endif
  1951. ifeq ($(OS_TARGET),symbian)
  1952. SHAREDLIBEXT=.dll
  1953. SHORTSUFFIX=symbian
  1954. endif
  1955. ifeq ($(OS_TARGET),NativeNT)
  1956. SHAREDLIBEXT=.dll
  1957. SHORTSUFFIX=nativent
  1958. endif
  1959. ifeq ($(OS_TARGET),wii)
  1960. EXEEXT=.dol
  1961. SHAREDLIBEXT=.so
  1962. SHORTSUFFIX=wii
  1963. endif
  1964. ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
  1965. FPCMADE=fpcmade.$(SHORTSUFFIX)
  1966. ZIPSUFFIX=$(SHORTSUFFIX)
  1967. ZIPCROSSPREFIX=
  1968. ZIPSOURCESUFFIX=src
  1969. ZIPEXAMPLESUFFIX=exm
  1970. else
  1971. FPCMADE=fpcmade.$(TARGETSUFFIX)
  1972. ZIPSOURCESUFFIX=.source
  1973. ZIPEXAMPLESUFFIX=.examples
  1974. ifdef CROSSCOMPILE
  1975. ZIPSUFFIX=.$(SOURCESUFFIX)
  1976. ZIPCROSSPREFIX=$(TARGETSUFFIX)-
  1977. else
  1978. ZIPSUFFIX=.$(TARGETSUFFIX)
  1979. ZIPCROSSPREFIX=
  1980. endif
  1981. endif
  1982. ifndef ECHO
  1983. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  1984. ifeq ($(ECHO),)
  1985. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  1986. ifeq ($(ECHO),)
  1987. ECHO= __missing_command_ECHO
  1988. else
  1989. ECHO:=$(firstword $(ECHO))
  1990. endif
  1991. else
  1992. ECHO:=$(firstword $(ECHO))
  1993. endif
  1994. endif
  1995. export ECHO
  1996. ifndef DATE
  1997. DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
  1998. ifeq ($(DATE),)
  1999. DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
  2000. ifeq ($(DATE),)
  2001. DATE= __missing_command_DATE
  2002. else
  2003. DATE:=$(firstword $(DATE))
  2004. endif
  2005. else
  2006. DATE:=$(firstword $(DATE))
  2007. endif
  2008. endif
  2009. export DATE
  2010. ifndef GINSTALL
  2011. GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
  2012. ifeq ($(GINSTALL),)
  2013. GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
  2014. ifeq ($(GINSTALL),)
  2015. GINSTALL= __missing_command_GINSTALL
  2016. else
  2017. GINSTALL:=$(firstword $(GINSTALL))
  2018. endif
  2019. else
  2020. GINSTALL:=$(firstword $(GINSTALL))
  2021. endif
  2022. endif
  2023. export GINSTALL
  2024. ifndef CPPROG
  2025. CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
  2026. ifeq ($(CPPROG),)
  2027. CPPROG= __missing_command_CPPROG
  2028. else
  2029. CPPROG:=$(firstword $(CPPROG))
  2030. endif
  2031. endif
  2032. export CPPROG
  2033. ifndef RMPROG
  2034. RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
  2035. ifeq ($(RMPROG),)
  2036. RMPROG= __missing_command_RMPROG
  2037. else
  2038. RMPROG:=$(firstword $(RMPROG))
  2039. endif
  2040. endif
  2041. export RMPROG
  2042. ifndef MVPROG
  2043. MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
  2044. ifeq ($(MVPROG),)
  2045. MVPROG= __missing_command_MVPROG
  2046. else
  2047. MVPROG:=$(firstword $(MVPROG))
  2048. endif
  2049. endif
  2050. export MVPROG
  2051. ifndef MKDIRPROG
  2052. MKDIRPROG:=$(strip $(wildcard $(addsuffix /gmkdir$(SRCEXEEXT),$(SEARCHPATH))))
  2053. ifeq ($(MKDIRPROG),)
  2054. MKDIRPROG:=$(strip $(wildcard $(addsuffix /mkdir$(SRCEXEEXT),$(SEARCHPATH))))
  2055. ifeq ($(MKDIRPROG),)
  2056. MKDIRPROG= __missing_command_MKDIRPROG
  2057. else
  2058. MKDIRPROG:=$(firstword $(MKDIRPROG))
  2059. endif
  2060. else
  2061. MKDIRPROG:=$(firstword $(MKDIRPROG))
  2062. endif
  2063. endif
  2064. export MKDIRPROG
  2065. ifndef ECHOREDIR
  2066. ifndef inUnix
  2067. ECHOREDIR=echo
  2068. else
  2069. ECHOREDIR=$(ECHO)
  2070. endif
  2071. endif
  2072. ifndef COPY
  2073. COPY:=$(CPPROG) -fp
  2074. endif
  2075. ifndef COPYTREE
  2076. COPYTREE:=$(CPPROG) -Rfp
  2077. endif
  2078. ifndef MKDIRTREE
  2079. MKDIRTREE:=$(MKDIRPROG) -p
  2080. endif
  2081. ifndef MOVE
  2082. MOVE:=$(MVPROG) -f
  2083. endif
  2084. ifndef DEL
  2085. DEL:=$(RMPROG) -f
  2086. endif
  2087. ifndef DELTREE
  2088. DELTREE:=$(RMPROG) -rf
  2089. endif
  2090. ifndef INSTALL
  2091. ifdef inUnix
  2092. INSTALL:=$(GINSTALL) -c -m 644
  2093. else
  2094. INSTALL:=$(COPY)
  2095. endif
  2096. endif
  2097. ifndef INSTALLEXE
  2098. ifdef inUnix
  2099. INSTALLEXE:=$(GINSTALL) -c -m 755
  2100. else
  2101. INSTALLEXE:=$(COPY)
  2102. endif
  2103. endif
  2104. ifndef MKDIR
  2105. MKDIR:=$(GINSTALL) -m 755 -d
  2106. endif
  2107. export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
  2108. ifndef PPUMOVE
  2109. PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
  2110. ifeq ($(PPUMOVE),)
  2111. PPUMOVE= __missing_command_PPUMOVE
  2112. else
  2113. PPUMOVE:=$(firstword $(PPUMOVE))
  2114. endif
  2115. endif
  2116. export PPUMOVE
  2117. ifndef FPCMAKE
  2118. FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
  2119. ifeq ($(FPCMAKE),)
  2120. FPCMAKE= __missing_command_FPCMAKE
  2121. else
  2122. FPCMAKE:=$(firstword $(FPCMAKE))
  2123. endif
  2124. endif
  2125. export FPCMAKE
  2126. ifndef ZIPPROG
  2127. ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
  2128. ifeq ($(ZIPPROG),)
  2129. ZIPPROG= __missing_command_ZIPPROG
  2130. else
  2131. ZIPPROG:=$(firstword $(ZIPPROG))
  2132. endif
  2133. endif
  2134. export ZIPPROG
  2135. ifndef TARPROG
  2136. TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
  2137. ifeq ($(TARPROG),)
  2138. TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
  2139. ifeq ($(TARPROG),)
  2140. TARPROG= __missing_command_TARPROG
  2141. else
  2142. TARPROG:=$(firstword $(TARPROG))
  2143. endif
  2144. else
  2145. TARPROG:=$(firstword $(TARPROG))
  2146. endif
  2147. endif
  2148. export TARPROG
  2149. ASNAME=$(BINUTILSPREFIX)as
  2150. LDNAME=$(BINUTILSPREFIX)ld
  2151. ARNAME=$(BINUTILSPREFIX)ar
  2152. RCNAME=$(BINUTILSPREFIX)rc
  2153. ifndef ASPROG
  2154. ifdef CROSSBINDIR
  2155. ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
  2156. else
  2157. ASPROG=$(ASNAME)
  2158. endif
  2159. endif
  2160. ifndef LDPROG
  2161. ifdef CROSSBINDIR
  2162. LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
  2163. else
  2164. LDPROG=$(LDNAME)
  2165. endif
  2166. endif
  2167. ifndef RCPROG
  2168. ifdef CROSSBINDIR
  2169. RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
  2170. else
  2171. RCPROG=$(RCNAME)
  2172. endif
  2173. endif
  2174. ifndef ARPROG
  2175. ifdef CROSSBINDIR
  2176. ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
  2177. else
  2178. ARPROG=$(ARNAME)
  2179. endif
  2180. endif
  2181. AS=$(ASPROG)
  2182. LD=$(LDPROG)
  2183. RC=$(RCPROG)
  2184. AR=$(ARPROG)
  2185. PPAS=ppas$(SRCBATCHEXT)
  2186. ifdef inUnix
  2187. LDCONFIG=ldconfig
  2188. else
  2189. LDCONFIG=
  2190. endif
  2191. ifdef DATE
  2192. DATESTR:=$(shell $(DATE) +%Y%m%d)
  2193. else
  2194. DATESTR=
  2195. endif
  2196. ZIPOPT=-9
  2197. ZIPEXT=.zip
  2198. ifeq ($(USETAR),bz2)
  2199. TAROPT=vj
  2200. TAREXT=.tar.bz2
  2201. else
  2202. TAROPT=vz
  2203. TAREXT=.tar.gz
  2204. endif
  2205. override REQUIRE_PACKAGES=rtl rtl
  2206. ifeq ($(FULL_TARGET),i386-linux)
  2207. REQUIRE_PACKAGES_RTL=1
  2208. endif
  2209. ifeq ($(FULL_TARGET),i386-go32v2)
  2210. REQUIRE_PACKAGES_RTL=1
  2211. endif
  2212. ifeq ($(FULL_TARGET),i386-win32)
  2213. REQUIRE_PACKAGES_RTL=1
  2214. endif
  2215. ifeq ($(FULL_TARGET),i386-os2)
  2216. REQUIRE_PACKAGES_RTL=1
  2217. endif
  2218. ifeq ($(FULL_TARGET),i386-freebsd)
  2219. REQUIRE_PACKAGES_RTL=1
  2220. endif
  2221. ifeq ($(FULL_TARGET),i386-beos)
  2222. REQUIRE_PACKAGES_RTL=1
  2223. endif
  2224. ifeq ($(FULL_TARGET),i386-haiku)
  2225. REQUIRE_PACKAGES_RTL=1
  2226. endif
  2227. ifeq ($(FULL_TARGET),i386-netbsd)
  2228. REQUIRE_PACKAGES_RTL=1
  2229. endif
  2230. ifeq ($(FULL_TARGET),i386-solaris)
  2231. REQUIRE_PACKAGES_RTL=1
  2232. endif
  2233. ifeq ($(FULL_TARGET),i386-qnx)
  2234. REQUIRE_PACKAGES_RTL=1
  2235. endif
  2236. ifeq ($(FULL_TARGET),i386-netware)
  2237. REQUIRE_PACKAGES_RTL=1
  2238. endif
  2239. ifeq ($(FULL_TARGET),i386-openbsd)
  2240. REQUIRE_PACKAGES_RTL=1
  2241. endif
  2242. ifeq ($(FULL_TARGET),i386-wdosx)
  2243. REQUIRE_PACKAGES_RTL=1
  2244. endif
  2245. ifeq ($(FULL_TARGET),i386-darwin)
  2246. REQUIRE_PACKAGES_RTL=1
  2247. endif
  2248. ifeq ($(FULL_TARGET),i386-emx)
  2249. REQUIRE_PACKAGES_RTL=1
  2250. endif
  2251. ifeq ($(FULL_TARGET),i386-watcom)
  2252. REQUIRE_PACKAGES_RTL=1
  2253. endif
  2254. ifeq ($(FULL_TARGET),i386-netwlibc)
  2255. REQUIRE_PACKAGES_RTL=1
  2256. endif
  2257. ifeq ($(FULL_TARGET),i386-wince)
  2258. REQUIRE_PACKAGES_RTL=1
  2259. endif
  2260. ifeq ($(FULL_TARGET),i386-embedded)
  2261. REQUIRE_PACKAGES_RTL=1
  2262. endif
  2263. ifeq ($(FULL_TARGET),i386-symbian)
  2264. REQUIRE_PACKAGES_RTL=1
  2265. endif
  2266. ifeq ($(FULL_TARGET),i386-nativent)
  2267. REQUIRE_PACKAGES_RTL=1
  2268. endif
  2269. ifeq ($(FULL_TARGET),i386-iphonesim)
  2270. REQUIRE_PACKAGES_RTL=1
  2271. endif
  2272. ifeq ($(FULL_TARGET),m68k-linux)
  2273. REQUIRE_PACKAGES_RTL=1
  2274. endif
  2275. ifeq ($(FULL_TARGET),m68k-freebsd)
  2276. REQUIRE_PACKAGES_RTL=1
  2277. endif
  2278. ifeq ($(FULL_TARGET),m68k-netbsd)
  2279. REQUIRE_PACKAGES_RTL=1
  2280. endif
  2281. ifeq ($(FULL_TARGET),m68k-amiga)
  2282. REQUIRE_PACKAGES_RTL=1
  2283. endif
  2284. ifeq ($(FULL_TARGET),m68k-atari)
  2285. REQUIRE_PACKAGES_RTL=1
  2286. endif
  2287. ifeq ($(FULL_TARGET),m68k-openbsd)
  2288. REQUIRE_PACKAGES_RTL=1
  2289. endif
  2290. ifeq ($(FULL_TARGET),m68k-palmos)
  2291. REQUIRE_PACKAGES_RTL=1
  2292. endif
  2293. ifeq ($(FULL_TARGET),m68k-embedded)
  2294. REQUIRE_PACKAGES_RTL=1
  2295. endif
  2296. ifeq ($(FULL_TARGET),powerpc-linux)
  2297. REQUIRE_PACKAGES_RTL=1
  2298. endif
  2299. ifeq ($(FULL_TARGET),powerpc-netbsd)
  2300. REQUIRE_PACKAGES_RTL=1
  2301. endif
  2302. ifeq ($(FULL_TARGET),powerpc-amiga)
  2303. REQUIRE_PACKAGES_RTL=1
  2304. endif
  2305. ifeq ($(FULL_TARGET),powerpc-macos)
  2306. REQUIRE_PACKAGES_RTL=1
  2307. endif
  2308. ifeq ($(FULL_TARGET),powerpc-darwin)
  2309. REQUIRE_PACKAGES_RTL=1
  2310. endif
  2311. ifeq ($(FULL_TARGET),powerpc-morphos)
  2312. REQUIRE_PACKAGES_RTL=1
  2313. endif
  2314. ifeq ($(FULL_TARGET),powerpc-embedded)
  2315. REQUIRE_PACKAGES_RTL=1
  2316. endif
  2317. ifeq ($(FULL_TARGET),powerpc-wii)
  2318. REQUIRE_PACKAGES_RTL=1
  2319. endif
  2320. ifeq ($(FULL_TARGET),sparc-linux)
  2321. REQUIRE_PACKAGES_RTL=1
  2322. endif
  2323. ifeq ($(FULL_TARGET),sparc-netbsd)
  2324. REQUIRE_PACKAGES_RTL=1
  2325. endif
  2326. ifeq ($(FULL_TARGET),sparc-solaris)
  2327. REQUIRE_PACKAGES_RTL=1
  2328. endif
  2329. ifeq ($(FULL_TARGET),sparc-embedded)
  2330. REQUIRE_PACKAGES_RTL=1
  2331. endif
  2332. ifeq ($(FULL_TARGET),x86_64-linux)
  2333. REQUIRE_PACKAGES_RTL=1
  2334. endif
  2335. ifeq ($(FULL_TARGET),x86_64-freebsd)
  2336. REQUIRE_PACKAGES_RTL=1
  2337. endif
  2338. ifeq ($(FULL_TARGET),x86_64-netbsd)
  2339. REQUIRE_PACKAGES_RTL=1
  2340. endif
  2341. ifeq ($(FULL_TARGET),x86_64-solaris)
  2342. REQUIRE_PACKAGES_RTL=1
  2343. endif
  2344. ifeq ($(FULL_TARGET),x86_64-openbsd)
  2345. REQUIRE_PACKAGES_RTL=1
  2346. endif
  2347. ifeq ($(FULL_TARGET),x86_64-darwin)
  2348. REQUIRE_PACKAGES_RTL=1
  2349. endif
  2350. ifeq ($(FULL_TARGET),x86_64-win64)
  2351. REQUIRE_PACKAGES_RTL=1
  2352. endif
  2353. ifeq ($(FULL_TARGET),x86_64-embedded)
  2354. REQUIRE_PACKAGES_RTL=1
  2355. endif
  2356. ifeq ($(FULL_TARGET),arm-linux)
  2357. REQUIRE_PACKAGES_RTL=1
  2358. endif
  2359. ifeq ($(FULL_TARGET),arm-palmos)
  2360. REQUIRE_PACKAGES_RTL=1
  2361. endif
  2362. ifeq ($(FULL_TARGET),arm-darwin)
  2363. REQUIRE_PACKAGES_RTL=1
  2364. endif
  2365. ifeq ($(FULL_TARGET),arm-wince)
  2366. REQUIRE_PACKAGES_RTL=1
  2367. endif
  2368. ifeq ($(FULL_TARGET),arm-gba)
  2369. REQUIRE_PACKAGES_RTL=1
  2370. endif
  2371. ifeq ($(FULL_TARGET),arm-nds)
  2372. REQUIRE_PACKAGES_RTL=1
  2373. endif
  2374. ifeq ($(FULL_TARGET),arm-embedded)
  2375. REQUIRE_PACKAGES_RTL=1
  2376. endif
  2377. ifeq ($(FULL_TARGET),arm-symbian)
  2378. REQUIRE_PACKAGES_RTL=1
  2379. endif
  2380. ifeq ($(FULL_TARGET),powerpc64-linux)
  2381. REQUIRE_PACKAGES_RTL=1
  2382. endif
  2383. ifeq ($(FULL_TARGET),powerpc64-darwin)
  2384. REQUIRE_PACKAGES_RTL=1
  2385. endif
  2386. ifeq ($(FULL_TARGET),powerpc64-embedded)
  2387. REQUIRE_PACKAGES_RTL=1
  2388. endif
  2389. ifeq ($(FULL_TARGET),avr-embedded)
  2390. REQUIRE_PACKAGES_RTL=1
  2391. endif
  2392. ifeq ($(FULL_TARGET),armeb-linux)
  2393. REQUIRE_PACKAGES_RTL=1
  2394. endif
  2395. ifeq ($(FULL_TARGET),armeb-embedded)
  2396. REQUIRE_PACKAGES_RTL=1
  2397. endif
  2398. ifeq ($(FULL_TARGET),mipsel-linux)
  2399. REQUIRE_PACKAGES_RTL=1
  2400. endif
  2401. ifdef REQUIRE_PACKAGES_RTL
  2402. PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
  2403. ifneq ($(PACKAGEDIR_RTL),)
  2404. ifneq ($(wildcard $(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)),)
  2405. UNITDIR_RTL=$(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)
  2406. else
  2407. UNITDIR_RTL=$(PACKAGEDIR_RTL)
  2408. endif
  2409. ifneq ($(wildcard $(PACKAGEDIR_RTL)/units/$(SOURCESUFFIX)),)
  2410. UNITDIR_FPMAKE_RTL=$(PACKAGEDIR_RTL)/units/$(SOURCESUFFIX)
  2411. else
  2412. ifneq ($(wildcard $(PACKAGEDIR_RTL)/units_bs/$(SOURCESUFFIX)),)
  2413. UNITDIR_FPMAKE_RTL=$(PACKAGEDIR_RTL)/units_bs/$(SOURCESUFFIX)
  2414. else
  2415. UNITDIR_FPMAKE_RTL=$(PACKAGEDIR_RTL)
  2416. endif
  2417. endif
  2418. ifdef CHECKDEPEND
  2419. $(PACKAGEDIR_RTL)/$(OS_TARGET)/$(FPCMADE):
  2420. $(MAKE) -C $(PACKAGEDIR_RTL)/$(OS_TARGET) $(FPCMADE)
  2421. override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(OS_TARGET)/$(FPCMADE)
  2422. endif
  2423. else
  2424. PACKAGEDIR_RTL=
  2425. UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
  2426. ifneq ($(UNITDIR_RTL),)
  2427. UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
  2428. else
  2429. UNITDIR_RTL=
  2430. endif
  2431. endif
  2432. ifdef UNITDIR_RTL
  2433. override COMPILER_UNITDIR+=$(UNITDIR_RTL)
  2434. endif
  2435. ifdef UNITDIR_FPMAKE_RTL
  2436. override COMPILER_FPMAKE_UNITDIR+=$(UNITDIR_FPMAKE_RTL)
  2437. endif
  2438. endif
  2439. ifndef NOCPUDEF
  2440. override FPCOPTDEF=$(ARCH)
  2441. endif
  2442. ifneq ($(OS_TARGET),$(OS_SOURCE))
  2443. override FPCOPT+=-T$(OS_TARGET)
  2444. endif
  2445. ifneq ($(CPU_TARGET),$(CPU_SOURCE))
  2446. override FPCOPT+=-P$(ARCH)
  2447. endif
  2448. ifeq ($(OS_SOURCE),openbsd)
  2449. override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
  2450. override FPCMAKEOPT+=-FD$(NEW_BINUTILS_PATH)
  2451. endif
  2452. ifndef CROSSBOOTSTRAP
  2453. ifneq ($(BINUTILSPREFIX),)
  2454. override FPCOPT+=-XP$(BINUTILSPREFIX)
  2455. endif
  2456. ifneq ($(BINUTILSPREFIX),)
  2457. override FPCOPT+=-Xr$(RLINKPATH)
  2458. endif
  2459. endif
  2460. ifndef CROSSCOMPILE
  2461. ifneq ($(BINUTILSPREFIX),)
  2462. override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
  2463. endif
  2464. endif
  2465. ifdef UNITDIR
  2466. override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
  2467. endif
  2468. ifdef LIBDIR
  2469. override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
  2470. endif
  2471. ifdef OBJDIR
  2472. override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
  2473. endif
  2474. ifdef INCDIR
  2475. override FPCOPT+=$(addprefix -Fi,$(INCDIR))
  2476. endif
  2477. ifdef LINKSMART
  2478. override FPCOPT+=-XX
  2479. endif
  2480. ifdef CREATESMART
  2481. override FPCOPT+=-CX
  2482. endif
  2483. ifdef DEBUG
  2484. override FPCOPT+=-gl
  2485. override FPCOPTDEF+=DEBUG
  2486. endif
  2487. ifdef RELEASE
  2488. ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
  2489. ifeq ($(CPU_TARGET),i386)
  2490. FPCCPUOPT:=-OG2p3
  2491. endif
  2492. ifeq ($(CPU_TARGET),powerpc)
  2493. FPCCPUOPT:=-O1r
  2494. endif
  2495. else
  2496. FPCCPUOPT:=-O2
  2497. endif
  2498. override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
  2499. override FPCOPTDEF+=RELEASE
  2500. endif
  2501. ifdef STRIP
  2502. override FPCOPT+=-Xs
  2503. endif
  2504. ifdef OPTIMIZE
  2505. override FPCOPT+=-O2
  2506. endif
  2507. ifdef VERBOSE
  2508. override FPCOPT+=-vwni
  2509. endif
  2510. ifdef COMPILER_OPTIONS
  2511. override FPCOPT+=$(COMPILER_OPTIONS)
  2512. endif
  2513. ifdef COMPILER_UNITDIR
  2514. override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
  2515. endif
  2516. ifdef COMPILER_LIBRARYDIR
  2517. override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
  2518. endif
  2519. ifdef COMPILER_OBJECTDIR
  2520. override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
  2521. endif
  2522. ifdef COMPILER_INCLUDEDIR
  2523. override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
  2524. endif
  2525. ifdef CROSSBINDIR
  2526. override FPCOPT+=-FD$(CROSSBINDIR)
  2527. endif
  2528. ifdef COMPILER_TARGETDIR
  2529. override FPCOPT+=-FE$(COMPILER_TARGETDIR)
  2530. ifeq ($(COMPILER_TARGETDIR),.)
  2531. override TARGETDIRPREFIX=
  2532. else
  2533. override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
  2534. endif
  2535. endif
  2536. ifdef COMPILER_UNITTARGETDIR
  2537. override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
  2538. ifeq ($(COMPILER_UNITTARGETDIR),.)
  2539. override UNITTARGETDIRPREFIX=
  2540. else
  2541. override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
  2542. endif
  2543. else
  2544. ifdef COMPILER_TARGETDIR
  2545. override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
  2546. override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
  2547. endif
  2548. endif
  2549. ifdef CREATESHARED
  2550. override FPCOPT+=-Cg
  2551. ifeq ($(CPU_TARGET),i386)
  2552. override FPCOPT+=-Aas
  2553. endif
  2554. endif
  2555. ifeq ($(findstring 2.0.,$(FPC_VERSION)),)
  2556. ifneq ($(findstring $(OS_TARGET),freebsd openbsd netbsd linux solaris),)
  2557. ifeq ($(CPU_TARGET),x86_64)
  2558. override FPCOPT+=-Cg
  2559. endif
  2560. endif
  2561. endif
  2562. ifdef LINKSHARED
  2563. endif
  2564. ifdef OPT
  2565. override FPCOPT+=$(OPT)
  2566. endif
  2567. ifdef FPCOPTDEF
  2568. override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
  2569. endif
  2570. ifdef CFGFILE
  2571. override FPCOPT+=@$(CFGFILE)
  2572. endif
  2573. ifdef USEENV
  2574. override FPCEXTCMD:=$(FPCOPT)
  2575. override FPCOPT:=!FPCEXTCMD
  2576. export FPCEXTCMD
  2577. endif
  2578. override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
  2579. override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
  2580. ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
  2581. override ACROSSCOMPILE=1
  2582. endif
  2583. ifdef ACROSSCOMPILE
  2584. override FPCOPT+=$(CROSSOPT)
  2585. endif
  2586. override COMPILER:=$(FPC) $(FPCOPT)
  2587. ifeq (,$(findstring -s ,$(COMPILER)))
  2588. EXECPPAS=
  2589. else
  2590. ifeq ($(FULL_SOURCE),$(FULL_TARGET))
  2591. ifdef RUNBATCH
  2592. EXECPPAS:=@$(RUNBATCH) $(PPAS)
  2593. else
  2594. EXECPPAS:=@$(PPAS)
  2595. endif
  2596. endif
  2597. endif
  2598. .PHONY: fpc_exes
  2599. ifndef CROSSINSTALL
  2600. ifneq ($(TARGET_PROGRAMS),)
  2601. override EXEFILES=$(addsuffix $(EXEEXT),$(TARGET_PROGRAMS))
  2602. override EXEOFILES:=$(addsuffix $(OEXT),$(TARGET_PROGRAMS)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS)))
  2603. override EXEDBGFILES:=$(addsuffix $(EXEDBGEXT),$(TARGET_PROGRAMS))
  2604. override ALLTARGET+=fpc_exes
  2605. override INSTALLEXEFILES+=$(EXEFILES)
  2606. override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
  2607. override CLEANEXEDBGFILES+=$(EXEDBGFILES)
  2608. ifeq ($(OS_TARGET),os2)
  2609. override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
  2610. endif
  2611. ifeq ($(OS_TARGET),emx)
  2612. override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
  2613. endif
  2614. endif
  2615. endif
  2616. fpc_exes: $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(EXEFILES)
  2617. ifdef TARGET_RSTS
  2618. override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
  2619. override CLEANRSTFILES+=$(RSTFILES)
  2620. endif
  2621. .PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
  2622. $(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
  2623. @$(ECHOREDIR) Compiled > $(FPCMADE)
  2624. fpc_all: $(FPCMADE)
  2625. fpc_smart:
  2626. $(MAKE) all LINKSMART=1 CREATESMART=1
  2627. fpc_debug:
  2628. $(MAKE) all DEBUG=1
  2629. fpc_release:
  2630. $(MAKE) all RELEASE=1
  2631. .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res
  2632. $(COMPILER_UNITTARGETDIR):
  2633. $(MKDIRTREE) $(COMPILER_UNITTARGETDIR)
  2634. $(COMPILER_TARGETDIR):
  2635. $(MKDIRTREE) $(COMPILER_TARGETDIR)
  2636. %$(PPUEXT): %.pp
  2637. $(COMPILER) $<
  2638. $(EXECPPAS)
  2639. %$(PPUEXT): %.pas
  2640. $(COMPILER) $<
  2641. $(EXECPPAS)
  2642. %$(EXEEXT): %.pp
  2643. $(COMPILER) $<
  2644. $(EXECPPAS)
  2645. %$(EXEEXT): %.pas
  2646. $(COMPILER) $<
  2647. $(EXECPPAS)
  2648. %$(EXEEXT): %.lpr
  2649. $(COMPILER) $<
  2650. $(EXECPPAS)
  2651. %$(EXEEXT): %.dpr
  2652. $(COMPILER) $<
  2653. $(EXECPPAS)
  2654. %.res: %.rc
  2655. windres -i $< -o $@
  2656. vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  2657. vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  2658. vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  2659. vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  2660. vpath %.inc $(COMPILER_INCLUDEDIR)
  2661. vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
  2662. vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
  2663. .PHONY: fpc_shared
  2664. override INSTALLTARGET+=fpc_shared_install
  2665. ifndef SHARED_LIBVERSION
  2666. SHARED_LIBVERSION=$(FPC_VERSION)
  2667. endif
  2668. ifndef SHARED_LIBNAME
  2669. SHARED_LIBNAME=$(PACKAGE_NAME)
  2670. endif
  2671. ifndef SHARED_FULLNAME
  2672. SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
  2673. endif
  2674. ifndef SHARED_LIBUNITS
  2675. SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS)
  2676. override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS))
  2677. endif
  2678. fpc_shared:
  2679. ifdef HASSHAREDLIB
  2680. $(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
  2681. ifneq ($(SHARED_BUILD),n)
  2682. $(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
  2683. endif
  2684. else
  2685. @$(ECHO) Shared Libraries not supported
  2686. endif
  2687. fpc_shared_install:
  2688. ifneq ($(SHARED_BUILD),n)
  2689. ifneq ($(SHARED_LIBUNITS),)
  2690. ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),)
  2691. $(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
  2692. endif
  2693. endif
  2694. endif
  2695. .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
  2696. ifdef INSTALL_UNITS
  2697. override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
  2698. endif
  2699. ifdef INSTALL_BUILDUNIT
  2700. override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
  2701. endif
  2702. ifdef INSTALLPPUFILES
  2703. override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
  2704. ifneq ($(UNITTARGETDIRPREFIX),)
  2705. override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
  2706. override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
  2707. endif
  2708. override INSTALL_CREATEPACKAGEFPC=1
  2709. endif
  2710. ifdef INSTALLEXEFILES
  2711. ifneq ($(TARGETDIRPREFIX),)
  2712. override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES)))
  2713. endif
  2714. endif
  2715. fpc_install: all $(INSTALLTARGET)
  2716. ifdef INSTALLEXEFILES
  2717. $(MKDIR) $(INSTALL_BINDIR)
  2718. $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
  2719. endif
  2720. ifdef INSTALL_CREATEPACKAGEFPC
  2721. ifdef FPCMAKE
  2722. ifdef PACKAGE_VERSION
  2723. ifneq ($(wildcard Makefile.fpc),)
  2724. $(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc
  2725. $(MKDIR) $(INSTALL_UNITDIR)
  2726. $(INSTALL) Package.fpc $(INSTALL_UNITDIR)
  2727. endif
  2728. endif
  2729. endif
  2730. endif
  2731. ifdef INSTALLPPUFILES
  2732. $(MKDIR) $(INSTALL_UNITDIR)
  2733. $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
  2734. ifneq ($(INSTALLPPULINKFILES),)
  2735. $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
  2736. endif
  2737. ifneq ($(wildcard $(LIB_FULLNAME)),)
  2738. $(MKDIR) $(INSTALL_LIBDIR)
  2739. $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
  2740. ifdef inUnix
  2741. ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
  2742. endif
  2743. endif
  2744. endif
  2745. ifdef INSTALL_FILES
  2746. $(MKDIR) $(INSTALL_DATADIR)
  2747. $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
  2748. endif
  2749. fpc_sourceinstall: distclean
  2750. $(MKDIR) $(INSTALL_SOURCEDIR)
  2751. $(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
  2752. fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
  2753. ifdef HASEXAMPLES
  2754. $(MKDIR) $(INSTALL_EXAMPLEDIR)
  2755. endif
  2756. ifdef EXAMPLESOURCEFILES
  2757. $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
  2758. endif
  2759. ifdef TARGET_EXAMPLEDIRS
  2760. $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
  2761. endif
  2762. .PHONY: fpc_distinstall
  2763. fpc_distinstall: install exampleinstall
  2764. .PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall
  2765. ifndef PACKDIR
  2766. ifndef inUnix
  2767. PACKDIR=$(BASEDIR)/../fpc-pack
  2768. else
  2769. PACKDIR=/tmp/fpc-pack
  2770. endif
  2771. endif
  2772. ifndef ZIPNAME
  2773. ifdef DIST_ZIPNAME
  2774. ZIPNAME=$(DIST_ZIPNAME)
  2775. else
  2776. ZIPNAME=$(PACKAGE_NAME)
  2777. endif
  2778. endif
  2779. ifndef FULLZIPNAME
  2780. FULLZIPNAME=$(ZIPCROSSPREFIX)$(ZIPPREFIX)$(ZIPNAME)$(ZIPSUFFIX)
  2781. endif
  2782. ifndef ZIPTARGET
  2783. ifdef DIST_ZIPTARGET
  2784. ZIPTARGET=DIST_ZIPTARGET
  2785. else
  2786. ZIPTARGET=install
  2787. endif
  2788. endif
  2789. ifndef USEZIP
  2790. ifdef inUnix
  2791. USETAR=1
  2792. endif
  2793. endif
  2794. ifndef inUnix
  2795. USEZIPWRAPPER=1
  2796. endif
  2797. ifdef USEZIPWRAPPER
  2798. ZIPPATHSEP=$(PATHSEP)
  2799. ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(SRCBATCHEXT))
  2800. else
  2801. ZIPPATHSEP=/
  2802. endif
  2803. ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
  2804. ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
  2805. ifdef USETAR
  2806. ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(TAREXT)
  2807. ZIPCMD_ZIP:=$(TARPROG) c$(TAROPT)f $(ZIPDESTFILE) *
  2808. else
  2809. ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(ZIPEXT)
  2810. ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
  2811. endif
  2812. fpc_zipinstall:
  2813. $(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1
  2814. $(MKDIR) $(DIST_DESTDIR)
  2815. $(DEL) $(ZIPDESTFILE)
  2816. ifdef USEZIPWRAPPER
  2817. ifneq ($(ECHOREDIR),echo)
  2818. $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER)
  2819. $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)
  2820. $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER)
  2821. else
  2822. echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)
  2823. echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)
  2824. echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)
  2825. endif
  2826. ifdef inUnix
  2827. /bin/sh $(ZIPWRAPPER)
  2828. else
  2829. ifdef RUNBATCH
  2830. $(RUNBATCH) $(ZIPWRAPPER)
  2831. else
  2832. $(ZIPWRAPPER)
  2833. endif
  2834. endif
  2835. $(DEL) $(ZIPWRAPPER)
  2836. else
  2837. $(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)
  2838. endif
  2839. $(DELTREE) $(PACKDIR)
  2840. fpc_zipsourceinstall:
  2841. $(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=$(ZIPSOURCESUFFIX)
  2842. fpc_zipexampleinstall:
  2843. ifdef HASEXAMPLES
  2844. $(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=$(ZIPEXAMPLESUFFIX)
  2845. endif
  2846. fpc_zipdistinstall:
  2847. $(MAKE) fpc_zipinstall ZIPTARGET=distinstall
  2848. .PHONY: fpc_clean fpc_cleanall fpc_distclean
  2849. ifdef EXEFILES
  2850. override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
  2851. override CLEANEXEDBGFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEDBGFILES))
  2852. endif
  2853. ifdef CLEAN_PROGRAMS
  2854. override CLEANEXEFILES+=$(addprefix $(TARGETDIRPREFIX),$(addsuffix $(EXEEXT), $(CLEAN_PROGRAMS)))
  2855. override CLEANEXEDBGFILES+=$(addprefix $(TARGETDIRPREFIX),$(addsuffix $(EXEDBGEXT), $(CLEAN_PROGRAMS)))
  2856. endif
  2857. ifdef CLEAN_UNITS
  2858. override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
  2859. endif
  2860. ifdef CLEANPPUFILES
  2861. override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
  2862. ifdef DEBUGSYMEXT
  2863. override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
  2864. endif
  2865. override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
  2866. override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
  2867. endif
  2868. fpc_clean: $(CLEANTARGET)
  2869. ifdef CLEANEXEFILES
  2870. -$(DEL) $(CLEANEXEFILES)
  2871. endif
  2872. ifdef CLEANEXEDBGFILES
  2873. -$(DELTREE) $(CLEANEXEDBGFILES)
  2874. endif
  2875. ifdef CLEANPPUFILES
  2876. -$(DEL) $(CLEANPPUFILES)
  2877. endif
  2878. ifneq ($(CLEANPPULINKFILES),)
  2879. -$(DEL) $(CLEANPPULINKFILES)
  2880. endif
  2881. ifdef CLEANRSTFILES
  2882. -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
  2883. endif
  2884. ifdef CLEAN_FILES
  2885. -$(DEL) $(CLEAN_FILES)
  2886. endif
  2887. ifdef LIB_NAME
  2888. -$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
  2889. endif
  2890. -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  2891. -$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT)
  2892. fpc_cleanall: $(CLEANTARGET)
  2893. ifdef CLEANEXEFILES
  2894. -$(DEL) $(CLEANEXEFILES)
  2895. endif
  2896. ifdef COMPILER_UNITTARGETDIR
  2897. ifdef CLEANPPUFILES
  2898. -$(DEL) $(CLEANPPUFILES)
  2899. endif
  2900. ifneq ($(CLEANPPULINKFILES),)
  2901. -$(DEL) $(CLEANPPULINKFILES)
  2902. endif
  2903. ifdef CLEANRSTFILES
  2904. -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
  2905. endif
  2906. endif
  2907. ifdef CLEAN_FILES
  2908. -$(DEL) $(CLEAN_FILES)
  2909. endif
  2910. -$(DELTREE) units
  2911. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  2912. ifneq ($(PPUEXT),.ppu)
  2913. -$(DEL) *.o *.ppu *.a
  2914. endif
  2915. -$(DELTREE) *$(SMARTEXT)
  2916. -$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  2917. -$(DEL) *_ppas$(BATCHEXT)
  2918. ifdef AOUTEXT
  2919. -$(DEL) *$(AOUTEXT)
  2920. endif
  2921. ifdef DEBUGSYMEXT
  2922. -$(DEL) *$(DEBUGSYMEXT)
  2923. endif
  2924. fpc_distclean: cleanall
  2925. .PHONY: fpc_baseinfo
  2926. override INFORULES+=fpc_baseinfo
  2927. fpc_baseinfo:
  2928. @$(ECHO)
  2929. @$(ECHO) == Package info ==
  2930. @$(ECHO) Package Name..... $(PACKAGE_NAME)
  2931. @$(ECHO) Package Version.. $(PACKAGE_VERSION)
  2932. @$(ECHO)
  2933. @$(ECHO) == Configuration info ==
  2934. @$(ECHO)
  2935. @$(ECHO) FPC.......... $(FPC)
  2936. @$(ECHO) FPC Version.. $(FPC_VERSION)
  2937. @$(ECHO) Source CPU... $(CPU_SOURCE)
  2938. @$(ECHO) Target CPU... $(CPU_TARGET)
  2939. @$(ECHO) Source OS.... $(OS_SOURCE)
  2940. @$(ECHO) Target OS.... $(OS_TARGET)
  2941. @$(ECHO) Full Source.. $(FULL_SOURCE)
  2942. @$(ECHO) Full Target.. $(FULL_TARGET)
  2943. @$(ECHO) SourceSuffix. $(SOURCESUFFIX)
  2944. @$(ECHO) TargetSuffix. $(TARGETSUFFIX)
  2945. @$(ECHO) FPC fpmake... $(FPCFPMAKE)
  2946. @$(ECHO)
  2947. @$(ECHO) == Directory info ==
  2948. @$(ECHO)
  2949. @$(ECHO) Required pkgs... $(REQUIRE_PACKAGES)
  2950. @$(ECHO)
  2951. @$(ECHO) Basedir......... $(BASEDIR)
  2952. @$(ECHO) FPCDir.......... $(FPCDIR)
  2953. @$(ECHO) CrossBinDir..... $(CROSSBINDIR)
  2954. @$(ECHO) UnitsDir........ $(UNITSDIR)
  2955. @$(ECHO) PackagesDir..... $(PACKAGESDIR)
  2956. @$(ECHO)
  2957. @$(ECHO) GCC library..... $(GCCLIBDIR)
  2958. @$(ECHO) Other library... $(OTHERLIBDIR)
  2959. @$(ECHO)
  2960. @$(ECHO) == Tools info ==
  2961. @$(ECHO)
  2962. @$(ECHO) As........ $(AS)
  2963. @$(ECHO) Ld........ $(LD)
  2964. @$(ECHO) Ar........ $(AR)
  2965. @$(ECHO) Rc........ $(RC)
  2966. @$(ECHO)
  2967. @$(ECHO) Mv........ $(MVPROG)
  2968. @$(ECHO) Cp........ $(CPPROG)
  2969. @$(ECHO) Rm........ $(RMPROG)
  2970. @$(ECHO) GInstall.. $(GINSTALL)
  2971. @$(ECHO) Echo...... $(ECHO)
  2972. @$(ECHO) Shell..... $(SHELL)
  2973. @$(ECHO) Date...... $(DATE)
  2974. @$(ECHO) FPCMake... $(FPCMAKE)
  2975. @$(ECHO) PPUMove... $(PPUMOVE)
  2976. @$(ECHO) Zip....... $(ZIPPROG)
  2977. @$(ECHO)
  2978. @$(ECHO) == Object info ==
  2979. @$(ECHO)
  2980. @$(ECHO) Target Loaders........ $(TARGET_LOADERS)
  2981. @$(ECHO) Target Units.......... $(TARGET_UNITS)
  2982. @$(ECHO) Target Implicit Units. $(TARGET_IMPLICITUNITS)
  2983. @$(ECHO) Target Programs....... $(TARGET_PROGRAMS)
  2984. @$(ECHO) Target Dirs........... $(TARGET_DIRS)
  2985. @$(ECHO) Target Examples....... $(TARGET_EXAMPLES)
  2986. @$(ECHO) Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
  2987. @$(ECHO)
  2988. @$(ECHO) Clean Units......... $(CLEAN_UNITS)
  2989. @$(ECHO) Clean Files......... $(CLEAN_FILES)
  2990. @$(ECHO)
  2991. @$(ECHO) Install Units....... $(INSTALL_UNITS)
  2992. @$(ECHO) Install Files....... $(INSTALL_FILES)
  2993. @$(ECHO)
  2994. @$(ECHO) == Install info ==
  2995. @$(ECHO)
  2996. @$(ECHO) DateStr.............. $(DATESTR)
  2997. @$(ECHO) ZipName.............. $(ZIPNAME)
  2998. @$(ECHO) ZipPrefix............ $(ZIPPREFIX)
  2999. @$(ECHO) ZipCrossPrefix....... $(ZIPCROSSPREFIX)
  3000. @$(ECHO) ZipSuffix............ $(ZIPSUFFIX)
  3001. @$(ECHO) FullZipName.......... $(FULLZIPNAME)
  3002. @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE)
  3003. @$(ECHO)
  3004. @$(ECHO) Install base dir..... $(INSTALL_BASEDIR)
  3005. @$(ECHO) Install binary dir... $(INSTALL_BINDIR)
  3006. @$(ECHO) Install library dir.. $(INSTALL_LIBDIR)
  3007. @$(ECHO) Install units dir.... $(INSTALL_UNITDIR)
  3008. @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR)
  3009. @$(ECHO) Install doc dir...... $(INSTALL_DOCDIR)
  3010. @$(ECHO) Install example dir.. $(INSTALL_EXAMPLEDIR)
  3011. @$(ECHO) Install data dir..... $(INSTALL_DATADIR)
  3012. @$(ECHO)
  3013. @$(ECHO) Dist destination dir. $(DIST_DESTDIR)
  3014. @$(ECHO) Dist zip name........ $(DIST_ZIPNAME)
  3015. @$(ECHO)
  3016. .PHONY: fpc_info
  3017. fpc_info: $(INFORULES)
  3018. .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
  3019. fpc_makefile_dirs
  3020. fpc_makefile:
  3021. $(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
  3022. fpc_makefile_sub1:
  3023. ifdef TARGET_DIRS
  3024. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
  3025. endif
  3026. ifdef TARGET_EXAMPLEDIRS
  3027. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
  3028. endif
  3029. fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
  3030. fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
  3031. fpc_makefiles: fpc_makefile fpc_makefile_dirs
  3032. ifeq ($(FULL_TARGET),i386-linux)
  3033. TARGET_DIRS_UTILS=1
  3034. endif
  3035. ifeq ($(FULL_TARGET),i386-go32v2)
  3036. TARGET_DIRS_UTILS=1
  3037. endif
  3038. ifeq ($(FULL_TARGET),i386-win32)
  3039. TARGET_DIRS_UTILS=1
  3040. endif
  3041. ifeq ($(FULL_TARGET),i386-os2)
  3042. TARGET_DIRS_UTILS=1
  3043. endif
  3044. ifeq ($(FULL_TARGET),i386-freebsd)
  3045. TARGET_DIRS_UTILS=1
  3046. endif
  3047. ifeq ($(FULL_TARGET),i386-beos)
  3048. TARGET_DIRS_UTILS=1
  3049. endif
  3050. ifeq ($(FULL_TARGET),i386-haiku)
  3051. TARGET_DIRS_UTILS=1
  3052. endif
  3053. ifeq ($(FULL_TARGET),i386-netbsd)
  3054. TARGET_DIRS_UTILS=1
  3055. endif
  3056. ifeq ($(FULL_TARGET),i386-solaris)
  3057. TARGET_DIRS_UTILS=1
  3058. endif
  3059. ifeq ($(FULL_TARGET),i386-qnx)
  3060. TARGET_DIRS_UTILS=1
  3061. endif
  3062. ifeq ($(FULL_TARGET),i386-netware)
  3063. TARGET_DIRS_UTILS=1
  3064. endif
  3065. ifeq ($(FULL_TARGET),i386-openbsd)
  3066. TARGET_DIRS_UTILS=1
  3067. endif
  3068. ifeq ($(FULL_TARGET),i386-wdosx)
  3069. TARGET_DIRS_UTILS=1
  3070. endif
  3071. ifeq ($(FULL_TARGET),i386-darwin)
  3072. TARGET_DIRS_UTILS=1
  3073. endif
  3074. ifeq ($(FULL_TARGET),i386-emx)
  3075. TARGET_DIRS_UTILS=1
  3076. endif
  3077. ifeq ($(FULL_TARGET),i386-watcom)
  3078. TARGET_DIRS_UTILS=1
  3079. endif
  3080. ifeq ($(FULL_TARGET),i386-netwlibc)
  3081. TARGET_DIRS_UTILS=1
  3082. endif
  3083. ifeq ($(FULL_TARGET),i386-wince)
  3084. TARGET_DIRS_UTILS=1
  3085. endif
  3086. ifeq ($(FULL_TARGET),i386-embedded)
  3087. TARGET_DIRS_UTILS=1
  3088. endif
  3089. ifeq ($(FULL_TARGET),i386-symbian)
  3090. TARGET_DIRS_UTILS=1
  3091. endif
  3092. ifeq ($(FULL_TARGET),i386-nativent)
  3093. TARGET_DIRS_UTILS=1
  3094. endif
  3095. ifeq ($(FULL_TARGET),i386-iphonesim)
  3096. TARGET_DIRS_UTILS=1
  3097. endif
  3098. ifeq ($(FULL_TARGET),m68k-linux)
  3099. TARGET_DIRS_UTILS=1
  3100. endif
  3101. ifeq ($(FULL_TARGET),m68k-freebsd)
  3102. TARGET_DIRS_UTILS=1
  3103. endif
  3104. ifeq ($(FULL_TARGET),m68k-netbsd)
  3105. TARGET_DIRS_UTILS=1
  3106. endif
  3107. ifeq ($(FULL_TARGET),m68k-amiga)
  3108. TARGET_DIRS_UTILS=1
  3109. endif
  3110. ifeq ($(FULL_TARGET),m68k-atari)
  3111. TARGET_DIRS_UTILS=1
  3112. endif
  3113. ifeq ($(FULL_TARGET),m68k-openbsd)
  3114. TARGET_DIRS_UTILS=1
  3115. endif
  3116. ifeq ($(FULL_TARGET),m68k-palmos)
  3117. TARGET_DIRS_UTILS=1
  3118. endif
  3119. ifeq ($(FULL_TARGET),m68k-embedded)
  3120. TARGET_DIRS_UTILS=1
  3121. endif
  3122. ifeq ($(FULL_TARGET),powerpc-linux)
  3123. TARGET_DIRS_UTILS=1
  3124. endif
  3125. ifeq ($(FULL_TARGET),powerpc-netbsd)
  3126. TARGET_DIRS_UTILS=1
  3127. endif
  3128. ifeq ($(FULL_TARGET),powerpc-amiga)
  3129. TARGET_DIRS_UTILS=1
  3130. endif
  3131. ifeq ($(FULL_TARGET),powerpc-macos)
  3132. TARGET_DIRS_UTILS=1
  3133. endif
  3134. ifeq ($(FULL_TARGET),powerpc-darwin)
  3135. TARGET_DIRS_UTILS=1
  3136. endif
  3137. ifeq ($(FULL_TARGET),powerpc-morphos)
  3138. TARGET_DIRS_UTILS=1
  3139. endif
  3140. ifeq ($(FULL_TARGET),powerpc-embedded)
  3141. TARGET_DIRS_UTILS=1
  3142. endif
  3143. ifeq ($(FULL_TARGET),powerpc-wii)
  3144. TARGET_DIRS_UTILS=1
  3145. endif
  3146. ifeq ($(FULL_TARGET),sparc-linux)
  3147. TARGET_DIRS_UTILS=1
  3148. endif
  3149. ifeq ($(FULL_TARGET),sparc-netbsd)
  3150. TARGET_DIRS_UTILS=1
  3151. endif
  3152. ifeq ($(FULL_TARGET),sparc-solaris)
  3153. TARGET_DIRS_UTILS=1
  3154. endif
  3155. ifeq ($(FULL_TARGET),sparc-embedded)
  3156. TARGET_DIRS_UTILS=1
  3157. endif
  3158. ifeq ($(FULL_TARGET),x86_64-linux)
  3159. TARGET_DIRS_UTILS=1
  3160. endif
  3161. ifeq ($(FULL_TARGET),x86_64-freebsd)
  3162. TARGET_DIRS_UTILS=1
  3163. endif
  3164. ifeq ($(FULL_TARGET),x86_64-netbsd)
  3165. TARGET_DIRS_UTILS=1
  3166. endif
  3167. ifeq ($(FULL_TARGET),x86_64-solaris)
  3168. TARGET_DIRS_UTILS=1
  3169. endif
  3170. ifeq ($(FULL_TARGET),x86_64-openbsd)
  3171. TARGET_DIRS_UTILS=1
  3172. endif
  3173. ifeq ($(FULL_TARGET),x86_64-darwin)
  3174. TARGET_DIRS_UTILS=1
  3175. endif
  3176. ifeq ($(FULL_TARGET),x86_64-win64)
  3177. TARGET_DIRS_UTILS=1
  3178. endif
  3179. ifeq ($(FULL_TARGET),x86_64-embedded)
  3180. TARGET_DIRS_UTILS=1
  3181. endif
  3182. ifeq ($(FULL_TARGET),arm-linux)
  3183. TARGET_DIRS_UTILS=1
  3184. endif
  3185. ifeq ($(FULL_TARGET),arm-palmos)
  3186. TARGET_DIRS_UTILS=1
  3187. endif
  3188. ifeq ($(FULL_TARGET),arm-darwin)
  3189. TARGET_DIRS_UTILS=1
  3190. endif
  3191. ifeq ($(FULL_TARGET),arm-wince)
  3192. TARGET_DIRS_UTILS=1
  3193. endif
  3194. ifeq ($(FULL_TARGET),arm-gba)
  3195. TARGET_DIRS_UTILS=1
  3196. endif
  3197. ifeq ($(FULL_TARGET),arm-nds)
  3198. TARGET_DIRS_UTILS=1
  3199. endif
  3200. ifeq ($(FULL_TARGET),arm-embedded)
  3201. TARGET_DIRS_UTILS=1
  3202. endif
  3203. ifeq ($(FULL_TARGET),arm-symbian)
  3204. TARGET_DIRS_UTILS=1
  3205. endif
  3206. ifeq ($(FULL_TARGET),powerpc64-linux)
  3207. TARGET_DIRS_UTILS=1
  3208. endif
  3209. ifeq ($(FULL_TARGET),powerpc64-darwin)
  3210. TARGET_DIRS_UTILS=1
  3211. endif
  3212. ifeq ($(FULL_TARGET),powerpc64-embedded)
  3213. TARGET_DIRS_UTILS=1
  3214. endif
  3215. ifeq ($(FULL_TARGET),avr-embedded)
  3216. TARGET_DIRS_UTILS=1
  3217. endif
  3218. ifeq ($(FULL_TARGET),armeb-linux)
  3219. TARGET_DIRS_UTILS=1
  3220. endif
  3221. ifeq ($(FULL_TARGET),armeb-embedded)
  3222. TARGET_DIRS_UTILS=1
  3223. endif
  3224. ifeq ($(FULL_TARGET),mipsel-linux)
  3225. TARGET_DIRS_UTILS=1
  3226. endif
  3227. ifdef TARGET_DIRS_UTILS
  3228. utils_all:
  3229. $(MAKE) -C utils all
  3230. utils_debug:
  3231. $(MAKE) -C utils debug
  3232. utils_smart:
  3233. $(MAKE) -C utils smart
  3234. utils_release:
  3235. $(MAKE) -C utils release
  3236. utils_units:
  3237. $(MAKE) -C utils units
  3238. utils_examples:
  3239. $(MAKE) -C utils examples
  3240. utils_shared:
  3241. $(MAKE) -C utils shared
  3242. utils_install:
  3243. $(MAKE) -C utils install
  3244. utils_sourceinstall:
  3245. $(MAKE) -C utils sourceinstall
  3246. utils_exampleinstall:
  3247. $(MAKE) -C utils exampleinstall
  3248. utils_distinstall:
  3249. $(MAKE) -C utils distinstall
  3250. utils_zipinstall:
  3251. $(MAKE) -C utils zipinstall
  3252. utils_zipsourceinstall:
  3253. $(MAKE) -C utils zipsourceinstall
  3254. utils_zipexampleinstall:
  3255. $(MAKE) -C utils zipexampleinstall
  3256. utils_zipdistinstall:
  3257. $(MAKE) -C utils zipdistinstall
  3258. utils_clean:
  3259. $(MAKE) -C utils clean
  3260. utils_distclean:
  3261. $(MAKE) -C utils distclean
  3262. utils_cleanall:
  3263. $(MAKE) -C utils cleanall
  3264. utils_info:
  3265. $(MAKE) -C utils info
  3266. utils_makefiles:
  3267. $(MAKE) -C utils makefiles
  3268. utils:
  3269. $(MAKE) -C utils all
  3270. .PHONY: utils_all utils_debug utils_smart utils_release utils_units utils_examples utils_shared utils_install utils_sourceinstall utils_exampleinstall utils_distinstall utils_zipinstall utils_zipsourceinstall utils_zipexampleinstall utils_zipdistinstall utils_clean utils_distclean utils_cleanall utils_info utils_makefiles utils
  3271. endif
  3272. ifndef DIFF
  3273. DIFF:=$(strip $(wildcard $(addsuffix /diff$(SRCEXEEXT),$(SEARCHPATH))))
  3274. ifeq ($(DIFF),)
  3275. DIFF= __missing_command_DIFF
  3276. else
  3277. DIFF:=$(firstword $(DIFF))
  3278. endif
  3279. endif
  3280. export DIFF
  3281. ifndef CMP
  3282. CMP:=$(strip $(wildcard $(addsuffix /cmp$(SRCEXEEXT),$(SEARCHPATH))))
  3283. ifeq ($(CMP),)
  3284. CMP= __missing_command_CMP
  3285. else
  3286. CMP:=$(firstword $(CMP))
  3287. endif
  3288. endif
  3289. export CMP
  3290. debug: fpc_debug
  3291. smart: fpc_smart
  3292. release: fpc_release
  3293. units: fpc_units $(addsuffix _units,$(TARGET_DIRS))
  3294. examples: $(addsuffix _examples,$(TARGET_DIRS))
  3295. shared: fpc_shared
  3296. sourceinstall: fpc_sourceinstall
  3297. exampleinstall: fpc_exampleinstall $(addsuffix _exampleinstall,$(TARGET_DIRS))
  3298. distinstall: fpc_distinstall
  3299. zipinstall: fpc_zipinstall
  3300. zipsourceinstall: fpc_zipsourceinstall
  3301. zipexampleinstall: fpc_zipexampleinstall $(addsuffix _zipexampleinstall,$(TARGET_DIRS))
  3302. zipdistinstall: fpc_zipdistinstall
  3303. cleanall: fpc_cleanall $(addsuffix _cleanall,$(TARGET_DIRS))
  3304. info: fpc_info
  3305. makefiles: fpc_makefiles
  3306. .PHONY: debug smart release units examples shared sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall cleanall info makefiles
  3307. ifneq ($(wildcard fpcmake.loc),)
  3308. include fpcmake.loc
  3309. endif
  3310. ifeq ($(OS_TARGET),win32)
  3311. USE_CMP_FOR_DIFF=1
  3312. endif
  3313. ifeq ($(OS_TARGET),win64)
  3314. USE_CMP_FOR_DIFF=1
  3315. endif
  3316. ifdef USE_CMP_FOR_DIFF
  3317. ifdef CMP
  3318. override DIFF:=$(CMP) -i218
  3319. endif
  3320. endif
  3321. override COMPILER+=$(LOCALOPT)
  3322. PASDOC:=$(strip $(wildcard $(addsuffix /pasdoc.exe,$(SEARCHPATH))))
  3323. ifeq ($(PASDOC),)
  3324. PASDOC:=$(strip $(wildcard $(addsuffix /pasdoc,$(SEARCHPATH))))
  3325. endif
  3326. ifeq ($(PASDOC),)
  3327. PASDOC:=../projects/pasdoc/bin/pasdoc
  3328. else
  3329. PASDOC:=$(firstword $(PASDOC))
  3330. endif
  3331. ifndef EXENAME
  3332. EXENAME=ppc$(CPUSUF)$(EXEEXT)
  3333. endif
  3334. PPEXENAME=pp$(EXEEXT)
  3335. TEMPNAME=ppc$(SRCEXEEXT)
  3336. PPCROSSNAME=ppcross$(CPUSUF)$(SRCEXEEXT)
  3337. TEMPNAME1=ppc1$(EXEEXT)
  3338. TEMPNAME2=ppc2$(EXEEXT)
  3339. TEMPNAME3=ppc3$(EXEEXT)
  3340. TEMPWPONAME1=ppcwpo1$(EXEEXT)
  3341. TEMPWPONAME2=ppcwpo2$(EXEEXT)
  3342. MAKEDEP=ppdep$(EXEEXT)
  3343. MSG2INC=./msg2inc$(EXEEXT)
  3344. ifdef CROSSINSTALL
  3345. INSTALLEXEFILE=$(PPCROSSNAME)
  3346. else
  3347. INSTALLEXEFILE=$(EXENAME)
  3348. endif
  3349. PPC_TARGETS=i386 m68k powerpc sparc arm armeb x86_64 powerpc64 alpha vis ia64 mips mipsel
  3350. .PHONY: $(PPC_TARGETS)
  3351. $(PPC_TARGETS):
  3352. $(MAKE) PPC_TARGET=$@ CPU_UNITDIR=$@ all
  3353. alltargets: $(ALLTARGETS)
  3354. .NOTPARALLEL:
  3355. .PHONY: all compiler echotime ppuclean execlean clean distclean
  3356. all: compiler $(addsuffix _all,$(TARGET_DIRS))
  3357. compiler: $(COMPILER_UNITTARGETDIR) $(COMPILER_TARGETDIR) $(EXENAME)
  3358. ifeq ($(MAKELEVEL),0)
  3359. ifndef STARTTIME
  3360. ifdef DATE
  3361. STARTTIME:=$(shell $(DATE) +%T)
  3362. else
  3363. STARTTIME:=unknown
  3364. endif
  3365. endif
  3366. endif
  3367. export STARTTIME
  3368. ifdef DATE
  3369. ENDTIME=$(shell $(DATE) +%T)
  3370. else
  3371. ENDTIME:=unknown
  3372. endif
  3373. echotime:
  3374. @echo Start $(STARTTIME) now $(ENDTIME)
  3375. ppuclean:
  3376. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  3377. -$(DEL) $(addsuffix /*$(PPUEXT),$(COMPILERSOURCEDIR))
  3378. tempclean:
  3379. -$(DEL) $(PPCROSSNAME) $(TEMPNAME) $(TEMPNAME1) $(TEMPNAME2) $(TEMPNAME3) $(MSG2INC) pp1.wpo pp2.wpo
  3380. execlean :
  3381. -$(DEL) ppc386$(EXEEXT) ppc68k$(EXEEXT) ppcx64$(EXEEXT) ppcppc$(EXEEXT) ppcsparc$(EXEEXT) ppcppc64$(EXEEXT) ppcarm$(EXEEXT) ppcmips$(EXEEXT) ppcmipsel$(EXEEXT) $(EXENAME) $(TEMPWPONAME1) $(TEMPWPONAME2)
  3382. $(addsuffix _clean,$(ALLTARGETS)):
  3383. -$(DELTREE) $(addprefix $(subst _clean,,$@),/units)
  3384. -$(DEL) $(addprefix $(subst _clean,,$@)/,*$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT))
  3385. -$(DEL) $(addprefix $(subst _clean,,$@)/,ppc386$(EXEEXT) ppc68k$(EXEEXT) ppcx64$(EXEEXT) ppcppc$(EXEEXT) ppcsparc$(EXEEXT) ppcppc64$(EXEEXT) ppcarm$(EXEEXT) ppcmips$(EXEEXT) ppcmipsel$(EXEEXT) $(EXENAME))
  3386. cycleclean: cleanall $(addsuffix _clean,$(CPC_TARGET))
  3387. -$(DEL) $(EXENAME)
  3388. clean: tempclean execlean cleanall $(addsuffix _clean,$(CPC_TARGET)) $(addsuffix _clean,$(TARGET_DIRS))
  3389. distclean: tempclean execlean cleanall $(addsuffix _clean,$(ALLTARGETS)) $(addsuffix _distclean,$(TARGET_DIRS))
  3390. $(MSG2INC): $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(COMPILERUTILSDIR)/msg2inc.pp
  3391. $(COMPILER) -FE. $(COMPILERUTILSDIR)/msg2inc.pp
  3392. msgtxt.inc: $(MSGFILE)
  3393. $(MAKE) $(MSG2INC)
  3394. $(MSG2INC) $(MSGFILE) msg msg
  3395. msg: msgtxt.inc
  3396. insdatx86 : $(COMPILER_UNITTARGETDIR) x86/x86ins.dat
  3397. $(COMPILER) -FE$(COMPILERUTILSDIR) $(COMPILERUTILSDIR)/mkx86ins.pp
  3398. cd x86 && ..$(PATHSEP)utils$(PATHSEP)mkx86ins$(SRCEXEEXT) && mv -f *.inc ../i386
  3399. cd x86 && ..$(PATHSEP)utils$(PATHSEP)mkx86ins$(SRCEXEEXT) x86_64 && mv -f *.inc ../x86_64
  3400. $(COMPILER) -FE$(COMPILERUTILSDIR) $(COMPILERUTILSDIR)/mkx86reg.pp
  3401. cd x86 && ..$(PATHSEP)utils$(PATHSEP)mkx86reg$(SRCEXEEXT)
  3402. mv -f x86/r386*.inc i386
  3403. cd x86 && ..$(PATHSEP)utils$(PATHSEP)mkx86reg$(SRCEXEEXT) x86_64
  3404. mv -f x86/r8664*.inc x86_64
  3405. insdatarm : arm/armins.dat
  3406. $(COMPILER) -FE$(COMPILERUTILSDIR) $(COMPILERUTILSDIR)/mkarmins.pp
  3407. cd arm && ..$(PATHSEP)utils$(PATHSEP)mkarmins$(SRCEXEEXT)
  3408. insdat: insdatx86 insdatarm
  3409. regdatarm : arm/armreg.dat
  3410. $(COMPILER) -FE$(COMPILERUTILSDIR) $(COMPILERUTILSDIR)/mkarmreg.pp
  3411. cd arm && ..$(PATHSEP)utils$PATHSEP)mkarmreg$(SRCEXEEXT)
  3412. revision.inc :
  3413. ifneq ($(REVSTR),)
  3414. ifdef USEZIPWRAPPER
  3415. ifneq ($(ECHOREDIR),echo)
  3416. $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
  3417. else
  3418. $(ECHOREDIR) '$(REVSTR)' > revision.inc
  3419. endif
  3420. else
  3421. $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
  3422. endif
  3423. else
  3424. $(MAKE) revision.inc REVINC=force
  3425. endif
  3426. .PHONY : revision
  3427. revision :
  3428. $(DEL) revision.inc
  3429. $(MAKE) revision.inc
  3430. $(EXENAME) : $(wildcard *.pas) $(wildcard *.inc) msg \
  3431. $(wildcard systems/*.pas) $(wilcard systems/*.inc) \
  3432. $(wildcard $(CPC_TARGET)/*.pas) $(wildcard $(CPC_TARGET)/*.inc) \
  3433. $(COMPILER_UNITTARGETDIR) $(COMPILER_TARGETDIR)
  3434. ifneq ($(REVSTR),)
  3435. ifdef USEZIPWRAPPER
  3436. ifneq ($(ECHOREDIR),echo)
  3437. $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
  3438. else
  3439. $(ECHOREDIR) '$(REVSTR)' > revision.inc
  3440. endif
  3441. else
  3442. $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
  3443. endif
  3444. $(COMPILER) version.pas
  3445. endif
  3446. $(COMPILER) pp.pas
  3447. $(EXECPPAS)
  3448. $(MOVE) $(COMPILER_TARGETDIR)/$(PPEXENAME) $(EXENAME)
  3449. ifeq ($(CPU_SOURCE),$(PPC_TARGET))
  3450. ifeq ($(OS_SOURCE),$(OS_TARGET))
  3451. ifndef NOWPOCYCLE
  3452. ifdef RELEASE
  3453. DOWPOCYCLE=1
  3454. wpocycle:
  3455. $(RM) $(EXENAME)
  3456. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3)' 'OPT=$(LOCALOPT) $(OPTWPOCOLLECT)' compiler
  3457. $(RM) $(EXENAME)
  3458. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3)' 'OPT=$(RTLOPT) $(OPTWPOPERFORM)' rtlclean rtl
  3459. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3)' 'OPT=$(LOCALOPT) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT))' $(addsuffix _clean,$(ALLTARGETS)) compiler
  3460. $(MOVE) $(EXENAME) $(TEMPWPONAME1)
  3461. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1)' 'OPT=$(RTLOPT) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM))' rtlclean rtl
  3462. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1)' 'OPT=$(LOCALOPT) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM))' $(addsuffix _clean,$(ALLTARGETS)) compiler
  3463. $(COPY) $(EXENAME) $(TEMPWPONAME2)
  3464. endif
  3465. endif
  3466. ifndef DOWPOCYCLE
  3467. wpocycle:
  3468. endif
  3469. ifdef DIFF
  3470. ifdef OLDFPC
  3471. ifneq ($(OS_TARGET),darwin)
  3472. DIFFRESULT:=$(shell $(DIFF) $(OLDFPC) $(FPC))
  3473. else
  3474. DIFFRESULT:=$(shell cp $(OLDFPC) $(OLDFPC).tmp; cp $(FPC) $(FPC).tmp; strip -no_uuid $(OLDFPC).tmp; strip -no_uuid $(FPC).tmp; $(DIFF) $(OLDFPC).tmp $(FPC).tmp; rm $(OLDFPC).tmp $(FPC).tmp)
  3475. endif
  3476. else
  3477. DIFFRESULT=Not equal
  3478. endif
  3479. else
  3480. DIFFRESULT=No diff program
  3481. endif
  3482. ifndef DIFFRESULT
  3483. next :
  3484. @echo $(OLDFPC) and $(FPC) are equal
  3485. $(COPY) $(FPC) $(EXENAME)
  3486. else
  3487. next :
  3488. $(MAKE) rtlclean rtl
  3489. $(MAKE) cycleclean compiler
  3490. $(MAKE) echotime
  3491. endif
  3492. $(TEMPNAME1) :
  3493. $(MAKE) 'OLDFPC=' next
  3494. -$(DEL) $(TEMPNAME1)
  3495. $(MOVE) $(EXENAME) $(TEMPNAME1)
  3496. $(TEMPNAME2) : $(TEMPNAME1)
  3497. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME1)' 'OLDFPC=' next
  3498. -$(DEL) $(TEMPNAME2)
  3499. $(MOVE) $(EXENAME) $(TEMPNAME2)
  3500. $(TEMPNAME3) : $(TEMPNAME2)
  3501. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME2)' 'OLDFPC=$(BASEDIR)/$(TEMPNAME1)' next
  3502. -$(DEL) $(TEMPNAME3)
  3503. $(MOVE) $(EXENAME) $(TEMPNAME3)
  3504. cycle:
  3505. $(MAKE) tempclean $(TEMPNAME3)
  3506. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3)' 'OLDFPC=$(BASEDIR)/$(TEMPNAME2)' next
  3507. $(DIFF) $(TEMPNAME3) $(EXENAME)
  3508. $(MAKE) $(addsuffix _all,$(TARGET_DIRS)) 'FPC=$(BASEDIR)/$(EXENAME)'
  3509. $(MAKE) wpocycle
  3510. $(MAKE) echotime
  3511. else
  3512. cycle:
  3513. $(MAKE) OS_TARGET=$(OS_SOURCE) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 rtlclean rtl
  3514. $(MAKE) OS_TARGET=$(OS_SOURCE) EXENAME=$(TEMPNAME) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 cycleclean compiler
  3515. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' OS_TARGET=$(OS_SOURCE) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 rtlclean rtl
  3516. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' OS_TARGET=$(OS_SOURCE) EXENAME=$(PPCROSSNAME) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 cycleclean compiler
  3517. ifndef CROSSINSTALL
  3518. $(MAKE) 'FPC=$(BASEDIR)/$(PPCROSSNAME)' rtlclean rtl
  3519. ifneq ($(OS_TARGET),embedded)
  3520. ifneq ($(OS_TARGET),gba)
  3521. $(MAKE) 'FPC=$(BASEDIR)/$(PPCROSSNAME)' cycleclean compiler
  3522. endif
  3523. endif
  3524. endif
  3525. endif
  3526. else
  3527. cycle: override FPC=
  3528. cycle:
  3529. $(MAKE) OS_TARGET=$(OS_SOURCE) CPU_TARGET=$(CPU_SOURCE) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 rtlclean rtl
  3530. $(MAKE) OS_TARGET=$(OS_SOURCE) CPU_TARGET=$(CPU_SOURCE) EXENAME=$(TEMPNAME) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 cycleclean compiler
  3531. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' OS_TARGET=$(OS_SOURCE) CPU_TARGET=$(CPU_SOURCE) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 rtlclean rtl
  3532. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' OS_TARGET=$(OS_SOURCE) CPU_TARGET=$(CPU_SOURCE) PPC_TARGET=$(CPU_TARGET) EXENAME=$(PPCROSSNAME) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 cycleclean compiler
  3533. ifndef CROSSINSTALL
  3534. $(MAKE) 'FPC=$(BASEDIR)/$(PPCROSSNAME)' 'OPT=$(RTLOPT) $(CROSSOPT)' rtlclean rtl
  3535. ifneq ($(OS_TARGET),embedded)
  3536. ifneq ($(OS_TARGET),gba)
  3537. $(MAKE) 'FPC=$(BASEDIR)/$(PPCROSSNAME)' 'OPT=$(LOCALOPT) $(CROSSOPT)' cycleclean compiler
  3538. endif
  3539. endif
  3540. endif
  3541. endif
  3542. cycledep:
  3543. $(MAKE) cycle USEDEPEND=1
  3544. extcycle:
  3545. $(MAKE) cycle OPT='-n -OG2p3 -glttt -CRriot -dEXTDEBUG'
  3546. cvstest:
  3547. $(MAKE) cycle 'LOCALOPT=-n -Se' 'RTLOPT=-n -Se'
  3548. full: fullcycle
  3549. fullcycle:
  3550. $(MAKE) cycle
  3551. $(MAKE) ppuclean
  3552. $(MAKE) $(filter-out $(PPC_TARGET),$(CYCLETARGETS)) 'FPC=$(BASEDIR)/$(EXENAME)'
  3553. htmldocs:
  3554. $(PASDOC) -p -h -o html$(PATHSEP)$(PPC_TARGET) -d fpc -d gdb -d $(PPC_TARGET) -u $(PPC_TARGET) $(PPC_TARGET)$(PATHSEP)*.pas systems$(PATHSEP)*.pas *.pas
  3555. .PHONY: quickinstall install installsym
  3556. MSGINSTALLDIR=$(INSTALL_BASEDIR)/msg
  3557. override PPEXEFILE:=$(wildcard $(EXENAME))
  3558. ifdef UNIXHier
  3559. PPCCPULOCATION=$(INSTALL_BASEDIR)
  3560. else
  3561. PPCCPULOCATION=$(INSTALL_BINDIR)
  3562. endif
  3563. quickinstall: $(addsuffix _install,$(TARGET_DIRS))
  3564. ifneq ($(INSTALLEXEFILE),)
  3565. ifdef UPXPROG
  3566. -$(UPXPROG) $(INSTALLEXEFILE)
  3567. endif
  3568. $(MKDIR) $(PPCCPULOCATION)
  3569. $(INSTALLEXE) $(INSTALLEXEFILE) $(PPCCPULOCATION)/$(INSTALLEXEFILE)
  3570. endif
  3571. install: quickinstall
  3572. ifndef CROSSINSTALL
  3573. ifdef UNIXHier
  3574. $(MKDIR) $(INSTALL_BASEDIR)
  3575. $(INSTALLEXE) $(COMPILERUTILSDIR)/samplecfg $(INSTALL_BASEDIR)/samplecfg
  3576. endif
  3577. $(MKDIR) $(MSGINSTALLDIR)
  3578. $(INSTALL) $(MSGFILES) $(MSGINSTALLDIR)
  3579. endif
  3580. installsymlink: install
  3581. ifneq ($(PPCCPULOCATION),$(INSTALL_BINDIR))
  3582. $(MKDIR) $(INSTALL_BINDIR)
  3583. ln -sf $(INSTALL_BASEDIR)/$(EXENAME) $(INSTALL_BINDIR)/$(EXENAME)
  3584. endif
  3585. .PHONY: rtl rtlclean rtlinstall
  3586. rtl:
  3587. $(MAKE) -C $(PACKAGEDIR_RTL) 'OPT=$(RTLOPT)' all
  3588. rtlclean:
  3589. $(MAKE) -C $(PACKAGEDIR_RTL) clean
  3590. rtlinstall:
  3591. $(MAKE) -C $(PACKAGEDIR_RTL) install
  3592. PPUDIR=$(COMPILER_UNITTARGETDIR)
  3593. ALLPPUDIR=$(CPU_TARGET)/units/*
  3594. PPULIST=$(wildcard $(PPUDIR)/*.ppu)
  3595. PPULOGLIST=$(subst .ppu,.log-ppu,$(PPULIST))
  3596. RTLPPUDIR=../rtl/units/$(FULL_TARGET)
  3597. RTLPPULIST=$(wildcard $(RTLPPUDIR)/*.ppu)
  3598. RTLPPULOGLIST=$(subst .ppu,.log-ppu,$(RTLPPULIST))
  3599. .PHONY : ppulogs cleanppulogs rtlppulogs cleanrtlppulogs testppudump
  3600. ppulogs : $(PPULOGLIST)
  3601. rtlppulogs : $(RTLPPULOGLIST)
  3602. vpath %.ppu $(PPUDIR) $(RTLPPUDIR) $(ALLPPUDIR)
  3603. vpath %.log-ppu $(PPUDIR) $(RTLPPUDIR) $(ALLPPUDIR)
  3604. %.log-ppu : %.ppu ./utils/ppudump$(EXEEXT)
  3605. .$(PATHSEP)utils$(PATHSEP)ppudump -VA -M $< > $@
  3606. ./utils/ppudump$(EXEEXT):
  3607. $(MAKE) -C $(COMPILERUTILSDIR) ppudump$(EXEEXT)
  3608. ppuinfo :
  3609. echo PPU list is "$(PPULIST)"
  3610. echo PPULOG list is "$(PPULOGLIST)"
  3611. cleanppulogs :
  3612. -$(RMPROG) $(PPULOGLIST)
  3613. cleanrtlppulogs :
  3614. -$(RMPROG) $(RTLPPULOGLIST)
  3615. testppudump :
  3616. $(MAKE) cleanrtlppulogs cleanppulogs ppulogs rtlppulogs
  3617. localmake:=$(strip $(wildcard makefile.loc))
  3618. ifdef localmake
  3619. include ./$(localmake)
  3620. endif