Makefile 53 KB

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