Makefile 50 KB

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