Makefile 53 KB

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