Makefile 62 KB

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