Makefile 52 KB

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