Makefile 52 KB

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