Makefile 87 KB

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