Makefile 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454
  1. #
  2. # Don't edit, this file is generated by FPCMake Version 2.0.0 [2011/08/03]
  3. #
  4. default: all
  5. MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
  6. BSDs = freebsd netbsd openbsd darwin
  7. UNIXs = linux $(BSDs) solaris qnx haiku
  8. LIMIT83fs = go32v2 os2 emx watcom
  9. OSNeedsComspecToRunBatch = go32v2 watcom
  10. FORCE:
  11. .PHONY: FORCE
  12. override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
  13. ifneq ($(findstring darwin,$(OSTYPE)),)
  14. inUnix=1 #darwin
  15. SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
  16. else
  17. ifeq ($(findstring ;,$(PATH)),)
  18. inUnix=1
  19. SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
  20. else
  21. SEARCHPATH:=$(subst ;, ,$(PATH))
  22. endif
  23. endif
  24. SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
  25. PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
  26. ifeq ($(PWD),)
  27. PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
  28. ifeq ($(PWD),)
  29. $(error You need the GNU utils package to use this Makefile)
  30. else
  31. PWD:=$(firstword $(PWD))
  32. SRCEXEEXT=
  33. endif
  34. else
  35. PWD:=$(firstword $(PWD))
  36. SRCEXEEXT=.exe
  37. endif
  38. ifndef inUnix
  39. ifeq ($(OS),Windows_NT)
  40. inWinNT=1
  41. else
  42. ifdef OS2_SHELL
  43. inOS2=1
  44. endif
  45. endif
  46. else
  47. ifneq ($(findstring cygdrive,$(PATH)),)
  48. inCygWin=1
  49. endif
  50. endif
  51. ifdef inUnix
  52. SRCBATCHEXT=.sh
  53. else
  54. ifdef inOS2
  55. SRCBATCHEXT=.cmd
  56. else
  57. SRCBATCHEXT=.bat
  58. endif
  59. endif
  60. ifdef COMSPEC
  61. ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
  62. ifndef RUNBATCH
  63. RUNBATCH=$(COMSPEC) /C
  64. endif
  65. endif
  66. endif
  67. ifdef inUnix
  68. PATHSEP=/
  69. else
  70. PATHSEP:=$(subst /,\,/)
  71. ifdef inCygWin
  72. PATHSEP=/
  73. endif
  74. endif
  75. ifdef PWD
  76. BASEDIR:=$(subst \,/,$(shell $(PWD)))
  77. ifdef inCygWin
  78. ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
  79. BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
  80. BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
  81. BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
  82. endif
  83. endif
  84. else
  85. BASEDIR=.
  86. endif
  87. ifdef inOS2
  88. ifndef ECHO
  89. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  90. ifeq ($(ECHO),)
  91. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  92. ifeq ($(ECHO),)
  93. ECHO=echo
  94. else
  95. ECHO:=$(firstword $(ECHO))
  96. endif
  97. else
  98. ECHO:=$(firstword $(ECHO))
  99. endif
  100. endif
  101. export ECHO
  102. endif
  103. override OS_TARGET_DEFAULT=gba
  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. ifneq ($(words $(FPC_COMPILERINFO)),5)
  159. FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
  160. FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
  161. FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
  162. FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
  163. endif
  164. ifndef CPU_SOURCE
  165. CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
  166. endif
  167. ifndef CPU_TARGET
  168. CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
  169. endif
  170. ifndef OS_SOURCE
  171. OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
  172. endif
  173. ifndef OS_TARGET
  174. OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
  175. endif
  176. FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
  177. FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
  178. ifeq ($(CPU_TARGET),armeb)
  179. ARCH=arm
  180. override FPCOPT+=-Cb
  181. else
  182. ifeq ($(CPU_TARGET),armel)
  183. ARCH=arm
  184. override FPCOPT+=-CaEABI
  185. else
  186. ARCH=$(CPU_TARGET)
  187. endif
  188. endif
  189. ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
  190. TARGETSUFFIX=$(OS_TARGET)
  191. SOURCESUFFIX=$(OS_SOURCE)
  192. else
  193. TARGETSUFFIX=$(FULL_TARGET)
  194. SOURCESUFFIX=$(FULL_SOURCE)
  195. endif
  196. ifneq ($(FULL_TARGET),$(FULL_SOURCE))
  197. CROSSCOMPILE=1
  198. endif
  199. ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
  200. ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),)
  201. $(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
  202. endif
  203. endif
  204. ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
  205. BSDhier=1
  206. endif
  207. ifeq ($(OS_TARGET),linux)
  208. linuxHier=1
  209. endif
  210. export OS_TARGET OS_SOURCE ARCH CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE
  211. ifdef FPCDIR
  212. override FPCDIR:=$(subst \,/,$(FPCDIR))
  213. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  214. override FPCDIR=wrong
  215. endif
  216. else
  217. override FPCDIR=wrong
  218. endif
  219. ifdef DEFAULT_FPCDIR
  220. ifeq ($(FPCDIR),wrong)
  221. override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
  222. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  223. override FPCDIR=wrong
  224. endif
  225. endif
  226. endif
  227. ifeq ($(FPCDIR),wrong)
  228. ifdef inUnix
  229. override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
  230. ifeq ($(wildcard $(FPCDIR)/units),)
  231. override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
  232. endif
  233. else
  234. override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
  235. override FPCDIR:=$(FPCDIR)/..
  236. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  237. override FPCDIR:=$(FPCDIR)/..
  238. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  239. override FPCDIR:=$(BASEDIR)
  240. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  241. override FPCDIR=c:/pp
  242. endif
  243. endif
  244. endif
  245. endif
  246. endif
  247. ifndef CROSSBINDIR
  248. CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
  249. endif
  250. ifneq ($(findstring $(OS_TARGET),darwin iphonesim),)
  251. ifeq ($(OS_SOURCE),darwin)
  252. DARWIN2DARWIN=1
  253. endif
  254. endif
  255. ifndef BINUTILSPREFIX
  256. ifndef CROSSBINDIR
  257. ifdef CROSSCOMPILE
  258. ifndef DARWIN2DARWIN
  259. BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)-
  260. endif
  261. endif
  262. endif
  263. endif
  264. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX))
  265. ifeq ($(UNITSDIR),)
  266. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
  267. endif
  268. PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
  269. ifndef FPCFPMAKE
  270. ifdef CROSSCOMPILE
  271. ifeq ($(strip $(wildcard $(addsuffix /compiler/ppc$(SRCEXEEXT),$(FPCDIR)))),)
  272. FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
  273. ifneq ($(FPCPROG),)
  274. FPCPROG:=$(firstword $(FPCPROG))
  275. FPCFPMAKE:=$(shell $(FPCPROG) -PB)
  276. ifeq ($(strip $(wildcard $(FPCFPMAKE))),)
  277. FPCFPMAKE:=$(firstword $(FPCPROG))
  278. endif
  279. else
  280. override FPCFPMAKE=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
  281. endif
  282. else
  283. FPCFPMAKE=$(strip $(wildcard $(addsuffix /compiler/ppc$(SRCEXEEXT),$(FPCDIR))))
  284. FPMAKE_SKIP_CONFIG=-n
  285. export FPCFPMAKE
  286. export FPMAKE_SKIP_CONFIG
  287. endif
  288. else
  289. FPMAKE_SKIP_CONFIG=-n
  290. FPCFPMAKE=$(FPC)
  291. endif
  292. endif
  293. BUILD = build
  294. INC = inc
  295. AUDIO_FILES = $(foreach dir, $(notdir $(wildcard audio/*.*)), $(CURDIR)/audio/$(dir))
  296. GFX_FILES = $(foreach dir,gfx,$(notdir $(wildcard $(dir)/*.png)))
  297. BIN_FILES = $(foreach dir,data,$(notdir $(wildcard $(dir)/*)))
  298. ifeq ($(FULL_TARGET),i386-linux)
  299. override TARGET_PROGRAMS+=SimpleBGScroll
  300. endif
  301. ifeq ($(FULL_TARGET),i386-go32v2)
  302. override TARGET_PROGRAMS+=SimpleBGScroll
  303. endif
  304. ifeq ($(FULL_TARGET),i386-win32)
  305. override TARGET_PROGRAMS+=SimpleBGScroll
  306. endif
  307. ifeq ($(FULL_TARGET),i386-os2)
  308. override TARGET_PROGRAMS+=SimpleBGScroll
  309. endif
  310. ifeq ($(FULL_TARGET),i386-freebsd)
  311. override TARGET_PROGRAMS+=SimpleBGScroll
  312. endif
  313. ifeq ($(FULL_TARGET),i386-beos)
  314. override TARGET_PROGRAMS+=SimpleBGScroll
  315. endif
  316. ifeq ($(FULL_TARGET),i386-haiku)
  317. override TARGET_PROGRAMS+=SimpleBGScroll
  318. endif
  319. ifeq ($(FULL_TARGET),i386-netbsd)
  320. override TARGET_PROGRAMS+=SimpleBGScroll
  321. endif
  322. ifeq ($(FULL_TARGET),i386-solaris)
  323. override TARGET_PROGRAMS+=SimpleBGScroll
  324. endif
  325. ifeq ($(FULL_TARGET),i386-qnx)
  326. override TARGET_PROGRAMS+=SimpleBGScroll
  327. endif
  328. ifeq ($(FULL_TARGET),i386-netware)
  329. override TARGET_PROGRAMS+=SimpleBGScroll
  330. endif
  331. ifeq ($(FULL_TARGET),i386-openbsd)
  332. override TARGET_PROGRAMS+=SimpleBGScroll
  333. endif
  334. ifeq ($(FULL_TARGET),i386-wdosx)
  335. override TARGET_PROGRAMS+=SimpleBGScroll
  336. endif
  337. ifeq ($(FULL_TARGET),i386-darwin)
  338. override TARGET_PROGRAMS+=SimpleBGScroll
  339. endif
  340. ifeq ($(FULL_TARGET),i386-emx)
  341. override TARGET_PROGRAMS+=SimpleBGScroll
  342. endif
  343. ifeq ($(FULL_TARGET),i386-watcom)
  344. override TARGET_PROGRAMS+=SimpleBGScroll
  345. endif
  346. ifeq ($(FULL_TARGET),i386-netwlibc)
  347. override TARGET_PROGRAMS+=SimpleBGScroll
  348. endif
  349. ifeq ($(FULL_TARGET),i386-wince)
  350. override TARGET_PROGRAMS+=SimpleBGScroll
  351. endif
  352. ifeq ($(FULL_TARGET),i386-embedded)
  353. override TARGET_PROGRAMS+=SimpleBGScroll
  354. endif
  355. ifeq ($(FULL_TARGET),i386-symbian)
  356. override TARGET_PROGRAMS+=SimpleBGScroll
  357. endif
  358. ifeq ($(FULL_TARGET),i386-nativent)
  359. override TARGET_PROGRAMS+=SimpleBGScroll
  360. endif
  361. ifeq ($(FULL_TARGET),i386-iphonesim)
  362. override TARGET_PROGRAMS+=SimpleBGScroll
  363. endif
  364. ifeq ($(FULL_TARGET),m68k-linux)
  365. override TARGET_PROGRAMS+=SimpleBGScroll
  366. endif
  367. ifeq ($(FULL_TARGET),m68k-freebsd)
  368. override TARGET_PROGRAMS+=SimpleBGScroll
  369. endif
  370. ifeq ($(FULL_TARGET),m68k-netbsd)
  371. override TARGET_PROGRAMS+=SimpleBGScroll
  372. endif
  373. ifeq ($(FULL_TARGET),m68k-amiga)
  374. override TARGET_PROGRAMS+=SimpleBGScroll
  375. endif
  376. ifeq ($(FULL_TARGET),m68k-atari)
  377. override TARGET_PROGRAMS+=SimpleBGScroll
  378. endif
  379. ifeq ($(FULL_TARGET),m68k-openbsd)
  380. override TARGET_PROGRAMS+=SimpleBGScroll
  381. endif
  382. ifeq ($(FULL_TARGET),m68k-palmos)
  383. override TARGET_PROGRAMS+=SimpleBGScroll
  384. endif
  385. ifeq ($(FULL_TARGET),m68k-embedded)
  386. override TARGET_PROGRAMS+=SimpleBGScroll
  387. endif
  388. ifeq ($(FULL_TARGET),powerpc-linux)
  389. override TARGET_PROGRAMS+=SimpleBGScroll
  390. endif
  391. ifeq ($(FULL_TARGET),powerpc-netbsd)
  392. override TARGET_PROGRAMS+=SimpleBGScroll
  393. endif
  394. ifeq ($(FULL_TARGET),powerpc-amiga)
  395. override TARGET_PROGRAMS+=SimpleBGScroll
  396. endif
  397. ifeq ($(FULL_TARGET),powerpc-macos)
  398. override TARGET_PROGRAMS+=SimpleBGScroll
  399. endif
  400. ifeq ($(FULL_TARGET),powerpc-darwin)
  401. override TARGET_PROGRAMS+=SimpleBGScroll
  402. endif
  403. ifeq ($(FULL_TARGET),powerpc-morphos)
  404. override TARGET_PROGRAMS+=SimpleBGScroll
  405. endif
  406. ifeq ($(FULL_TARGET),powerpc-embedded)
  407. override TARGET_PROGRAMS+=SimpleBGScroll
  408. endif
  409. ifeq ($(FULL_TARGET),powerpc-wii)
  410. override TARGET_PROGRAMS+=SimpleBGScroll
  411. endif
  412. ifeq ($(FULL_TARGET),sparc-linux)
  413. override TARGET_PROGRAMS+=SimpleBGScroll
  414. endif
  415. ifeq ($(FULL_TARGET),sparc-netbsd)
  416. override TARGET_PROGRAMS+=SimpleBGScroll
  417. endif
  418. ifeq ($(FULL_TARGET),sparc-solaris)
  419. override TARGET_PROGRAMS+=SimpleBGScroll
  420. endif
  421. ifeq ($(FULL_TARGET),sparc-embedded)
  422. override TARGET_PROGRAMS+=SimpleBGScroll
  423. endif
  424. ifeq ($(FULL_TARGET),x86_64-linux)
  425. override TARGET_PROGRAMS+=SimpleBGScroll
  426. endif
  427. ifeq ($(FULL_TARGET),x86_64-freebsd)
  428. override TARGET_PROGRAMS+=SimpleBGScroll
  429. endif
  430. ifeq ($(FULL_TARGET),x86_64-solaris)
  431. override TARGET_PROGRAMS+=SimpleBGScroll
  432. endif
  433. ifeq ($(FULL_TARGET),x86_64-darwin)
  434. override TARGET_PROGRAMS+=SimpleBGScroll
  435. endif
  436. ifeq ($(FULL_TARGET),x86_64-win64)
  437. override TARGET_PROGRAMS+=SimpleBGScroll
  438. endif
  439. ifeq ($(FULL_TARGET),x86_64-embedded)
  440. override TARGET_PROGRAMS+=SimpleBGScroll
  441. endif
  442. ifeq ($(FULL_TARGET),arm-linux)
  443. override TARGET_PROGRAMS+=SimpleBGScroll
  444. endif
  445. ifeq ($(FULL_TARGET),arm-palmos)
  446. override TARGET_PROGRAMS+=SimpleBGScroll
  447. endif
  448. ifeq ($(FULL_TARGET),arm-darwin)
  449. override TARGET_PROGRAMS+=SimpleBGScroll
  450. endif
  451. ifeq ($(FULL_TARGET),arm-wince)
  452. override TARGET_PROGRAMS+=SimpleBGScroll
  453. endif
  454. ifeq ($(FULL_TARGET),arm-gba)
  455. override TARGET_PROGRAMS+=SimpleBGScroll
  456. endif
  457. ifeq ($(FULL_TARGET),arm-nds)
  458. override TARGET_PROGRAMS+=SimpleBGScroll
  459. endif
  460. ifeq ($(FULL_TARGET),arm-embedded)
  461. override TARGET_PROGRAMS+=SimpleBGScroll
  462. endif
  463. ifeq ($(FULL_TARGET),arm-symbian)
  464. override TARGET_PROGRAMS+=SimpleBGScroll
  465. endif
  466. ifeq ($(FULL_TARGET),powerpc64-linux)
  467. override TARGET_PROGRAMS+=SimpleBGScroll
  468. endif
  469. ifeq ($(FULL_TARGET),powerpc64-darwin)
  470. override TARGET_PROGRAMS+=SimpleBGScroll
  471. endif
  472. ifeq ($(FULL_TARGET),powerpc64-embedded)
  473. override TARGET_PROGRAMS+=SimpleBGScroll
  474. endif
  475. ifeq ($(FULL_TARGET),avr-embedded)
  476. override TARGET_PROGRAMS+=SimpleBGScroll
  477. endif
  478. ifeq ($(FULL_TARGET),armeb-linux)
  479. override TARGET_PROGRAMS+=SimpleBGScroll
  480. endif
  481. ifeq ($(FULL_TARGET),armeb-embedded)
  482. override TARGET_PROGRAMS+=SimpleBGScroll
  483. endif
  484. ifeq ($(FULL_TARGET),mipsel-linux)
  485. override TARGET_PROGRAMS+=SimpleBGScroll
  486. endif
  487. ifeq ($(FULL_TARGET),i386-linux)
  488. override CLEAN_UNITS+=*
  489. endif
  490. ifeq ($(FULL_TARGET),i386-go32v2)
  491. override CLEAN_UNITS+=*
  492. endif
  493. ifeq ($(FULL_TARGET),i386-win32)
  494. override CLEAN_UNITS+=*
  495. endif
  496. ifeq ($(FULL_TARGET),i386-os2)
  497. override CLEAN_UNITS+=*
  498. endif
  499. ifeq ($(FULL_TARGET),i386-freebsd)
  500. override CLEAN_UNITS+=*
  501. endif
  502. ifeq ($(FULL_TARGET),i386-beos)
  503. override CLEAN_UNITS+=*
  504. endif
  505. ifeq ($(FULL_TARGET),i386-haiku)
  506. override CLEAN_UNITS+=*
  507. endif
  508. ifeq ($(FULL_TARGET),i386-netbsd)
  509. override CLEAN_UNITS+=*
  510. endif
  511. ifeq ($(FULL_TARGET),i386-solaris)
  512. override CLEAN_UNITS+=*
  513. endif
  514. ifeq ($(FULL_TARGET),i386-qnx)
  515. override CLEAN_UNITS+=*
  516. endif
  517. ifeq ($(FULL_TARGET),i386-netware)
  518. override CLEAN_UNITS+=*
  519. endif
  520. ifeq ($(FULL_TARGET),i386-openbsd)
  521. override CLEAN_UNITS+=*
  522. endif
  523. ifeq ($(FULL_TARGET),i386-wdosx)
  524. override CLEAN_UNITS+=*
  525. endif
  526. ifeq ($(FULL_TARGET),i386-darwin)
  527. override CLEAN_UNITS+=*
  528. endif
  529. ifeq ($(FULL_TARGET),i386-emx)
  530. override CLEAN_UNITS+=*
  531. endif
  532. ifeq ($(FULL_TARGET),i386-watcom)
  533. override CLEAN_UNITS+=*
  534. endif
  535. ifeq ($(FULL_TARGET),i386-netwlibc)
  536. override CLEAN_UNITS+=*
  537. endif
  538. ifeq ($(FULL_TARGET),i386-wince)
  539. override CLEAN_UNITS+=*
  540. endif
  541. ifeq ($(FULL_TARGET),i386-embedded)
  542. override CLEAN_UNITS+=*
  543. endif
  544. ifeq ($(FULL_TARGET),i386-symbian)
  545. override CLEAN_UNITS+=*
  546. endif
  547. ifeq ($(FULL_TARGET),i386-nativent)
  548. override CLEAN_UNITS+=*
  549. endif
  550. ifeq ($(FULL_TARGET),i386-iphonesim)
  551. override CLEAN_UNITS+=*
  552. endif
  553. ifeq ($(FULL_TARGET),m68k-linux)
  554. override CLEAN_UNITS+=*
  555. endif
  556. ifeq ($(FULL_TARGET),m68k-freebsd)
  557. override CLEAN_UNITS+=*
  558. endif
  559. ifeq ($(FULL_TARGET),m68k-netbsd)
  560. override CLEAN_UNITS+=*
  561. endif
  562. ifeq ($(FULL_TARGET),m68k-amiga)
  563. override CLEAN_UNITS+=*
  564. endif
  565. ifeq ($(FULL_TARGET),m68k-atari)
  566. override CLEAN_UNITS+=*
  567. endif
  568. ifeq ($(FULL_TARGET),m68k-openbsd)
  569. override CLEAN_UNITS+=*
  570. endif
  571. ifeq ($(FULL_TARGET),m68k-palmos)
  572. override CLEAN_UNITS+=*
  573. endif
  574. ifeq ($(FULL_TARGET),m68k-embedded)
  575. override CLEAN_UNITS+=*
  576. endif
  577. ifeq ($(FULL_TARGET),powerpc-linux)
  578. override CLEAN_UNITS+=*
  579. endif
  580. ifeq ($(FULL_TARGET),powerpc-netbsd)
  581. override CLEAN_UNITS+=*
  582. endif
  583. ifeq ($(FULL_TARGET),powerpc-amiga)
  584. override CLEAN_UNITS+=*
  585. endif
  586. ifeq ($(FULL_TARGET),powerpc-macos)
  587. override CLEAN_UNITS+=*
  588. endif
  589. ifeq ($(FULL_TARGET),powerpc-darwin)
  590. override CLEAN_UNITS+=*
  591. endif
  592. ifeq ($(FULL_TARGET),powerpc-morphos)
  593. override CLEAN_UNITS+=*
  594. endif
  595. ifeq ($(FULL_TARGET),powerpc-embedded)
  596. override CLEAN_UNITS+=*
  597. endif
  598. ifeq ($(FULL_TARGET),powerpc-wii)
  599. override CLEAN_UNITS+=*
  600. endif
  601. ifeq ($(FULL_TARGET),sparc-linux)
  602. override CLEAN_UNITS+=*
  603. endif
  604. ifeq ($(FULL_TARGET),sparc-netbsd)
  605. override CLEAN_UNITS+=*
  606. endif
  607. ifeq ($(FULL_TARGET),sparc-solaris)
  608. override CLEAN_UNITS+=*
  609. endif
  610. ifeq ($(FULL_TARGET),sparc-embedded)
  611. override CLEAN_UNITS+=*
  612. endif
  613. ifeq ($(FULL_TARGET),x86_64-linux)
  614. override CLEAN_UNITS+=*
  615. endif
  616. ifeq ($(FULL_TARGET),x86_64-freebsd)
  617. override CLEAN_UNITS+=*
  618. endif
  619. ifeq ($(FULL_TARGET),x86_64-solaris)
  620. override CLEAN_UNITS+=*
  621. endif
  622. ifeq ($(FULL_TARGET),x86_64-darwin)
  623. override CLEAN_UNITS+=*
  624. endif
  625. ifeq ($(FULL_TARGET),x86_64-win64)
  626. override CLEAN_UNITS+=*
  627. endif
  628. ifeq ($(FULL_TARGET),x86_64-embedded)
  629. override CLEAN_UNITS+=*
  630. endif
  631. ifeq ($(FULL_TARGET),arm-linux)
  632. override CLEAN_UNITS+=*
  633. endif
  634. ifeq ($(FULL_TARGET),arm-palmos)
  635. override CLEAN_UNITS+=*
  636. endif
  637. ifeq ($(FULL_TARGET),arm-darwin)
  638. override CLEAN_UNITS+=*
  639. endif
  640. ifeq ($(FULL_TARGET),arm-wince)
  641. override CLEAN_UNITS+=*
  642. endif
  643. ifeq ($(FULL_TARGET),arm-gba)
  644. override CLEAN_UNITS+=*
  645. endif
  646. ifeq ($(FULL_TARGET),arm-nds)
  647. override CLEAN_UNITS+=*
  648. endif
  649. ifeq ($(FULL_TARGET),arm-embedded)
  650. override CLEAN_UNITS+=*
  651. endif
  652. ifeq ($(FULL_TARGET),arm-symbian)
  653. override CLEAN_UNITS+=*
  654. endif
  655. ifeq ($(FULL_TARGET),powerpc64-linux)
  656. override CLEAN_UNITS+=*
  657. endif
  658. ifeq ($(FULL_TARGET),powerpc64-darwin)
  659. override CLEAN_UNITS+=*
  660. endif
  661. ifeq ($(FULL_TARGET),powerpc64-embedded)
  662. override CLEAN_UNITS+=*
  663. endif
  664. ifeq ($(FULL_TARGET),avr-embedded)
  665. override CLEAN_UNITS+=*
  666. endif
  667. ifeq ($(FULL_TARGET),armeb-linux)
  668. override CLEAN_UNITS+=*
  669. endif
  670. ifeq ($(FULL_TARGET),armeb-embedded)
  671. override CLEAN_UNITS+=*
  672. endif
  673. ifeq ($(FULL_TARGET),mipsel-linux)
  674. override CLEAN_UNITS+=*
  675. endif
  676. ifeq ($(FULL_TARGET),i386-linux)
  677. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  678. endif
  679. ifeq ($(FULL_TARGET),i386-go32v2)
  680. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  681. endif
  682. ifeq ($(FULL_TARGET),i386-win32)
  683. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  684. endif
  685. ifeq ($(FULL_TARGET),i386-os2)
  686. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  687. endif
  688. ifeq ($(FULL_TARGET),i386-freebsd)
  689. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  690. endif
  691. ifeq ($(FULL_TARGET),i386-beos)
  692. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  693. endif
  694. ifeq ($(FULL_TARGET),i386-haiku)
  695. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  696. endif
  697. ifeq ($(FULL_TARGET),i386-netbsd)
  698. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  699. endif
  700. ifeq ($(FULL_TARGET),i386-solaris)
  701. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  702. endif
  703. ifeq ($(FULL_TARGET),i386-qnx)
  704. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  705. endif
  706. ifeq ($(FULL_TARGET),i386-netware)
  707. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  708. endif
  709. ifeq ($(FULL_TARGET),i386-openbsd)
  710. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  711. endif
  712. ifeq ($(FULL_TARGET),i386-wdosx)
  713. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  714. endif
  715. ifeq ($(FULL_TARGET),i386-darwin)
  716. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  717. endif
  718. ifeq ($(FULL_TARGET),i386-emx)
  719. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  720. endif
  721. ifeq ($(FULL_TARGET),i386-watcom)
  722. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  723. endif
  724. ifeq ($(FULL_TARGET),i386-netwlibc)
  725. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  726. endif
  727. ifeq ($(FULL_TARGET),i386-wince)
  728. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  729. endif
  730. ifeq ($(FULL_TARGET),i386-embedded)
  731. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  732. endif
  733. ifeq ($(FULL_TARGET),i386-symbian)
  734. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  735. endif
  736. ifeq ($(FULL_TARGET),i386-nativent)
  737. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  738. endif
  739. ifeq ($(FULL_TARGET),i386-iphonesim)
  740. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  741. endif
  742. ifeq ($(FULL_TARGET),m68k-linux)
  743. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  744. endif
  745. ifeq ($(FULL_TARGET),m68k-freebsd)
  746. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  747. endif
  748. ifeq ($(FULL_TARGET),m68k-netbsd)
  749. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  750. endif
  751. ifeq ($(FULL_TARGET),m68k-amiga)
  752. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  753. endif
  754. ifeq ($(FULL_TARGET),m68k-atari)
  755. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  756. endif
  757. ifeq ($(FULL_TARGET),m68k-openbsd)
  758. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  759. endif
  760. ifeq ($(FULL_TARGET),m68k-palmos)
  761. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  762. endif
  763. ifeq ($(FULL_TARGET),m68k-embedded)
  764. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  765. endif
  766. ifeq ($(FULL_TARGET),powerpc-linux)
  767. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  768. endif
  769. ifeq ($(FULL_TARGET),powerpc-netbsd)
  770. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  771. endif
  772. ifeq ($(FULL_TARGET),powerpc-amiga)
  773. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  774. endif
  775. ifeq ($(FULL_TARGET),powerpc-macos)
  776. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  777. endif
  778. ifeq ($(FULL_TARGET),powerpc-darwin)
  779. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  780. endif
  781. ifeq ($(FULL_TARGET),powerpc-morphos)
  782. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  783. endif
  784. ifeq ($(FULL_TARGET),powerpc-embedded)
  785. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  786. endif
  787. ifeq ($(FULL_TARGET),powerpc-wii)
  788. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  789. endif
  790. ifeq ($(FULL_TARGET),sparc-linux)
  791. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  792. endif
  793. ifeq ($(FULL_TARGET),sparc-netbsd)
  794. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  795. endif
  796. ifeq ($(FULL_TARGET),sparc-solaris)
  797. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  798. endif
  799. ifeq ($(FULL_TARGET),sparc-embedded)
  800. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  801. endif
  802. ifeq ($(FULL_TARGET),x86_64-linux)
  803. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  804. endif
  805. ifeq ($(FULL_TARGET),x86_64-freebsd)
  806. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  807. endif
  808. ifeq ($(FULL_TARGET),x86_64-solaris)
  809. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  810. endif
  811. ifeq ($(FULL_TARGET),x86_64-darwin)
  812. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  813. endif
  814. ifeq ($(FULL_TARGET),x86_64-win64)
  815. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  816. endif
  817. ifeq ($(FULL_TARGET),x86_64-embedded)
  818. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  819. endif
  820. ifeq ($(FULL_TARGET),arm-linux)
  821. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  822. endif
  823. ifeq ($(FULL_TARGET),arm-palmos)
  824. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  825. endif
  826. ifeq ($(FULL_TARGET),arm-darwin)
  827. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  828. endif
  829. ifeq ($(FULL_TARGET),arm-wince)
  830. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  831. endif
  832. ifeq ($(FULL_TARGET),arm-gba)
  833. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  834. endif
  835. ifeq ($(FULL_TARGET),arm-nds)
  836. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  837. endif
  838. ifeq ($(FULL_TARGET),arm-embedded)
  839. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  840. endif
  841. ifeq ($(FULL_TARGET),arm-symbian)
  842. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  843. endif
  844. ifeq ($(FULL_TARGET),powerpc64-linux)
  845. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  846. endif
  847. ifeq ($(FULL_TARGET),powerpc64-darwin)
  848. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  849. endif
  850. ifeq ($(FULL_TARGET),powerpc64-embedded)
  851. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  852. endif
  853. ifeq ($(FULL_TARGET),avr-embedded)
  854. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  855. endif
  856. ifeq ($(FULL_TARGET),armeb-linux)
  857. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  858. endif
  859. ifeq ($(FULL_TARGET),armeb-embedded)
  860. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  861. endif
  862. ifeq ($(FULL_TARGET),mipsel-linux)
  863. override CLEAN_FILES+=*.elf *.o *.s *.gba *.h *.bin *.map $(BUILD)/* $(INC)/*
  864. endif
  865. override INSTALL_FPCPACKAGE=y
  866. ifdef REQUIRE_UNITSDIR
  867. override UNITSDIR+=$(REQUIRE_UNITSDIR)
  868. endif
  869. ifdef REQUIRE_PACKAGESDIR
  870. override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
  871. endif
  872. ifdef ZIPINSTALL
  873. ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
  874. UNIXHier=1
  875. endif
  876. else
  877. ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
  878. UNIXHier=1
  879. endif
  880. endif
  881. ifndef INSTALL_PREFIX
  882. ifdef PREFIX
  883. INSTALL_PREFIX=$(PREFIX)
  884. endif
  885. endif
  886. ifndef INSTALL_PREFIX
  887. ifdef UNIXHier
  888. INSTALL_PREFIX=/usr/local
  889. else
  890. ifdef INSTALL_FPCPACKAGE
  891. INSTALL_BASEDIR:=/pp
  892. else
  893. INSTALL_BASEDIR:=/$(PACKAGE_NAME)
  894. endif
  895. endif
  896. endif
  897. export INSTALL_PREFIX
  898. ifdef INSTALL_FPCSUBDIR
  899. export INSTALL_FPCSUBDIR
  900. endif
  901. ifndef DIST_DESTDIR
  902. DIST_DESTDIR:=$(BASEDIR)
  903. endif
  904. export DIST_DESTDIR
  905. ifndef COMPILER_UNITTARGETDIR
  906. ifdef PACKAGEDIR_MAIN
  907. COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX)
  908. else
  909. COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX)
  910. endif
  911. endif
  912. ifndef COMPILER_TARGETDIR
  913. COMPILER_TARGETDIR=.
  914. endif
  915. ifndef INSTALL_BASEDIR
  916. ifdef UNIXHier
  917. ifdef INSTALL_FPCPACKAGE
  918. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
  919. else
  920. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
  921. endif
  922. else
  923. INSTALL_BASEDIR:=$(INSTALL_PREFIX)
  924. endif
  925. endif
  926. ifndef INSTALL_BINDIR
  927. ifdef UNIXHier
  928. INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
  929. else
  930. INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
  931. ifdef INSTALL_FPCPACKAGE
  932. ifdef CROSSCOMPILE
  933. ifdef CROSSINSTALL
  934. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX)
  935. else
  936. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
  937. endif
  938. else
  939. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
  940. endif
  941. endif
  942. endif
  943. endif
  944. ifndef INSTALL_UNITDIR
  945. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX)
  946. ifdef INSTALL_FPCPACKAGE
  947. ifdef PACKAGE_NAME
  948. INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
  949. endif
  950. endif
  951. endif
  952. ifndef INSTALL_LIBDIR
  953. ifdef UNIXHier
  954. INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
  955. else
  956. INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
  957. endif
  958. endif
  959. ifndef INSTALL_SOURCEDIR
  960. ifdef UNIXHier
  961. ifdef BSDhier
  962. SRCPREFIXDIR=share/src
  963. else
  964. ifdef linuxHier
  965. SRCPREFIXDIR=share/src
  966. else
  967. SRCPREFIXDIR=src
  968. endif
  969. endif
  970. ifdef INSTALL_FPCPACKAGE
  971. ifdef INSTALL_FPCSUBDIR
  972. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  973. else
  974. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  975. endif
  976. else
  977. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  978. endif
  979. else
  980. ifdef INSTALL_FPCPACKAGE
  981. ifdef INSTALL_FPCSUBDIR
  982. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  983. else
  984. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
  985. endif
  986. else
  987. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
  988. endif
  989. endif
  990. endif
  991. ifndef INSTALL_DOCDIR
  992. ifdef UNIXHier
  993. ifdef BSDhier
  994. DOCPREFIXDIR=share/doc
  995. else
  996. ifdef linuxHier
  997. DOCPREFIXDIR=share/doc
  998. else
  999. DOCPREFIXDIR=doc
  1000. endif
  1001. endif
  1002. ifdef INSTALL_FPCPACKAGE
  1003. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  1004. else
  1005. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  1006. endif
  1007. else
  1008. ifdef INSTALL_FPCPACKAGE
  1009. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
  1010. else
  1011. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
  1012. endif
  1013. endif
  1014. endif
  1015. ifndef INSTALL_EXAMPLEDIR
  1016. ifdef UNIXHier
  1017. ifdef INSTALL_FPCPACKAGE
  1018. ifdef BSDhier
  1019. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  1020. else
  1021. ifdef linuxHier
  1022. INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples
  1023. else
  1024. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
  1025. endif
  1026. endif
  1027. else
  1028. ifdef BSDhier
  1029. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  1030. else
  1031. ifdef linuxHier
  1032. INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  1033. else
  1034. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  1035. endif
  1036. endif
  1037. endif
  1038. else
  1039. ifdef INSTALL_FPCPACKAGE
  1040. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
  1041. else
  1042. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
  1043. endif
  1044. endif
  1045. endif
  1046. ifndef INSTALL_DATADIR
  1047. INSTALL_DATADIR=$(INSTALL_BASEDIR)
  1048. endif
  1049. ifndef INSTALL_SHAREDDIR
  1050. INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
  1051. endif
  1052. ifdef CROSSCOMPILE
  1053. ifndef CROSSBINDIR
  1054. CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
  1055. ifeq ($(CROSSBINDIR),)
  1056. CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE))
  1057. endif
  1058. endif
  1059. else
  1060. CROSSBINDIR=
  1061. endif
  1062. BATCHEXT=.bat
  1063. LOADEREXT=.as
  1064. EXEEXT=.exe
  1065. PPLEXT=.ppl
  1066. PPUEXT=.ppu
  1067. OEXT=.o
  1068. ASMEXT=.s
  1069. SMARTEXT=.sl
  1070. STATICLIBEXT=.a
  1071. SHAREDLIBEXT=.so
  1072. SHAREDLIBPREFIX=libfp
  1073. STATICLIBPREFIX=libp
  1074. IMPORTLIBPREFIX=libimp
  1075. RSTEXT=.rst
  1076. ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
  1077. ifeq ($(OS_TARGET),go32v1)
  1078. STATICLIBPREFIX=
  1079. SHORTSUFFIX=v1
  1080. endif
  1081. ifeq ($(OS_TARGET),go32v2)
  1082. STATICLIBPREFIX=
  1083. SHORTSUFFIX=dos
  1084. IMPORTLIBPREFIX=
  1085. endif
  1086. ifeq ($(OS_TARGET),watcom)
  1087. STATICLIBPREFIX=
  1088. OEXT=.obj
  1089. ASMEXT=.asm
  1090. SHAREDLIBEXT=.dll
  1091. SHORTSUFFIX=wat
  1092. IMPORTLIBPREFIX=
  1093. endif
  1094. ifeq ($(OS_TARGET),linux)
  1095. BATCHEXT=.sh
  1096. EXEEXT=
  1097. HASSHAREDLIB=1
  1098. SHORTSUFFIX=lnx
  1099. endif
  1100. ifeq ($(OS_TARGET),freebsd)
  1101. BATCHEXT=.sh
  1102. EXEEXT=
  1103. HASSHAREDLIB=1
  1104. SHORTSUFFIX=fbs
  1105. endif
  1106. ifeq ($(OS_TARGET),netbsd)
  1107. BATCHEXT=.sh
  1108. EXEEXT=
  1109. HASSHAREDLIB=1
  1110. SHORTSUFFIX=nbs
  1111. endif
  1112. ifeq ($(OS_TARGET),openbsd)
  1113. BATCHEXT=.sh
  1114. EXEEXT=
  1115. HASSHAREDLIB=1
  1116. SHORTSUFFIX=obs
  1117. endif
  1118. ifeq ($(OS_TARGET),win32)
  1119. SHAREDLIBEXT=.dll
  1120. SHORTSUFFIX=w32
  1121. endif
  1122. ifeq ($(OS_TARGET),os2)
  1123. BATCHEXT=.cmd
  1124. AOUTEXT=.out
  1125. STATICLIBPREFIX=
  1126. SHAREDLIBEXT=.dll
  1127. SHORTSUFFIX=os2
  1128. ECHO=echo
  1129. IMPORTLIBPREFIX=
  1130. endif
  1131. ifeq ($(OS_TARGET),emx)
  1132. BATCHEXT=.cmd
  1133. AOUTEXT=.out
  1134. STATICLIBPREFIX=
  1135. SHAREDLIBEXT=.dll
  1136. SHORTSUFFIX=emx
  1137. ECHO=echo
  1138. IMPORTLIBPREFIX=
  1139. endif
  1140. ifeq ($(OS_TARGET),amiga)
  1141. EXEEXT=
  1142. SHAREDLIBEXT=.library
  1143. SHORTSUFFIX=amg
  1144. endif
  1145. ifeq ($(OS_TARGET),morphos)
  1146. EXEEXT=
  1147. SHAREDLIBEXT=.library
  1148. SHORTSUFFIX=mos
  1149. endif
  1150. ifeq ($(OS_TARGET),atari)
  1151. EXEEXT=.ttp
  1152. SHORTSUFFIX=ata
  1153. endif
  1154. ifeq ($(OS_TARGET),beos)
  1155. BATCHEXT=.sh
  1156. EXEEXT=
  1157. SHORTSUFFIX=be
  1158. endif
  1159. ifeq ($(OS_TARGET),haiku)
  1160. BATCHEXT=.sh
  1161. EXEEXT=
  1162. SHORTSUFFIX=hai
  1163. endif
  1164. ifeq ($(OS_TARGET),solaris)
  1165. BATCHEXT=.sh
  1166. EXEEXT=
  1167. SHORTSUFFIX=sun
  1168. endif
  1169. ifeq ($(OS_TARGET),qnx)
  1170. BATCHEXT=.sh
  1171. EXEEXT=
  1172. SHORTSUFFIX=qnx
  1173. endif
  1174. ifeq ($(OS_TARGET),netware)
  1175. EXEEXT=.nlm
  1176. STATICLIBPREFIX=
  1177. SHORTSUFFIX=nw
  1178. IMPORTLIBPREFIX=imp
  1179. endif
  1180. ifeq ($(OS_TARGET),netwlibc)
  1181. EXEEXT=.nlm
  1182. STATICLIBPREFIX=
  1183. SHORTSUFFIX=nwl
  1184. IMPORTLIBPREFIX=imp
  1185. endif
  1186. ifeq ($(OS_TARGET),macos)
  1187. BATCHEXT=
  1188. EXEEXT=
  1189. DEBUGSYMEXT=.xcoff
  1190. SHORTSUFFIX=mac
  1191. IMPORTLIBPREFIX=imp
  1192. endif
  1193. ifneq ($(findstring $(OS_TARGET),darwin iphonesim),)
  1194. BATCHEXT=.sh
  1195. EXEEXT=
  1196. HASSHAREDLIB=1
  1197. SHORTSUFFIX=dwn
  1198. endif
  1199. ifeq ($(OS_TARGET),gba)
  1200. EXEEXT=.gba
  1201. SHAREDLIBEXT=.so
  1202. SHORTSUFFIX=gba
  1203. endif
  1204. ifeq ($(OS_TARGET),symbian)
  1205. SHAREDLIBEXT=.dll
  1206. SHORTSUFFIX=symbian
  1207. endif
  1208. ifeq ($(OS_TARGET),NativeNT)
  1209. SHAREDLIBEXT=.dll
  1210. SHORTSUFFIX=nativent
  1211. endif
  1212. ifeq ($(OS_TARGET),wii)
  1213. EXEEXT=.dol
  1214. SHAREDLIBEXT=.so
  1215. SHORTSUFFIX=wii
  1216. endif
  1217. else
  1218. ifeq ($(OS_TARGET),go32v1)
  1219. PPUEXT=.pp1
  1220. OEXT=.o1
  1221. ASMEXT=.s1
  1222. SMARTEXT=.sl1
  1223. STATICLIBEXT=.a1
  1224. SHAREDLIBEXT=.so1
  1225. STATICLIBPREFIX=
  1226. SHORTSUFFIX=v1
  1227. IMPORTLIBPREFIX=
  1228. endif
  1229. ifeq ($(OS_TARGET),go32v2)
  1230. STATICLIBPREFIX=
  1231. SHORTSUFFIX=dos
  1232. IMPORTLIBPREFIX=
  1233. endif
  1234. ifeq ($(OS_TARGET),watcom)
  1235. STATICLIBPREFIX=
  1236. SHORTSUFFIX=wat
  1237. IMPORTLIBPREFIX=
  1238. endif
  1239. ifeq ($(OS_TARGET),linux)
  1240. BATCHEXT=.sh
  1241. EXEEXT=
  1242. HASSHAREDLIB=1
  1243. SHORTSUFFIX=lnx
  1244. endif
  1245. ifeq ($(OS_TARGET),freebsd)
  1246. BATCHEXT=.sh
  1247. EXEEXT=
  1248. HASSHAREDLIB=1
  1249. SHORTSUFFIX=fbs
  1250. endif
  1251. ifeq ($(OS_TARGET),netbsd)
  1252. BATCHEXT=.sh
  1253. EXEEXT=
  1254. HASSHAREDLIB=1
  1255. SHORTSUFFIX=nbs
  1256. endif
  1257. ifeq ($(OS_TARGET),openbsd)
  1258. BATCHEXT=.sh
  1259. EXEEXT=
  1260. HASSHAREDLIB=1
  1261. SHORTSUFFIX=obs
  1262. endif
  1263. ifeq ($(OS_TARGET),win32)
  1264. PPUEXT=.ppw
  1265. OEXT=.ow
  1266. ASMEXT=.sw
  1267. SMARTEXT=.slw
  1268. STATICLIBEXT=.aw
  1269. SHAREDLIBEXT=.dll
  1270. SHORTSUFFIX=w32
  1271. endif
  1272. ifeq ($(OS_TARGET),os2)
  1273. BATCHEXT=.cmd
  1274. PPUEXT=.ppo
  1275. ASMEXT=.so2
  1276. OEXT=.oo2
  1277. AOUTEXT=.out
  1278. SMARTEXT=.sl2
  1279. STATICLIBPREFIX=
  1280. STATICLIBEXT=.ao2
  1281. SHAREDLIBEXT=.dll
  1282. SHORTSUFFIX=os2
  1283. ECHO=echo
  1284. IMPORTLIBPREFIX=
  1285. endif
  1286. ifeq ($(OS_TARGET),amiga)
  1287. EXEEXT=
  1288. PPUEXT=.ppu
  1289. ASMEXT=.s
  1290. OEXT=.o
  1291. SMARTEXT=.sl
  1292. STATICLIBEXT=.a
  1293. SHAREDLIBEXT=.library
  1294. SHORTSUFFIX=amg
  1295. endif
  1296. ifeq ($(OS_TARGET),atari)
  1297. PPUEXT=.ppu
  1298. ASMEXT=.s
  1299. OEXT=.o
  1300. SMARTEXT=.sl
  1301. STATICLIBEXT=.a
  1302. EXEEXT=.ttp
  1303. SHORTSUFFIX=ata
  1304. endif
  1305. ifeq ($(OS_TARGET),beos)
  1306. BATCHEXT=.sh
  1307. PPUEXT=.ppu
  1308. ASMEXT=.s
  1309. OEXT=.o
  1310. SMARTEXT=.sl
  1311. STATICLIBEXT=.a
  1312. EXEEXT=
  1313. SHORTSUFFIX=be
  1314. endif
  1315. ifeq ($(OS_TARGET),solaris)
  1316. BATCHEXT=.sh
  1317. PPUEXT=.ppu
  1318. ASMEXT=.s
  1319. OEXT=.o
  1320. SMARTEXT=.sl
  1321. STATICLIBEXT=.a
  1322. EXEEXT=
  1323. SHORTSUFFIX=sun
  1324. endif
  1325. ifeq ($(OS_TARGET),qnx)
  1326. BATCHEXT=.sh
  1327. PPUEXT=.ppu
  1328. ASMEXT=.s
  1329. OEXT=.o
  1330. SMARTEXT=.sl
  1331. STATICLIBEXT=.a
  1332. EXEEXT=
  1333. SHORTSUFFIX=qnx
  1334. endif
  1335. ifeq ($(OS_TARGET),netware)
  1336. STATICLIBPREFIX=
  1337. PPUEXT=.ppu
  1338. OEXT=.o
  1339. ASMEXT=.s
  1340. SMARTEXT=.sl
  1341. STATICLIBEXT=.a
  1342. SHAREDLIBEXT=.nlm
  1343. EXEEXT=.nlm
  1344. SHORTSUFFIX=nw
  1345. IMPORTLIBPREFIX=imp
  1346. endif
  1347. ifeq ($(OS_TARGET),netwlibc)
  1348. STATICLIBPREFIX=
  1349. PPUEXT=.ppu
  1350. OEXT=.o
  1351. ASMEXT=.s
  1352. SMARTEXT=.sl
  1353. STATICLIBEXT=.a
  1354. SHAREDLIBEXT=.nlm
  1355. EXEEXT=.nlm
  1356. SHORTSUFFIX=nwl
  1357. IMPORTLIBPREFIX=imp
  1358. endif
  1359. ifeq ($(OS_TARGET),macos)
  1360. BATCHEXT=
  1361. PPUEXT=.ppu
  1362. ASMEXT=.s
  1363. OEXT=.o
  1364. SMARTEXT=.sl
  1365. STATICLIBEXT=.a
  1366. EXEEXT=
  1367. DEBUGSYMEXT=.xcoff
  1368. SHORTSUFFIX=mac
  1369. IMPORTLIBPREFIX=imp
  1370. endif
  1371. endif
  1372. ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
  1373. FPCMADE=fpcmade.$(SHORTSUFFIX)
  1374. ZIPSUFFIX=$(SHORTSUFFIX)
  1375. ZIPCROSSPREFIX=
  1376. ZIPSOURCESUFFIX=src
  1377. ZIPEXAMPLESUFFIX=exm
  1378. else
  1379. FPCMADE=fpcmade.$(TARGETSUFFIX)
  1380. ZIPSOURCESUFFIX=.source
  1381. ZIPEXAMPLESUFFIX=.examples
  1382. ifdef CROSSCOMPILE
  1383. ZIPSUFFIX=.$(SOURCESUFFIX)
  1384. ZIPCROSSPREFIX=$(TARGETSUFFIX)-
  1385. else
  1386. ZIPSUFFIX=.$(TARGETSUFFIX)
  1387. ZIPCROSSPREFIX=
  1388. endif
  1389. endif
  1390. ifndef ECHO
  1391. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  1392. ifeq ($(ECHO),)
  1393. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  1394. ifeq ($(ECHO),)
  1395. ECHO= __missing_command_ECHO
  1396. else
  1397. ECHO:=$(firstword $(ECHO))
  1398. endif
  1399. else
  1400. ECHO:=$(firstword $(ECHO))
  1401. endif
  1402. endif
  1403. export ECHO
  1404. ifndef DATE
  1405. DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
  1406. ifeq ($(DATE),)
  1407. DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
  1408. ifeq ($(DATE),)
  1409. DATE= __missing_command_DATE
  1410. else
  1411. DATE:=$(firstword $(DATE))
  1412. endif
  1413. else
  1414. DATE:=$(firstword $(DATE))
  1415. endif
  1416. endif
  1417. export DATE
  1418. ifndef GINSTALL
  1419. GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
  1420. ifeq ($(GINSTALL),)
  1421. GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
  1422. ifeq ($(GINSTALL),)
  1423. GINSTALL= __missing_command_GINSTALL
  1424. else
  1425. GINSTALL:=$(firstword $(GINSTALL))
  1426. endif
  1427. else
  1428. GINSTALL:=$(firstword $(GINSTALL))
  1429. endif
  1430. endif
  1431. export GINSTALL
  1432. ifndef CPPROG
  1433. CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
  1434. ifeq ($(CPPROG),)
  1435. CPPROG= __missing_command_CPPROG
  1436. else
  1437. CPPROG:=$(firstword $(CPPROG))
  1438. endif
  1439. endif
  1440. export CPPROG
  1441. ifndef RMPROG
  1442. RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
  1443. ifeq ($(RMPROG),)
  1444. RMPROG= __missing_command_RMPROG
  1445. else
  1446. RMPROG:=$(firstword $(RMPROG))
  1447. endif
  1448. endif
  1449. export RMPROG
  1450. ifndef MVPROG
  1451. MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
  1452. ifeq ($(MVPROG),)
  1453. MVPROG= __missing_command_MVPROG
  1454. else
  1455. MVPROG:=$(firstword $(MVPROG))
  1456. endif
  1457. endif
  1458. export MVPROG
  1459. ifndef MKDIRPROG
  1460. MKDIRPROG:=$(strip $(wildcard $(addsuffix /gmkdir$(SRCEXEEXT),$(SEARCHPATH))))
  1461. ifeq ($(MKDIRPROG),)
  1462. MKDIRPROG:=$(strip $(wildcard $(addsuffix /mkdir$(SRCEXEEXT),$(SEARCHPATH))))
  1463. ifeq ($(MKDIRPROG),)
  1464. MKDIRPROG= __missing_command_MKDIRPROG
  1465. else
  1466. MKDIRPROG:=$(firstword $(MKDIRPROG))
  1467. endif
  1468. else
  1469. MKDIRPROG:=$(firstword $(MKDIRPROG))
  1470. endif
  1471. endif
  1472. export MKDIRPROG
  1473. ifndef ECHOREDIR
  1474. ifndef inUnix
  1475. ECHOREDIR=echo
  1476. else
  1477. ECHOREDIR=$(ECHO)
  1478. endif
  1479. endif
  1480. ifndef COPY
  1481. COPY:=$(CPPROG) -fp
  1482. endif
  1483. ifndef COPYTREE
  1484. COPYTREE:=$(CPPROG) -Rfp
  1485. endif
  1486. ifndef MKDIRTREE
  1487. MKDIRTREE:=$(MKDIRPROG) -p
  1488. endif
  1489. ifndef MOVE
  1490. MOVE:=$(MVPROG) -f
  1491. endif
  1492. ifndef DEL
  1493. DEL:=$(RMPROG) -f
  1494. endif
  1495. ifndef DELTREE
  1496. DELTREE:=$(RMPROG) -rf
  1497. endif
  1498. ifndef INSTALL
  1499. ifdef inUnix
  1500. INSTALL:=$(GINSTALL) -c -m 644
  1501. else
  1502. INSTALL:=$(COPY)
  1503. endif
  1504. endif
  1505. ifndef INSTALLEXE
  1506. ifdef inUnix
  1507. INSTALLEXE:=$(GINSTALL) -c -m 755
  1508. else
  1509. INSTALLEXE:=$(COPY)
  1510. endif
  1511. endif
  1512. ifndef MKDIR
  1513. MKDIR:=$(GINSTALL) -m 755 -d
  1514. endif
  1515. export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
  1516. ifndef PPUMOVE
  1517. PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
  1518. ifeq ($(PPUMOVE),)
  1519. PPUMOVE= __missing_command_PPUMOVE
  1520. else
  1521. PPUMOVE:=$(firstword $(PPUMOVE))
  1522. endif
  1523. endif
  1524. export PPUMOVE
  1525. ifndef FPCMAKE
  1526. FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
  1527. ifeq ($(FPCMAKE),)
  1528. FPCMAKE= __missing_command_FPCMAKE
  1529. else
  1530. FPCMAKE:=$(firstword $(FPCMAKE))
  1531. endif
  1532. endif
  1533. export FPCMAKE
  1534. ifndef ZIPPROG
  1535. ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
  1536. ifeq ($(ZIPPROG),)
  1537. ZIPPROG= __missing_command_ZIPPROG
  1538. else
  1539. ZIPPROG:=$(firstword $(ZIPPROG))
  1540. endif
  1541. endif
  1542. export ZIPPROG
  1543. ifndef TARPROG
  1544. TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
  1545. ifeq ($(TARPROG),)
  1546. TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
  1547. ifeq ($(TARPROG),)
  1548. TARPROG= __missing_command_TARPROG
  1549. else
  1550. TARPROG:=$(firstword $(TARPROG))
  1551. endif
  1552. else
  1553. TARPROG:=$(firstword $(TARPROG))
  1554. endif
  1555. endif
  1556. export TARPROG
  1557. ASNAME=$(BINUTILSPREFIX)as
  1558. LDNAME=$(BINUTILSPREFIX)ld
  1559. ARNAME=$(BINUTILSPREFIX)ar
  1560. RCNAME=$(BINUTILSPREFIX)rc
  1561. ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
  1562. ifeq ($(OS_TARGET),win32)
  1563. ifeq ($(CROSSBINDIR),)
  1564. ASNAME=asw
  1565. LDNAME=ldw
  1566. ARNAME=arw
  1567. endif
  1568. endif
  1569. endif
  1570. ifndef ASPROG
  1571. ifdef CROSSBINDIR
  1572. ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
  1573. else
  1574. ASPROG=$(ASNAME)
  1575. endif
  1576. endif
  1577. ifndef LDPROG
  1578. ifdef CROSSBINDIR
  1579. LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
  1580. else
  1581. LDPROG=$(LDNAME)
  1582. endif
  1583. endif
  1584. ifndef RCPROG
  1585. ifdef CROSSBINDIR
  1586. RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
  1587. else
  1588. RCPROG=$(RCNAME)
  1589. endif
  1590. endif
  1591. ifndef ARPROG
  1592. ifdef CROSSBINDIR
  1593. ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
  1594. else
  1595. ARPROG=$(ARNAME)
  1596. endif
  1597. endif
  1598. AS=$(ASPROG)
  1599. LD=$(LDPROG)
  1600. RC=$(RCPROG)
  1601. AR=$(ARPROG)
  1602. PPAS=ppas$(SRCBATCHEXT)
  1603. ifdef inUnix
  1604. LDCONFIG=ldconfig
  1605. else
  1606. LDCONFIG=
  1607. endif
  1608. ifdef DATE
  1609. DATESTR:=$(shell $(DATE) +%Y%m%d)
  1610. else
  1611. DATESTR=
  1612. endif
  1613. ifndef UPXPROG
  1614. ifeq ($(OS_TARGET),go32v2)
  1615. UPXPROG:=1
  1616. endif
  1617. ifeq ($(OS_TARGET),win32)
  1618. UPXPROG:=1
  1619. endif
  1620. ifdef UPXPROG
  1621. UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
  1622. ifeq ($(UPXPROG),)
  1623. UPXPROG=
  1624. else
  1625. UPXPROG:=$(firstword $(UPXPROG))
  1626. endif
  1627. else
  1628. UPXPROG=
  1629. endif
  1630. endif
  1631. export UPXPROG
  1632. ZIPOPT=-9
  1633. ZIPEXT=.zip
  1634. ifeq ($(USETAR),bz2)
  1635. TAROPT=vj
  1636. TAREXT=.tar.bz2
  1637. else
  1638. TAROPT=vz
  1639. TAREXT=.tar.gz
  1640. endif
  1641. override REQUIRE_PACKAGES=libgbafpc
  1642. ifeq ($(FULL_TARGET),i386-linux)
  1643. REQUIRE_PACKAGES_LIBGBAFPC=1
  1644. endif
  1645. ifeq ($(FULL_TARGET),i386-go32v2)
  1646. REQUIRE_PACKAGES_LIBGBAFPC=1
  1647. endif
  1648. ifeq ($(FULL_TARGET),i386-win32)
  1649. REQUIRE_PACKAGES_LIBGBAFPC=1
  1650. endif
  1651. ifeq ($(FULL_TARGET),i386-os2)
  1652. REQUIRE_PACKAGES_LIBGBAFPC=1
  1653. endif
  1654. ifeq ($(FULL_TARGET),i386-freebsd)
  1655. REQUIRE_PACKAGES_LIBGBAFPC=1
  1656. endif
  1657. ifeq ($(FULL_TARGET),i386-beos)
  1658. REQUIRE_PACKAGES_LIBGBAFPC=1
  1659. endif
  1660. ifeq ($(FULL_TARGET),i386-haiku)
  1661. REQUIRE_PACKAGES_LIBGBAFPC=1
  1662. endif
  1663. ifeq ($(FULL_TARGET),i386-netbsd)
  1664. REQUIRE_PACKAGES_LIBGBAFPC=1
  1665. endif
  1666. ifeq ($(FULL_TARGET),i386-solaris)
  1667. REQUIRE_PACKAGES_LIBGBAFPC=1
  1668. endif
  1669. ifeq ($(FULL_TARGET),i386-qnx)
  1670. REQUIRE_PACKAGES_LIBGBAFPC=1
  1671. endif
  1672. ifeq ($(FULL_TARGET),i386-netware)
  1673. REQUIRE_PACKAGES_LIBGBAFPC=1
  1674. endif
  1675. ifeq ($(FULL_TARGET),i386-openbsd)
  1676. REQUIRE_PACKAGES_LIBGBAFPC=1
  1677. endif
  1678. ifeq ($(FULL_TARGET),i386-wdosx)
  1679. REQUIRE_PACKAGES_LIBGBAFPC=1
  1680. endif
  1681. ifeq ($(FULL_TARGET),i386-darwin)
  1682. REQUIRE_PACKAGES_LIBGBAFPC=1
  1683. endif
  1684. ifeq ($(FULL_TARGET),i386-emx)
  1685. REQUIRE_PACKAGES_LIBGBAFPC=1
  1686. endif
  1687. ifeq ($(FULL_TARGET),i386-watcom)
  1688. REQUIRE_PACKAGES_LIBGBAFPC=1
  1689. endif
  1690. ifeq ($(FULL_TARGET),i386-netwlibc)
  1691. REQUIRE_PACKAGES_LIBGBAFPC=1
  1692. endif
  1693. ifeq ($(FULL_TARGET),i386-wince)
  1694. REQUIRE_PACKAGES_LIBGBAFPC=1
  1695. endif
  1696. ifeq ($(FULL_TARGET),i386-embedded)
  1697. REQUIRE_PACKAGES_LIBGBAFPC=1
  1698. endif
  1699. ifeq ($(FULL_TARGET),i386-symbian)
  1700. REQUIRE_PACKAGES_LIBGBAFPC=1
  1701. endif
  1702. ifeq ($(FULL_TARGET),i386-nativent)
  1703. REQUIRE_PACKAGES_LIBGBAFPC=1
  1704. endif
  1705. ifeq ($(FULL_TARGET),i386-iphonesim)
  1706. REQUIRE_PACKAGES_LIBGBAFPC=1
  1707. endif
  1708. ifeq ($(FULL_TARGET),m68k-linux)
  1709. REQUIRE_PACKAGES_LIBGBAFPC=1
  1710. endif
  1711. ifeq ($(FULL_TARGET),m68k-freebsd)
  1712. REQUIRE_PACKAGES_LIBGBAFPC=1
  1713. endif
  1714. ifeq ($(FULL_TARGET),m68k-netbsd)
  1715. REQUIRE_PACKAGES_LIBGBAFPC=1
  1716. endif
  1717. ifeq ($(FULL_TARGET),m68k-amiga)
  1718. REQUIRE_PACKAGES_LIBGBAFPC=1
  1719. endif
  1720. ifeq ($(FULL_TARGET),m68k-atari)
  1721. REQUIRE_PACKAGES_LIBGBAFPC=1
  1722. endif
  1723. ifeq ($(FULL_TARGET),m68k-openbsd)
  1724. REQUIRE_PACKAGES_LIBGBAFPC=1
  1725. endif
  1726. ifeq ($(FULL_TARGET),m68k-palmos)
  1727. REQUIRE_PACKAGES_LIBGBAFPC=1
  1728. endif
  1729. ifeq ($(FULL_TARGET),m68k-embedded)
  1730. REQUIRE_PACKAGES_LIBGBAFPC=1
  1731. endif
  1732. ifeq ($(FULL_TARGET),powerpc-linux)
  1733. REQUIRE_PACKAGES_LIBGBAFPC=1
  1734. endif
  1735. ifeq ($(FULL_TARGET),powerpc-netbsd)
  1736. REQUIRE_PACKAGES_LIBGBAFPC=1
  1737. endif
  1738. ifeq ($(FULL_TARGET),powerpc-amiga)
  1739. REQUIRE_PACKAGES_LIBGBAFPC=1
  1740. endif
  1741. ifeq ($(FULL_TARGET),powerpc-macos)
  1742. REQUIRE_PACKAGES_LIBGBAFPC=1
  1743. endif
  1744. ifeq ($(FULL_TARGET),powerpc-darwin)
  1745. REQUIRE_PACKAGES_LIBGBAFPC=1
  1746. endif
  1747. ifeq ($(FULL_TARGET),powerpc-morphos)
  1748. REQUIRE_PACKAGES_LIBGBAFPC=1
  1749. endif
  1750. ifeq ($(FULL_TARGET),powerpc-embedded)
  1751. REQUIRE_PACKAGES_LIBGBAFPC=1
  1752. endif
  1753. ifeq ($(FULL_TARGET),powerpc-wii)
  1754. REQUIRE_PACKAGES_LIBGBAFPC=1
  1755. endif
  1756. ifeq ($(FULL_TARGET),sparc-linux)
  1757. REQUIRE_PACKAGES_LIBGBAFPC=1
  1758. endif
  1759. ifeq ($(FULL_TARGET),sparc-netbsd)
  1760. REQUIRE_PACKAGES_LIBGBAFPC=1
  1761. endif
  1762. ifeq ($(FULL_TARGET),sparc-solaris)
  1763. REQUIRE_PACKAGES_LIBGBAFPC=1
  1764. endif
  1765. ifeq ($(FULL_TARGET),sparc-embedded)
  1766. REQUIRE_PACKAGES_LIBGBAFPC=1
  1767. endif
  1768. ifeq ($(FULL_TARGET),x86_64-linux)
  1769. REQUIRE_PACKAGES_LIBGBAFPC=1
  1770. endif
  1771. ifeq ($(FULL_TARGET),x86_64-freebsd)
  1772. REQUIRE_PACKAGES_LIBGBAFPC=1
  1773. endif
  1774. ifeq ($(FULL_TARGET),x86_64-solaris)
  1775. REQUIRE_PACKAGES_LIBGBAFPC=1
  1776. endif
  1777. ifeq ($(FULL_TARGET),x86_64-darwin)
  1778. REQUIRE_PACKAGES_LIBGBAFPC=1
  1779. endif
  1780. ifeq ($(FULL_TARGET),x86_64-win64)
  1781. REQUIRE_PACKAGES_LIBGBAFPC=1
  1782. endif
  1783. ifeq ($(FULL_TARGET),x86_64-embedded)
  1784. REQUIRE_PACKAGES_LIBGBAFPC=1
  1785. endif
  1786. ifeq ($(FULL_TARGET),arm-linux)
  1787. REQUIRE_PACKAGES_LIBGBAFPC=1
  1788. endif
  1789. ifeq ($(FULL_TARGET),arm-palmos)
  1790. REQUIRE_PACKAGES_LIBGBAFPC=1
  1791. endif
  1792. ifeq ($(FULL_TARGET),arm-darwin)
  1793. REQUIRE_PACKAGES_LIBGBAFPC=1
  1794. endif
  1795. ifeq ($(FULL_TARGET),arm-wince)
  1796. REQUIRE_PACKAGES_LIBGBAFPC=1
  1797. endif
  1798. ifeq ($(FULL_TARGET),arm-gba)
  1799. REQUIRE_PACKAGES_LIBGBAFPC=1
  1800. endif
  1801. ifeq ($(FULL_TARGET),arm-nds)
  1802. REQUIRE_PACKAGES_LIBGBAFPC=1
  1803. endif
  1804. ifeq ($(FULL_TARGET),arm-embedded)
  1805. REQUIRE_PACKAGES_LIBGBAFPC=1
  1806. endif
  1807. ifeq ($(FULL_TARGET),arm-symbian)
  1808. REQUIRE_PACKAGES_LIBGBAFPC=1
  1809. endif
  1810. ifeq ($(FULL_TARGET),powerpc64-linux)
  1811. REQUIRE_PACKAGES_LIBGBAFPC=1
  1812. endif
  1813. ifeq ($(FULL_TARGET),powerpc64-darwin)
  1814. REQUIRE_PACKAGES_LIBGBAFPC=1
  1815. endif
  1816. ifeq ($(FULL_TARGET),powerpc64-embedded)
  1817. REQUIRE_PACKAGES_LIBGBAFPC=1
  1818. endif
  1819. ifeq ($(FULL_TARGET),avr-embedded)
  1820. REQUIRE_PACKAGES_LIBGBAFPC=1
  1821. endif
  1822. ifeq ($(FULL_TARGET),armeb-linux)
  1823. REQUIRE_PACKAGES_LIBGBAFPC=1
  1824. endif
  1825. ifeq ($(FULL_TARGET),armeb-embedded)
  1826. REQUIRE_PACKAGES_LIBGBAFPC=1
  1827. endif
  1828. ifeq ($(FULL_TARGET),mipsel-linux)
  1829. REQUIRE_PACKAGES_LIBGBAFPC=1
  1830. endif
  1831. ifdef REQUIRE_PACKAGES_LIBGBAFPC
  1832. PACKAGEDIR_LIBGBAFPC:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /libgbafpc/Makefile.fpc,$(PACKAGESDIR))))))
  1833. ifneq ($(PACKAGEDIR_LIBGBAFPC),)
  1834. ifneq ($(wildcard $(PACKAGEDIR_LIBGBAFPC)/units/$(TARGETSUFFIX)),)
  1835. UNITDIR_LIBGBAFPC=$(PACKAGEDIR_LIBGBAFPC)/units/$(TARGETSUFFIX)
  1836. else
  1837. UNITDIR_LIBGBAFPC=$(PACKAGEDIR_LIBGBAFPC)
  1838. endif
  1839. ifneq ($(wildcard $(PACKAGEDIR_LIBGBAFPC)/units/$(SOURCESUFFIX)),)
  1840. UNITDIR_FPMAKE_LIBGBAFPC=$(PACKAGEDIR_LIBGBAFPC)/units/$(SOURCESUFFIX)
  1841. else
  1842. ifneq ($(wildcard $(PACKAGEDIR_LIBGBAFPC)/units_bs/$(SOURCESUFFIX)),)
  1843. UNITDIR_FPMAKE_LIBGBAFPC=$(PACKAGEDIR_LIBGBAFPC)/units_bs/$(SOURCESUFFIX)
  1844. else
  1845. UNITDIR_FPMAKE_LIBGBAFPC=$(PACKAGEDIR_LIBGBAFPC)
  1846. endif
  1847. endif
  1848. ifdef CHECKDEPEND
  1849. $(PACKAGEDIR_LIBGBAFPC)/$(FPCMADE):
  1850. $(MAKE) -C $(PACKAGEDIR_LIBGBAFPC) $(FPCMADE)
  1851. override ALLDEPENDENCIES+=$(PACKAGEDIR_LIBGBAFPC)/$(FPCMADE)
  1852. endif
  1853. else
  1854. PACKAGEDIR_LIBGBAFPC=
  1855. UNITDIR_LIBGBAFPC:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /libgbafpc/Package.fpc,$(UNITSDIR)))))
  1856. ifneq ($(UNITDIR_LIBGBAFPC),)
  1857. UNITDIR_LIBGBAFPC:=$(firstword $(UNITDIR_LIBGBAFPC))
  1858. else
  1859. UNITDIR_LIBGBAFPC=
  1860. endif
  1861. endif
  1862. ifdef UNITDIR_LIBGBAFPC
  1863. override COMPILER_UNITDIR+=$(UNITDIR_LIBGBAFPC)
  1864. endif
  1865. ifdef UNITDIR_FPMAKE_LIBGBAFPC
  1866. override COMPILER_FPMAKE_UNITDIR+=$(UNITDIR_FPMAKE_LIBGBAFPC)
  1867. endif
  1868. endif
  1869. ifndef NOCPUDEF
  1870. override FPCOPTDEF=$(ARCH)
  1871. endif
  1872. ifneq ($(OS_TARGET),$(OS_SOURCE))
  1873. override FPCOPT+=-T$(OS_TARGET)
  1874. endif
  1875. ifneq ($(CPU_TARGET),$(CPU_SOURCE))
  1876. override FPCOPT+=-P$(ARCH)
  1877. endif
  1878. ifeq ($(OS_SOURCE),openbsd)
  1879. override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
  1880. endif
  1881. ifndef CROSSBOOTSTRAP
  1882. ifneq ($(BINUTILSPREFIX),)
  1883. override FPCOPT+=-XP$(BINUTILSPREFIX)
  1884. endif
  1885. ifneq ($(BINUTILSPREFIX),)
  1886. override FPCOPT+=-Xr$(RLINKPATH)
  1887. endif
  1888. endif
  1889. ifdef UNITDIR
  1890. override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
  1891. endif
  1892. ifdef LIBDIR
  1893. override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
  1894. endif
  1895. ifdef OBJDIR
  1896. override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
  1897. endif
  1898. ifdef INCDIR
  1899. override FPCOPT+=$(addprefix -Fi,$(INCDIR))
  1900. endif
  1901. ifdef LINKSMART
  1902. override FPCOPT+=-XX
  1903. endif
  1904. ifdef CREATESMART
  1905. override FPCOPT+=-CX
  1906. endif
  1907. ifdef DEBUG
  1908. override FPCOPT+=-gl
  1909. override FPCOPTDEF+=DEBUG
  1910. endif
  1911. ifdef RELEASE
  1912. ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
  1913. ifeq ($(CPU_TARGET),i386)
  1914. FPCCPUOPT:=-OG2p3
  1915. endif
  1916. ifeq ($(CPU_TARGET),powerpc)
  1917. FPCCPUOPT:=-O1r
  1918. endif
  1919. else
  1920. FPCCPUOPT:=-O2
  1921. endif
  1922. override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
  1923. override FPCOPTDEF+=RELEASE
  1924. endif
  1925. ifdef STRIP
  1926. override FPCOPT+=-Xs
  1927. endif
  1928. ifdef OPTIMIZE
  1929. override FPCOPT+=-O2
  1930. endif
  1931. ifdef VERBOSE
  1932. override FPCOPT+=-vwni
  1933. endif
  1934. ifdef COMPILER_OPTIONS
  1935. override FPCOPT+=$(COMPILER_OPTIONS)
  1936. endif
  1937. ifdef COMPILER_UNITDIR
  1938. override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
  1939. endif
  1940. ifdef COMPILER_LIBRARYDIR
  1941. override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
  1942. endif
  1943. ifdef COMPILER_OBJECTDIR
  1944. override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
  1945. endif
  1946. ifdef COMPILER_INCLUDEDIR
  1947. override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
  1948. endif
  1949. ifdef CROSSBINDIR
  1950. override FPCOPT+=-FD$(CROSSBINDIR)
  1951. endif
  1952. ifdef COMPILER_TARGETDIR
  1953. override FPCOPT+=-FE$(COMPILER_TARGETDIR)
  1954. ifeq ($(COMPILER_TARGETDIR),.)
  1955. override TARGETDIRPREFIX=
  1956. else
  1957. override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
  1958. endif
  1959. endif
  1960. ifdef COMPILER_UNITTARGETDIR
  1961. override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
  1962. ifeq ($(COMPILER_UNITTARGETDIR),.)
  1963. override UNITTARGETDIRPREFIX=
  1964. else
  1965. override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
  1966. endif
  1967. else
  1968. ifdef COMPILER_TARGETDIR
  1969. override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
  1970. override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
  1971. endif
  1972. endif
  1973. ifdef CREATESHARED
  1974. override FPCOPT+=-Cg
  1975. ifeq ($(CPU_TARGET),i386)
  1976. override FPCOPT+=-Aas
  1977. endif
  1978. endif
  1979. ifeq ($(findstring 2.0.,$(FPC_VERSION)),)
  1980. ifneq ($(findstring $(OS_TARGET),linux solaris),)
  1981. ifeq ($(CPU_TARGET),x86_64)
  1982. override FPCOPT+=-Cg
  1983. endif
  1984. endif
  1985. endif
  1986. ifdef LINKSHARED
  1987. endif
  1988. ifdef OPT
  1989. override FPCOPT+=$(OPT)
  1990. endif
  1991. ifdef FPCOPTDEF
  1992. override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
  1993. endif
  1994. ifdef CFGFILE
  1995. override FPCOPT+=@$(CFGFILE)
  1996. endif
  1997. ifdef USEENV
  1998. override FPCEXTCMD:=$(FPCOPT)
  1999. override FPCOPT:=!FPCEXTCMD
  2000. export FPCEXTCMD
  2001. endif
  2002. override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
  2003. override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
  2004. ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
  2005. override ACROSSCOMPILE=1
  2006. endif
  2007. ifdef ACROSSCOMPILE
  2008. override FPCOPT+=$(CROSSOPT)
  2009. endif
  2010. override COMPILER:=$(FPC) $(FPCOPT)
  2011. ifeq (,$(findstring -s ,$(COMPILER)))
  2012. EXECPPAS=
  2013. else
  2014. ifeq ($(FULL_SOURCE),$(FULL_TARGET))
  2015. ifdef RUNBATCH
  2016. EXECPPAS:=@$(RUNBATCH) $(PPAS)
  2017. else
  2018. EXECPPAS:=@$(PPAS)
  2019. endif
  2020. endif
  2021. endif
  2022. .PHONY: fpc_exes
  2023. ifndef CROSSINSTALL
  2024. ifneq ($(TARGET_PROGRAMS),)
  2025. override EXEFILES=$(addsuffix $(EXEEXT),$(TARGET_PROGRAMS))
  2026. override EXEOFILES:=$(addsuffix $(OEXT),$(TARGET_PROGRAMS)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS)))
  2027. override ALLTARGET+=fpc_exes
  2028. override INSTALLEXEFILES+=$(EXEFILES)
  2029. override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
  2030. ifeq ($(OS_TARGET),os2)
  2031. override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
  2032. endif
  2033. ifeq ($(OS_TARGET),emx)
  2034. override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
  2035. endif
  2036. endif
  2037. endif
  2038. fpc_exes: $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(EXEFILES)
  2039. ifdef TARGET_RSTS
  2040. override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
  2041. override CLEANRSTFILES+=$(RSTFILES)
  2042. endif
  2043. .PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
  2044. $(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
  2045. @$(ECHOREDIR) Compiled > $(FPCMADE)
  2046. fpc_all: $(FPCMADE)
  2047. fpc_smart:
  2048. $(MAKE) all LINKSMART=1 CREATESMART=1
  2049. fpc_debug:
  2050. $(MAKE) all DEBUG=1
  2051. fpc_release:
  2052. $(MAKE) all RELEASE=1
  2053. .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res
  2054. $(COMPILER_UNITTARGETDIR):
  2055. $(MKDIRTREE) $(COMPILER_UNITTARGETDIR)
  2056. $(COMPILER_TARGETDIR):
  2057. $(MKDIRTREE) $(COMPILER_TARGETDIR)
  2058. %$(PPUEXT): %.pp
  2059. $(COMPILER) $<
  2060. $(EXECPPAS)
  2061. %$(PPUEXT): %.pas
  2062. $(COMPILER) $<
  2063. $(EXECPPAS)
  2064. %$(EXEEXT): %.pp
  2065. $(COMPILER) $<
  2066. $(EXECPPAS)
  2067. %$(EXEEXT): %.pas
  2068. $(COMPILER) $<
  2069. $(EXECPPAS)
  2070. %$(EXEEXT): %.lpr
  2071. $(COMPILER) $<
  2072. $(EXECPPAS)
  2073. %$(EXEEXT): %.dpr
  2074. $(COMPILER) $<
  2075. $(EXECPPAS)
  2076. %.res: %.rc
  2077. windres -i $< -o $@
  2078. vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  2079. vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  2080. vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  2081. vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  2082. vpath %.inc $(COMPILER_INCLUDEDIR)
  2083. vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
  2084. vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
  2085. .PHONY: fpc_shared
  2086. override INSTALLTARGET+=fpc_shared_install
  2087. ifndef SHARED_LIBVERSION
  2088. SHARED_LIBVERSION=$(FPC_VERSION)
  2089. endif
  2090. ifndef SHARED_LIBNAME
  2091. SHARED_LIBNAME=$(PACKAGE_NAME)
  2092. endif
  2093. ifndef SHARED_FULLNAME
  2094. SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
  2095. endif
  2096. ifndef SHARED_LIBUNITS
  2097. SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS)
  2098. override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS))
  2099. endif
  2100. fpc_shared:
  2101. ifdef HASSHAREDLIB
  2102. $(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
  2103. ifneq ($(SHARED_BUILD),n)
  2104. $(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
  2105. endif
  2106. else
  2107. @$(ECHO) Shared Libraries not supported
  2108. endif
  2109. fpc_shared_install:
  2110. ifneq ($(SHARED_BUILD),n)
  2111. ifneq ($(SHARED_LIBUNITS),)
  2112. ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),)
  2113. $(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
  2114. endif
  2115. endif
  2116. endif
  2117. .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
  2118. ifdef INSTALL_UNITS
  2119. override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
  2120. endif
  2121. ifdef INSTALL_BUILDUNIT
  2122. override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
  2123. endif
  2124. ifdef INSTALLPPUFILES
  2125. override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
  2126. ifneq ($(UNITTARGETDIRPREFIX),)
  2127. override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
  2128. override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
  2129. endif
  2130. override INSTALL_CREATEPACKAGEFPC=1
  2131. endif
  2132. ifdef INSTALLEXEFILES
  2133. ifneq ($(TARGETDIRPREFIX),)
  2134. override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES)))
  2135. endif
  2136. endif
  2137. fpc_install: all $(INSTALLTARGET)
  2138. ifdef INSTALLEXEFILES
  2139. $(MKDIR) $(INSTALL_BINDIR)
  2140. ifdef UPXPROG
  2141. -$(UPXPROG) $(INSTALLEXEFILES)
  2142. endif
  2143. $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
  2144. endif
  2145. ifdef INSTALL_CREATEPACKAGEFPC
  2146. ifdef FPCMAKE
  2147. ifdef PACKAGE_VERSION
  2148. ifneq ($(wildcard Makefile.fpc),)
  2149. $(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc
  2150. $(MKDIR) $(INSTALL_UNITDIR)
  2151. $(INSTALL) Package.fpc $(INSTALL_UNITDIR)
  2152. endif
  2153. endif
  2154. endif
  2155. endif
  2156. ifdef INSTALLPPUFILES
  2157. $(MKDIR) $(INSTALL_UNITDIR)
  2158. $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
  2159. ifneq ($(INSTALLPPULINKFILES),)
  2160. $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
  2161. endif
  2162. ifneq ($(wildcard $(LIB_FULLNAME)),)
  2163. $(MKDIR) $(INSTALL_LIBDIR)
  2164. $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
  2165. ifdef inUnix
  2166. ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
  2167. endif
  2168. endif
  2169. endif
  2170. ifdef INSTALL_FILES
  2171. $(MKDIR) $(INSTALL_DATADIR)
  2172. $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
  2173. endif
  2174. fpc_sourceinstall: distclean
  2175. $(MKDIR) $(INSTALL_SOURCEDIR)
  2176. $(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
  2177. fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
  2178. ifdef HASEXAMPLES
  2179. $(MKDIR) $(INSTALL_EXAMPLEDIR)
  2180. endif
  2181. ifdef EXAMPLESOURCEFILES
  2182. $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
  2183. endif
  2184. ifdef TARGET_EXAMPLEDIRS
  2185. $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
  2186. endif
  2187. .PHONY: fpc_clean fpc_cleanall fpc_distclean
  2188. ifdef EXEFILES
  2189. override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
  2190. endif
  2191. ifdef CLEAN_PROGRAMS
  2192. override CLEANEXEFILES+=$(addprefix $(TARGETDIRPREFIX),$(addsuffix $(EXEEXT), $(CLEAN_PROGRAMS)))
  2193. endif
  2194. ifdef CLEAN_UNITS
  2195. override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
  2196. endif
  2197. ifdef CLEANPPUFILES
  2198. override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
  2199. ifdef DEBUGSYMEXT
  2200. override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
  2201. endif
  2202. override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
  2203. override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
  2204. endif
  2205. fpc_clean: $(CLEANTARGET)
  2206. ifdef CLEANEXEFILES
  2207. -$(DEL) $(CLEANEXEFILES)
  2208. endif
  2209. ifdef CLEANPPUFILES
  2210. -$(DEL) $(CLEANPPUFILES)
  2211. endif
  2212. ifneq ($(CLEANPPULINKFILES),)
  2213. -$(DEL) $(CLEANPPULINKFILES)
  2214. endif
  2215. ifdef CLEANRSTFILES
  2216. -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
  2217. endif
  2218. ifdef CLEAN_FILES
  2219. -$(DEL) $(CLEAN_FILES)
  2220. endif
  2221. ifdef LIB_NAME
  2222. -$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
  2223. endif
  2224. -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  2225. -$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT)
  2226. fpc_cleanall: $(CLEANTARGET)
  2227. ifdef CLEANEXEFILES
  2228. -$(DEL) $(CLEANEXEFILES)
  2229. endif
  2230. ifdef COMPILER_UNITTARGETDIR
  2231. ifdef CLEANPPUFILES
  2232. -$(DEL) $(CLEANPPUFILES)
  2233. endif
  2234. ifneq ($(CLEANPPULINKFILES),)
  2235. -$(DEL) $(CLEANPPULINKFILES)
  2236. endif
  2237. ifdef CLEANRSTFILES
  2238. -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
  2239. endif
  2240. endif
  2241. ifdef CLEAN_FILES
  2242. -$(DEL) $(CLEAN_FILES)
  2243. endif
  2244. -$(DELTREE) units
  2245. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  2246. ifneq ($(PPUEXT),.ppu)
  2247. -$(DEL) *.o *.ppu *.a
  2248. endif
  2249. -$(DELTREE) *$(SMARTEXT)
  2250. -$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  2251. -$(DEL) *_ppas$(BATCHEXT)
  2252. ifdef AOUTEXT
  2253. -$(DEL) *$(AOUTEXT)
  2254. endif
  2255. ifdef DEBUGSYMEXT
  2256. -$(DEL) *$(DEBUGSYMEXT)
  2257. endif
  2258. fpc_distclean: cleanall
  2259. .PHONY: fpc_baseinfo
  2260. override INFORULES+=fpc_baseinfo
  2261. fpc_baseinfo:
  2262. @$(ECHO)
  2263. @$(ECHO) == Package info ==
  2264. @$(ECHO) Package Name..... $(PACKAGE_NAME)
  2265. @$(ECHO) Package Version.. $(PACKAGE_VERSION)
  2266. @$(ECHO)
  2267. @$(ECHO) == Configuration info ==
  2268. @$(ECHO)
  2269. @$(ECHO) FPC.......... $(FPC)
  2270. @$(ECHO) FPC Version.. $(FPC_VERSION)
  2271. @$(ECHO) Source CPU... $(CPU_SOURCE)
  2272. @$(ECHO) Target CPU... $(CPU_TARGET)
  2273. @$(ECHO) Source OS.... $(OS_SOURCE)
  2274. @$(ECHO) Target OS.... $(OS_TARGET)
  2275. @$(ECHO) Full Source.. $(FULL_SOURCE)
  2276. @$(ECHO) Full Target.. $(FULL_TARGET)
  2277. @$(ECHO) SourceSuffix. $(SOURCESUFFIX)
  2278. @$(ECHO) TargetSuffix. $(TARGETSUFFIX)
  2279. @$(ECHO) FPC fpmake... $(FPCFPMAKE)
  2280. @$(ECHO)
  2281. @$(ECHO) == Directory info ==
  2282. @$(ECHO)
  2283. @$(ECHO) Required pkgs... $(REQUIRE_PACKAGES)
  2284. @$(ECHO)
  2285. @$(ECHO) Basedir......... $(BASEDIR)
  2286. @$(ECHO) FPCDir.......... $(FPCDIR)
  2287. @$(ECHO) CrossBinDir..... $(CROSSBINDIR)
  2288. @$(ECHO) UnitsDir........ $(UNITSDIR)
  2289. @$(ECHO) PackagesDir..... $(PACKAGESDIR)
  2290. @$(ECHO)
  2291. @$(ECHO) GCC library..... $(GCCLIBDIR)
  2292. @$(ECHO) Other library... $(OTHERLIBDIR)
  2293. @$(ECHO)
  2294. @$(ECHO) == Tools info ==
  2295. @$(ECHO)
  2296. @$(ECHO) As........ $(AS)
  2297. @$(ECHO) Ld........ $(LD)
  2298. @$(ECHO) Ar........ $(AR)
  2299. @$(ECHO) Rc........ $(RC)
  2300. @$(ECHO)
  2301. @$(ECHO) Mv........ $(MVPROG)
  2302. @$(ECHO) Cp........ $(CPPROG)
  2303. @$(ECHO) Rm........ $(RMPROG)
  2304. @$(ECHO) GInstall.. $(GINSTALL)
  2305. @$(ECHO) Echo...... $(ECHO)
  2306. @$(ECHO) Shell..... $(SHELL)
  2307. @$(ECHO) Date...... $(DATE)
  2308. @$(ECHO) FPCMake... $(FPCMAKE)
  2309. @$(ECHO) PPUMove... $(PPUMOVE)
  2310. @$(ECHO) Upx....... $(UPXPROG)
  2311. @$(ECHO) Zip....... $(ZIPPROG)
  2312. @$(ECHO)
  2313. @$(ECHO) == Object info ==
  2314. @$(ECHO)
  2315. @$(ECHO) Target Loaders........ $(TARGET_LOADERS)
  2316. @$(ECHO) Target Units.......... $(TARGET_UNITS)
  2317. @$(ECHO) Target Implicit Units. $(TARGET_IMPLICITUNITS)
  2318. @$(ECHO) Target Programs....... $(TARGET_PROGRAMS)
  2319. @$(ECHO) Target Dirs........... $(TARGET_DIRS)
  2320. @$(ECHO) Target Examples....... $(TARGET_EXAMPLES)
  2321. @$(ECHO) Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
  2322. @$(ECHO)
  2323. @$(ECHO) Clean Units......... $(CLEAN_UNITS)
  2324. @$(ECHO) Clean Files......... $(CLEAN_FILES)
  2325. @$(ECHO)
  2326. @$(ECHO) Install Units....... $(INSTALL_UNITS)
  2327. @$(ECHO) Install Files....... $(INSTALL_FILES)
  2328. @$(ECHO)
  2329. @$(ECHO) == Install info ==
  2330. @$(ECHO)
  2331. @$(ECHO) DateStr.............. $(DATESTR)
  2332. @$(ECHO) ZipName.............. $(ZIPNAME)
  2333. @$(ECHO) ZipPrefix............ $(ZIPPREFIX)
  2334. @$(ECHO) ZipCrossPrefix....... $(ZIPCROSSPREFIX)
  2335. @$(ECHO) ZipSuffix............ $(ZIPSUFFIX)
  2336. @$(ECHO) FullZipName.......... $(FULLZIPNAME)
  2337. @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE)
  2338. @$(ECHO)
  2339. @$(ECHO) Install base dir..... $(INSTALL_BASEDIR)
  2340. @$(ECHO) Install binary dir... $(INSTALL_BINDIR)
  2341. @$(ECHO) Install library dir.. $(INSTALL_LIBDIR)
  2342. @$(ECHO) Install units dir.... $(INSTALL_UNITDIR)
  2343. @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR)
  2344. @$(ECHO) Install doc dir...... $(INSTALL_DOCDIR)
  2345. @$(ECHO) Install example dir.. $(INSTALL_EXAMPLEDIR)
  2346. @$(ECHO) Install data dir..... $(INSTALL_DATADIR)
  2347. @$(ECHO)
  2348. @$(ECHO) Dist destination dir. $(DIST_DESTDIR)
  2349. @$(ECHO) Dist zip name........ $(DIST_ZIPNAME)
  2350. @$(ECHO)
  2351. .PHONY: fpc_info
  2352. fpc_info: $(INFORULES)
  2353. .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
  2354. fpc_makefile_dirs
  2355. fpc_makefile:
  2356. $(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
  2357. fpc_makefile_sub1:
  2358. ifdef TARGET_DIRS
  2359. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
  2360. endif
  2361. ifdef TARGET_EXAMPLEDIRS
  2362. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
  2363. endif
  2364. fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
  2365. fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
  2366. fpc_makefiles: fpc_makefile fpc_makefile_dirs
  2367. ifndef BIN2S
  2368. BIN2S:=$(strip $(wildcard $(addsuffix /bin2s$(SRCEXEEXT),$(SEARCHPATH))))
  2369. ifeq ($(BIN2S),)
  2370. BIN2S= __missing_command_BIN2S
  2371. else
  2372. BIN2S:=$(firstword $(BIN2S))
  2373. endif
  2374. endif
  2375. export BIN2S
  2376. ifndef MMUTIL
  2377. MMUTIL:=$(strip $(wildcard $(addsuffix /mmutil$(SRCEXEEXT),$(SEARCHPATH))))
  2378. ifeq ($(MMUTIL),)
  2379. MMUTIL= __missing_command_MMUTIL
  2380. else
  2381. MMUTIL:=$(firstword $(MMUTIL))
  2382. endif
  2383. endif
  2384. export MMUTIL
  2385. ifndef GRIT
  2386. GRIT:=$(strip $(wildcard $(addsuffix /grit$(SRCEXEEXT),$(SEARCHPATH))))
  2387. ifeq ($(GRIT),)
  2388. GRIT= __missing_command_GRIT
  2389. else
  2390. GRIT:=$(firstword $(GRIT))
  2391. endif
  2392. endif
  2393. export GRIT
  2394. ifndef RMDIR
  2395. RMDIR:=$(strip $(wildcard $(addsuffix /rmdir$(SRCEXEEXT),$(SEARCHPATH))))
  2396. ifeq ($(RMDIR),)
  2397. RMDIR= __missing_command_RMDIR
  2398. else
  2399. RMDIR:=$(firstword $(RMDIR))
  2400. endif
  2401. endif
  2402. export RMDIR
  2403. debug: fpc_debug
  2404. smart: fpc_smart
  2405. release: fpc_release
  2406. units: fpc_units
  2407. examples:
  2408. shared: fpc_shared
  2409. install: fpc_install
  2410. sourceinstall: fpc_sourceinstall
  2411. exampleinstall: fpc_exampleinstall
  2412. distinstall:
  2413. zipinstall:
  2414. zipsourceinstall:
  2415. zipexampleinstall:
  2416. zipdistinstall:
  2417. distclean: fpc_distclean
  2418. cleanall: fpc_cleanall
  2419. info: fpc_info
  2420. makefiles: fpc_makefiles
  2421. .PHONY: debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall distclean cleanall info makefiles
  2422. ifneq ($(wildcard fpcmake.loc),)
  2423. include fpcmake.loc
  2424. endif
  2425. .NOTPARALLEL:
  2426. clean: dir_delete fpc_clean fpc_cleanall
  2427. all: dir_make $(BIN_FILES) $(GFX_FILES) fpc_all
  2428. dir_delete:
  2429. @$(DELTREE) $(CURDIR)/$(BUILD)
  2430. @$(DELTREE) $(CURDIR)/$(INC)
  2431. dir_make:
  2432. ifneq ($(BUILD), $(CURDIR))
  2433. @$(MKDIR) $(BUILD)
  2434. endif
  2435. ifneq ($(INC), $(CURDIR))
  2436. @$(MKDIR) $(INC)
  2437. endif
  2438. $(GFX_FILES): $(wildcard %.png)
  2439. @echo 'Converting $(@) file to asm...'
  2440. $(GRIT) gfx/$(@) -fts -ff gfx/$(basename $(@)).grit -o$(BUILD)/$(@)
  2441. @echo 'Assembling $(@).s file...'
  2442. $(AS) -o $(BUILD)/$(basename $(@)).o $(BUILD)/$(basename $(@)).s
  2443. @echo 'Done!'
  2444. $(BIN_FILES): $(wildcard %.*)
  2445. @echo 'Converting $(@) file to asm...'
  2446. @$(BIN2S) data/$(@) > $(BUILD)/$(@).s
  2447. @echo 'Creating $(@).inc include file...'
  2448. @echo "var" > `(echo "inc/"$(@F) | tr . .)`.inc
  2449. @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end: array [0..0] of cuint8; cvar; external;" >> `(echo "inc/"$(@F) | tr . .)`.inc
  2450. @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`": array [0..0] of cuint8; cvar; external;" >> `(echo "inc/"$(@F) | tr . .)`.inc
  2451. @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size": cuint32; cvar; external;" >> `(echo "inc/"$(@F) | tr . .)`.inc
  2452. @echo 'Assembling $(@).s file...'
  2453. @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s
  2454. @echo 'Done!'