Makefile 56 KB

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