Makefile 65 KB

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