Makefile 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524
  1. #
  2. # Don't edit, this file is generated by FPCMake Version 1.1 [2003/04/06]
  3. #
  4. default: all
  5. MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx palmos macos macosx emx
  6. override PATH:=$(subst \,/,$(PATH))
  7. ifeq ($(findstring ;,$(PATH)),)
  8. inUnix=1
  9. SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
  10. else
  11. SEARCHPATH:=$(subst ;, ,$(PATH))
  12. endif
  13. PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
  14. ifeq ($(PWD),)
  15. PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
  16. ifeq ($(PWD),)
  17. $(error You need the GNU utils package to use this Makefile)
  18. else
  19. PWD:=$(firstword $(PWD))
  20. SRCEXEEXT=
  21. endif
  22. else
  23. PWD:=$(firstword $(PWD))
  24. SRCEXEEXT=.exe
  25. endif
  26. ifndef inUnix
  27. ifeq ($(OS),Windows_NT)
  28. inWinNT=1
  29. else
  30. ifdef OS2_SHELL
  31. inOS2=1
  32. endif
  33. endif
  34. else
  35. ifneq ($(findstring cygwin,$(MACHTYPE)),)
  36. inCygWin=1
  37. endif
  38. endif
  39. ifeq ($(OS_TARGET),freebsd)
  40. BSDhier=1
  41. endif
  42. ifeq ($(OS_TARGET),netbsd)
  43. BSDhier=1
  44. endif
  45. ifeq ($(OS_TARGET),openbsd)
  46. BSDhier=1
  47. endif
  48. ifdef inUnix
  49. BATCHEXT=.sh
  50. else
  51. ifdef inOS2
  52. BATCHEXT=.cmd
  53. else
  54. BATCHEXT=.bat
  55. endif
  56. endif
  57. ifdef inUnix
  58. PATHSEP=/
  59. else
  60. PATHSEP:=$(subst /,\,/)
  61. ifdef inCygWin
  62. PATHSEP=/
  63. endif
  64. endif
  65. ifdef PWD
  66. BASEDIR:=$(subst \,/,$(shell $(PWD)))
  67. ifdef inCygWin
  68. ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
  69. BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
  70. BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
  71. BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
  72. endif
  73. endif
  74. else
  75. BASEDIR=.
  76. endif
  77. ifdef inOS2
  78. ifndef ECHO
  79. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  80. ifeq ($(ECHO),)
  81. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  82. ifeq ($(ECHO),)
  83. ECHO=echo
  84. else
  85. ECHO:=$(firstword $(ECHO))
  86. endif
  87. else
  88. ECHO:=$(firstword $(ECHO))
  89. endif
  90. endif
  91. export ECHO
  92. endif
  93. override DEFAULT_FPCDIR=../../..
  94. ifndef FPC
  95. ifdef PP
  96. FPC=$(PP)
  97. endif
  98. endif
  99. ifndef FPC
  100. FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
  101. ifneq ($(FPCPROG),)
  102. FPCPROG:=$(firstword $(FPCPROG))
  103. FPC:=$(shell $(FPCPROG) -PB)
  104. ifneq ($(findstring Error,$(FPC)),)
  105. override FPC=ppc386
  106. endif
  107. else
  108. override FPC=ppc386
  109. endif
  110. endif
  111. override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
  112. override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
  113. ifndef FPC_VERSION
  114. FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
  115. FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
  116. endif
  117. export FPC FPC_VERSION FPC_COMPILERINFO
  118. unexport CHECKDEPEND ALLDEPENDENCIES
  119. ifndef CPU_TARGET
  120. ifdef CPU_TARGET_DEFAULT
  121. CPU_TARGET=$(CPU_TARGET_DEFAULT)
  122. endif
  123. endif
  124. ifndef OS_TARGET
  125. ifdef OS_TARGET_DEFAULT
  126. OS_TARGET=$(OS_TARGET_DEFAULT)
  127. endif
  128. endif
  129. ifneq ($(words $(FPC_COMPILERINFO)),5)
  130. FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
  131. FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
  132. FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
  133. FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
  134. endif
  135. ifndef CPU_SOURCE
  136. CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
  137. endif
  138. ifndef CPU_TARGET
  139. CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
  140. endif
  141. ifndef OS_SOURCE
  142. OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
  143. endif
  144. ifndef OS_TARGET
  145. OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
  146. endif
  147. FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
  148. FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
  149. ifneq ($(FULL_TARGET),$(FULL_SOURCE))
  150. CROSSCOMPILE=1
  151. endif
  152. ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
  153. ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
  154. $(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
  155. endif
  156. endif
  157. export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
  158. ifdef FPCDIR
  159. override FPCDIR:=$(subst \,/,$(FPCDIR))
  160. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  161. override FPCDIR=wrong
  162. endif
  163. else
  164. override FPCDIR=wrong
  165. endif
  166. ifdef DEFAULT_FPCDIR
  167. ifeq ($(FPCDIR),wrong)
  168. override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
  169. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  170. override FPCDIR=wrong
  171. endif
  172. endif
  173. endif
  174. ifeq ($(FPCDIR),wrong)
  175. ifdef inUnix
  176. override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
  177. ifeq ($(wildcard $(FPCDIR)/units),)
  178. override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
  179. endif
  180. else
  181. override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
  182. override FPCDIR:=$(FPCDIR)/..
  183. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  184. override FPCDIR:=$(FPCDIR)/..
  185. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  186. override FPCDIR=c:/pp
  187. endif
  188. endif
  189. endif
  190. endif
  191. ifndef CROSSDIR
  192. CROSSDIR:=$(FPCDIR)/cross/$(FULL_TARGET)
  193. endif
  194. ifndef CROSSTARGETDIR
  195. CROSSTARGETDIR=$(CROSSDIR)/$(FULL_TARGET)
  196. endif
  197. ifdef CROSSCOMPILE
  198. UNITSDIR:=$(wildcard $(CROSSTARGETDIR)/units)
  199. ifeq ($(UNITSDIR),)
  200. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
  201. endif
  202. else
  203. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
  204. endif
  205. PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
  206. override PACKAGE_NAME=gdbint
  207. override PACKAGE_VERSION=1.0.8
  208. ifdef inUnix
  209. CURRDIR=./
  210. else
  211. CURRDIR=
  212. endif
  213. ifdef GDBLIBDIR
  214. override LIBGDBFILE:=$(firstword $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR))))
  215. endif
  216. ifeq ($(LIBGDBFILE),)
  217. override GDBLIBDIR=libgdb/$(OS_TARGET)
  218. ifeq ($(OS_TARGET),go32v2)
  219. ifneq ($(DJDIR),)
  220. GDBLIBDIR+=$(DJDIR)/lib
  221. endif
  222. endif
  223. override LIBGDBFILE:=$(firstword $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR))))
  224. endif
  225. ifeq ($(LIBGDBFILE),)
  226. GDBFOUND=0
  227. else
  228. GDBFOUND=1
  229. endif
  230. override TARGET_UNITS+=gdbint gdbcon
  231. override TARGET_EXAMPLES+=testgdb symify
  232. override INSTALL_FPCPACKAGE=y
  233. override COMPILER_OBJECTDIR+=$(GDBLIBDIR)
  234. override COMPILER_LIBRARYDIR+=$(GDBLIBDIR)
  235. ifdef REQUIRE_UNITSDIR
  236. override UNITSDIR+=$(REQUIRE_UNITSDIR)
  237. endif
  238. ifdef REQUIRE_PACKAGESDIR
  239. override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
  240. endif
  241. ifdef ZIPINSTALL
  242. ifeq ($(OS_TARGET),linux)
  243. UNIXINSTALLDIR=1
  244. endif
  245. ifeq ($(OS_TARGET),freebsd)
  246. UNIXINSTALLDIR=1
  247. endif
  248. ifeq ($(OS_TARGET),netbsd)
  249. UNIXINSTALLDIR=1
  250. endif
  251. ifeq ($(OS_TARGET),openbsd)
  252. UNIXINSTALLDIR=1
  253. endif
  254. ifeq ($(OS_TARGET),sunos)
  255. UNIXINSTALLDIR=1
  256. endif
  257. ifeq ($(OS_TARGET),qnx)
  258. UNIXINSTALLDIR=1
  259. endif
  260. else
  261. ifeq ($(OS_SOURCE),linux)
  262. UNIXINSTALLDIR=1
  263. endif
  264. ifeq ($(OS_SOURCE),freebsd)
  265. UNIXINSTALLDIR=1
  266. endif
  267. ifeq ($(OS_SOURCE),netbsd)
  268. UNIXINSTALLDIR=1
  269. endif
  270. ifeq ($(OS_SOURCE),openbsd)
  271. UNIXINSTALLDIR=1
  272. endif
  273. ifeq ($(OS_TARGET),sunos)
  274. UNIXINSTALLDIR=1
  275. endif
  276. ifeq ($(OS_TARGET),qnx)
  277. UNIXINSTALLDIR=1
  278. endif
  279. endif
  280. ifndef INSTALL_PREFIX
  281. ifdef PREFIX
  282. INSTALL_PREFIX=$(PREFIX)
  283. endif
  284. endif
  285. ifndef INSTALL_PREFIX
  286. ifdef UNIXINSTALLDIR
  287. INSTALL_PREFIX=/usr/local
  288. else
  289. ifdef INSTALL_FPCPACKAGE
  290. INSTALL_BASEDIR:=/pp
  291. else
  292. INSTALL_BASEDIR:=/$(PACKAGE_NAME)
  293. endif
  294. endif
  295. endif
  296. export INSTALL_PREFIX
  297. ifdef INSTALL_FPCSUBDIR
  298. export INSTALL_FPCSUBDIR
  299. endif
  300. ifndef DIST_DESTDIR
  301. DIST_DESTDIR:=$(BASEDIR)
  302. endif
  303. export DIST_DESTDIR
  304. ifndef INSTALL_BASEDIR
  305. ifdef UNIXINSTALLDIR
  306. ifdef INSTALL_FPCPACKAGE
  307. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
  308. else
  309. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
  310. endif
  311. else
  312. INSTALL_BASEDIR:=$(INSTALL_PREFIX)
  313. endif
  314. endif
  315. ifndef INSTALL_BINDIR
  316. ifdef UNIXINSTALLDIR
  317. INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
  318. else
  319. INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
  320. ifdef INSTALL_FPCPACKAGE
  321. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)
  322. endif
  323. endif
  324. endif
  325. ifndef INSTALL_UNITDIR
  326. ifdef CROSSCOMPILE
  327. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/units
  328. else
  329. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(OS_TARGET)
  330. endif
  331. ifdef INSTALL_FPCPACKAGE
  332. ifdef PACKAGE_NAME
  333. INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
  334. endif
  335. endif
  336. endif
  337. ifndef INSTALL_LIBDIR
  338. ifdef UNIXINSTALLDIR
  339. INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
  340. else
  341. INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
  342. endif
  343. endif
  344. ifndef INSTALL_SOURCEDIR
  345. ifdef UNIXINSTALLDIR
  346. ifdef BSDhier
  347. SRCPREFIXDIR=share/src
  348. else
  349. SRCPREFIXDIR=src
  350. endif
  351. ifdef INSTALL_FPCPACKAGE
  352. ifdef INSTALL_FPCSUBDIR
  353. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  354. else
  355. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  356. endif
  357. else
  358. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  359. endif
  360. else
  361. ifdef INSTALL_FPCPACKAGE
  362. ifdef INSTALL_FPCSUBDIR
  363. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  364. else
  365. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
  366. endif
  367. else
  368. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
  369. endif
  370. endif
  371. endif
  372. ifndef INSTALL_DOCDIR
  373. ifdef UNIXINSTALLDIR
  374. ifdef BSDhier
  375. DOCPREFIXDIR=share/doc
  376. else
  377. DOCPREFIXDIR=doc
  378. endif
  379. ifdef INSTALL_FPCPACKAGE
  380. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  381. else
  382. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  383. endif
  384. else
  385. ifdef INSTALL_FPCPACKAGE
  386. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
  387. else
  388. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
  389. endif
  390. endif
  391. endif
  392. ifndef INSTALL_EXAMPLEDIR
  393. ifdef UNIXINSTALLDIR
  394. ifdef INSTALL_FPCPACKAGE
  395. ifdef BSDhier
  396. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  397. else
  398. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
  399. endif
  400. else
  401. ifdef BSDhier
  402. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  403. else
  404. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  405. endif
  406. endif
  407. else
  408. ifdef INSTALL_FPCPACKAGE
  409. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
  410. else
  411. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
  412. endif
  413. endif
  414. endif
  415. ifndef INSTALL_DATADIR
  416. INSTALL_DATADIR=$(INSTALL_BASEDIR)
  417. endif
  418. ifdef CROSSCOMPILE
  419. ifndef CROSSBINDIR
  420. CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(FULL_SOURCE))
  421. ifeq ($(CROSSBINDIR),)
  422. CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/bin/$(FULL_SOURCE))
  423. endif
  424. endif
  425. else
  426. CROSSBINDIR=
  427. endif
  428. ifdef inUnix
  429. ifndef GCCLIBDIR
  430. GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
  431. endif
  432. ifeq ($(OS_TARGET),linux)
  433. ifndef OTHERLIBDIR
  434. OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
  435. endif
  436. endif
  437. ifeq ($(OS_TARGET),netbsd)
  438. OTHERLIBDIR+=/usr/pkg/lib
  439. endif
  440. export GCCLIBDIR OTHERLIB
  441. endif
  442. LOADEREXT=.as
  443. EXEEXT=.exe
  444. PPLEXT=.ppl
  445. PPUEXT=.ppu
  446. OEXT=.o
  447. ASMEXT=.s
  448. SMARTEXT=.sl
  449. STATICLIBEXT=.a
  450. SHAREDLIBEXT=.so
  451. STATICLIBPREFIX=libp
  452. RSTEXT=.rst
  453. FPCMADE=fpcmade
  454. ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
  455. ifeq ($(OS_TARGET),go32v1)
  456. STATICLIBPREFIX=
  457. FPCMADE=fpcmade.v1
  458. PACKAGESUFFIX=v1
  459. endif
  460. ifeq ($(OS_TARGET),go32v2)
  461. STATICLIBPREFIX=
  462. FPCMADE=fpcmade.dos
  463. ZIPSUFFIX=go32
  464. endif
  465. ifeq ($(OS_TARGET),linux)
  466. EXEEXT=
  467. HASSHAREDLIB=1
  468. FPCMADE=fpcmade.lnx
  469. ZIPSUFFIX=linux
  470. endif
  471. ifeq ($(OS_TARGET),freebsd)
  472. EXEEXT=
  473. HASSHAREDLIB=1
  474. FPCMADE=fpcmade.freebsd
  475. ZIPSUFFIX=freebsd
  476. endif
  477. ifeq ($(OS_TARGET),netbsd)
  478. EXEEXT=
  479. HASSHAREDLIB=1
  480. FPCMADE=fpcmade.netbsd
  481. ZIPSUFFIX=netbsd
  482. endif
  483. ifeq ($(OS_TARGET),openbsd)
  484. EXEEXT=
  485. HASSHAREDLIB=1
  486. FPCMADE=fpcmade.openbsd
  487. ZIPSUFFIX=openbsd
  488. endif
  489. ifeq ($(OS_TARGET),win32)
  490. SHAREDLIBEXT=.dll
  491. FPCMADE=fpcmade.w32
  492. ZIPSUFFIX=w32
  493. endif
  494. ifeq ($(OS_TARGET),os2)
  495. AOUTEXT=.out
  496. STATICLIBPREFIX=
  497. SHAREDLIBEXT=.dll
  498. FPCMADE=fpcmade.os2
  499. ZIPSUFFIX=os2
  500. ECHO=echo
  501. endif
  502. ifeq ($(OS_TARGET),emx)
  503. AOUTEXT=.out
  504. STATICLIBPREFIX=
  505. SHAREDLIBEXT=.dll
  506. FPCMADE=fpcmade.emx
  507. ZIPSUFFIX=emx
  508. ECHO=echo
  509. endif
  510. ifeq ($(OS_TARGET),amiga)
  511. EXEEXT=
  512. SHAREDLIBEXT=.library
  513. FPCMADE=fpcmade.amg
  514. endif
  515. ifeq ($(OS_TARGET),atari)
  516. EXEEXT=.ttp
  517. FPCMADE=fpcmade.ata
  518. endif
  519. ifeq ($(OS_TARGET),beos)
  520. EXEEXT=
  521. FPCMADE=fpcmade.be
  522. ZIPSUFFIX=be
  523. endif
  524. ifeq ($(OS_TARGET),sunos)
  525. EXEEXT=
  526. FPCMADE=fpcmade.sun
  527. ZIPSUFFIX=sun
  528. endif
  529. ifeq ($(OS_TARGET),qnx)
  530. EXEEXT=
  531. FPCMADE=fpcmade.qnx
  532. ZIPSUFFIX=qnx
  533. endif
  534. ifeq ($(OS_TARGET),netware)
  535. EXEEXT=.nlm
  536. STATICLIBPREFIX=
  537. FPCMADE=fpcmade.nw
  538. ZIPSUFFIX=nw
  539. endif
  540. ifeq ($(OS_TARGET),macos)
  541. EXEEXT=
  542. FPCMADE=fpcmade.mcc
  543. endif
  544. else
  545. ifeq ($(OS_TARGET),go32v1)
  546. PPUEXT=.pp1
  547. OEXT=.o1
  548. ASMEXT=.s1
  549. SMARTEXT=.sl1
  550. STATICLIBEXT=.a1
  551. SHAREDLIBEXT=.so1
  552. STATICLIBPREFIX=
  553. FPCMADE=fpcmade.v1
  554. PACKAGESUFFIX=v1
  555. endif
  556. ifeq ($(OS_TARGET),go32v2)
  557. STATICLIBPREFIX=
  558. FPCMADE=fpcmade.dos
  559. ZIPSUFFIX=go32
  560. endif
  561. ifeq ($(OS_TARGET),linux)
  562. EXEEXT=
  563. HASSHAREDLIB=1
  564. FPCMADE=fpcmade.lnx
  565. ZIPSUFFIX=linux
  566. endif
  567. ifeq ($(OS_TARGET),freebsd)
  568. EXEEXT=
  569. HASSHAREDLIB=1
  570. FPCMADE=fpcmade.freebsd
  571. ZIPSUFFIX=freebsd
  572. endif
  573. ifeq ($(OS_TARGET),netbsd)
  574. EXEEXT=
  575. HASSHAREDLIB=1
  576. FPCMADE=fpcmade.netbsd
  577. ZIPSUFFIX=netbsd
  578. endif
  579. ifeq ($(OS_TARGET),openbsd)
  580. EXEEXT=
  581. HASSHAREDLIB=1
  582. FPCMADE=fpcmade.openbsd
  583. ZIPSUFFIX=openbsd
  584. endif
  585. ifeq ($(OS_TARGET),win32)
  586. PPUEXT=.ppw
  587. OEXT=.ow
  588. ASMEXT=.sw
  589. SMARTEXT=.slw
  590. STATICLIBEXT=.aw
  591. SHAREDLIBEXT=.dll
  592. FPCMADE=fpcmade.w32
  593. ZIPSUFFIX=w32
  594. endif
  595. ifeq ($(OS_TARGET),os2)
  596. PPUEXT=.ppo
  597. ASMEXT=.so2
  598. OEXT=.oo2
  599. AOUTEXT=.out
  600. SMARTEXT=.sl2
  601. STATICLIBPREFIX=
  602. STATICLIBEXT=.ao2
  603. SHAREDLIBEXT=.dll
  604. FPCMADE=fpcmade.os2
  605. ZIPSUFFIX=emx
  606. ECHO=echo
  607. endif
  608. ifeq ($(OS_TARGET),amiga)
  609. EXEEXT=
  610. PPUEXT=.ppu
  611. ASMEXT=.asm
  612. OEXT=.o
  613. SMARTEXT=.sl
  614. STATICLIBEXT=.a
  615. SHAREDLIBEXT=.library
  616. FPCMADE=fpcmade.amg
  617. endif
  618. ifeq ($(OS_TARGET),atari)
  619. PPUEXT=.ppu
  620. ASMEXT=.s
  621. OEXT=.o
  622. SMARTEXT=.sl
  623. STATICLIBEXT=.a
  624. EXEEXT=.ttp
  625. FPCMADE=fpcmade.ata
  626. endif
  627. ifeq ($(OS_TARGET),beos)
  628. PPUEXT=.ppu
  629. ASMEXT=.s
  630. OEXT=.o
  631. SMARTEXT=.sl
  632. STATICLIBEXT=.a
  633. EXEEXT=
  634. FPCMADE=fpcmade.be
  635. ZIPSUFFIX=be
  636. endif
  637. ifeq ($(OS_TARGET),sunos)
  638. PPUEXT=.ppu
  639. ASMEXT=.s
  640. OEXT=.o
  641. SMARTEXT=.sl
  642. STATICLIBEXT=.a
  643. EXEEXT=
  644. FPCMADE=fpcmade.sun
  645. ZIPSUFFIX=sun
  646. endif
  647. ifeq ($(OS_TARGET),qnx)
  648. PPUEXT=.ppu
  649. ASMEXT=.s
  650. OEXT=.o
  651. SMARTEXT=.sl
  652. STATICLIBEXT=.a
  653. EXEEXT=
  654. FPCMADE=fpcmade.qnx
  655. ZIPSUFFIX=qnx
  656. endif
  657. ifeq ($(OS_TARGET),netware)
  658. STATICLIBPREFIX=
  659. PPUEXT=.ppu
  660. OEXT=.o
  661. ASMEXT=.s
  662. SMARTEXT=.sl
  663. STATICLIBEXT=.a
  664. SHAREDLIBEXT=.nlm
  665. FPCMADE=fpcmade.nw
  666. ZIPSUFFIX=nw
  667. EXEEXT=.nlm
  668. endif
  669. ifeq ($(OS_TARGET),macos)
  670. PPUEXT=.ppu
  671. ASMEXT=.s
  672. OEXT=.o
  673. SMARTEXT=.sl
  674. STATICLIBEXT=.a
  675. EXEEXT=
  676. FPCMADE=fpcmade.mcc
  677. endif
  678. endif
  679. ifndef ECHO
  680. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  681. ifeq ($(ECHO),)
  682. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  683. ifeq ($(ECHO),)
  684. ECHO=
  685. else
  686. ECHO:=$(firstword $(ECHO))
  687. endif
  688. else
  689. ECHO:=$(firstword $(ECHO))
  690. endif
  691. endif
  692. export ECHO
  693. ifndef DATE
  694. DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
  695. ifeq ($(DATE),)
  696. DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
  697. ifeq ($(DATE),)
  698. DATE=
  699. else
  700. DATE:=$(firstword $(DATE))
  701. endif
  702. else
  703. DATE:=$(firstword $(DATE))
  704. endif
  705. endif
  706. export DATE
  707. ifndef GINSTALL
  708. GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
  709. ifeq ($(GINSTALL),)
  710. GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
  711. ifeq ($(GINSTALL),)
  712. GINSTALL=
  713. else
  714. GINSTALL:=$(firstword $(GINSTALL))
  715. endif
  716. else
  717. GINSTALL:=$(firstword $(GINSTALL))
  718. endif
  719. endif
  720. export GINSTALL
  721. ifndef CPPROG
  722. CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
  723. ifeq ($(CPPROG),)
  724. CPPROG=
  725. else
  726. CPPROG:=$(firstword $(CPPROG))
  727. endif
  728. endif
  729. export CPPROG
  730. ifndef RMPROG
  731. RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
  732. ifeq ($(RMPROG),)
  733. RMPROG=
  734. else
  735. RMPROG:=$(firstword $(RMPROG))
  736. endif
  737. endif
  738. export RMPROG
  739. ifndef MVPROG
  740. MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
  741. ifeq ($(MVPROG),)
  742. MVPROG=
  743. else
  744. MVPROG:=$(firstword $(MVPROG))
  745. endif
  746. endif
  747. export MVPROG
  748. ifndef ECHOREDIR
  749. ECHOREDIR:=$(subst /,$(PATHSEP),$(ECHO))
  750. endif
  751. ifndef COPY
  752. COPY:=$(CPPROG) -fp
  753. endif
  754. ifndef COPYTREE
  755. COPYTREE:=$(CPPROG) -rfp
  756. endif
  757. ifndef MOVE
  758. MOVE:=$(MVPROG) -f
  759. endif
  760. ifndef DEL
  761. DEL:=$(RMPROG) -f
  762. endif
  763. ifndef DELTREE
  764. DELTREE:=$(RMPROG) -rf
  765. endif
  766. ifndef INSTALL
  767. ifdef inUnix
  768. INSTALL:=$(GINSTALL) -c -m 644
  769. else
  770. INSTALL:=$(COPY)
  771. endif
  772. endif
  773. ifndef INSTALLEXE
  774. ifdef inUnix
  775. INSTALLEXE:=$(GINSTALL) -c -m 755
  776. else
  777. INSTALLEXE:=$(COPY)
  778. endif
  779. endif
  780. ifndef MKDIR
  781. MKDIR:=$(GINSTALL) -m 755 -d
  782. endif
  783. export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
  784. ifndef PPUMOVE
  785. PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
  786. ifeq ($(PPUMOVE),)
  787. PPUMOVE=
  788. else
  789. PPUMOVE:=$(firstword $(PPUMOVE))
  790. endif
  791. endif
  792. export PPUMOVE
  793. ifndef FPCMAKE
  794. FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
  795. ifeq ($(FPCMAKE),)
  796. FPCMAKE=
  797. else
  798. FPCMAKE:=$(firstword $(FPCMAKE))
  799. endif
  800. endif
  801. export FPCMAKE
  802. ifndef ZIPPROG
  803. ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
  804. ifeq ($(ZIPPROG),)
  805. ZIPPROG=
  806. else
  807. ZIPPROG:=$(firstword $(ZIPPROG))
  808. endif
  809. endif
  810. export ZIPPROG
  811. ifndef TARPROG
  812. TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
  813. ifeq ($(TARPROG),)
  814. TARPROG=
  815. else
  816. TARPROG:=$(firstword $(TARPROG))
  817. endif
  818. endif
  819. export TARPROG
  820. ASNAME=as
  821. LDNAME=ld
  822. ARNAME=ar
  823. RCNAME=rc
  824. ifeq ($(OS_TARGET),win32)
  825. ASNAME=asw
  826. LDNAME=ldw
  827. ARNAME=arw
  828. endif
  829. ifndef ASPROG
  830. ifdef CROSSBINDIR
  831. ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
  832. else
  833. ASPROG=$(ASNAME)
  834. endif
  835. endif
  836. ifndef LDPROG
  837. ifdef CROSSBINDIR
  838. LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
  839. else
  840. LDPROG=$(LDNAME)
  841. endif
  842. endif
  843. ifndef RCPROG
  844. ifdef CROSSBINDIR
  845. RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
  846. else
  847. RCPROG=$(RCNAME)
  848. endif
  849. endif
  850. ifndef ARPROG
  851. ifdef CROSSBINDIR
  852. ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
  853. else
  854. ARPROG=$(ARNAME)
  855. endif
  856. endif
  857. AS=$(ASPROG)
  858. LD=$(LDPROG)
  859. RC=$(RCPROG)
  860. AR=$(ARPROG)
  861. PPAS=ppas$(BATCHEXT)
  862. ifdef inUnix
  863. LDCONFIG=ldconfig
  864. else
  865. LDCONFIG=
  866. endif
  867. ifdef DATE
  868. DATESTR:=$(shell $(DATE) +%Y%m%d)
  869. else
  870. DATESTR=
  871. endif
  872. ifndef UPXPROG
  873. ifeq ($(OS_TARGET),go32v2)
  874. UPXPROG:=1
  875. endif
  876. ifeq ($(OS_TARGET),win32)
  877. UPXPROG:=1
  878. endif
  879. ifdef UPXPROG
  880. UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
  881. ifeq ($(UPXPROG),)
  882. UPXPROG=
  883. else
  884. UPXPROG:=$(firstword $(UPXPROG))
  885. endif
  886. else
  887. UPXPROG=
  888. endif
  889. endif
  890. export UPXPROG
  891. ZIPOPT=-9
  892. ZIPEXT=.zip
  893. ifeq ($(USETAR),bz2)
  894. TAROPT=vI
  895. TAREXT=.tar.bz2
  896. else
  897. TAROPT=vz
  898. TAREXT=.tar.gz
  899. endif
  900. override REQUIRE_PACKAGES=rtl
  901. ifeq ($(OS_TARGET),linux)
  902. REQUIRE_PACKAGES_RTL=1
  903. endif
  904. ifeq ($(OS_TARGET),go32v2)
  905. REQUIRE_PACKAGES_RTL=1
  906. endif
  907. ifeq ($(OS_TARGET),win32)
  908. REQUIRE_PACKAGES_RTL=1
  909. endif
  910. ifeq ($(OS_TARGET),os2)
  911. REQUIRE_PACKAGES_RTL=1
  912. endif
  913. ifeq ($(OS_TARGET),freebsd)
  914. REQUIRE_PACKAGES_RTL=1
  915. endif
  916. ifeq ($(OS_TARGET),beos)
  917. REQUIRE_PACKAGES_RTL=1
  918. endif
  919. ifeq ($(OS_TARGET),netbsd)
  920. REQUIRE_PACKAGES_RTL=1
  921. endif
  922. ifeq ($(OS_TARGET),amiga)
  923. REQUIRE_PACKAGES_RTL=1
  924. endif
  925. ifeq ($(OS_TARGET),atari)
  926. REQUIRE_PACKAGES_RTL=1
  927. endif
  928. ifeq ($(OS_TARGET),sunos)
  929. REQUIRE_PACKAGES_RTL=1
  930. endif
  931. ifeq ($(OS_TARGET),qnx)
  932. REQUIRE_PACKAGES_RTL=1
  933. endif
  934. ifeq ($(OS_TARGET),netware)
  935. REQUIRE_PACKAGES_RTL=1
  936. endif
  937. ifeq ($(OS_TARGET),openbsd)
  938. REQUIRE_PACKAGES_RTL=1
  939. endif
  940. ifeq ($(OS_TARGET),wdosx)
  941. REQUIRE_PACKAGES_RTL=1
  942. endif
  943. ifeq ($(OS_TARGET),palmos)
  944. REQUIRE_PACKAGES_RTL=1
  945. endif
  946. ifeq ($(OS_TARGET),macos)
  947. REQUIRE_PACKAGES_RTL=1
  948. endif
  949. ifeq ($(OS_TARGET),macosx)
  950. REQUIRE_PACKAGES_RTL=1
  951. endif
  952. ifeq ($(OS_TARGET),emx)
  953. REQUIRE_PACKAGES_RTL=1
  954. endif
  955. ifdef REQUIRE_PACKAGES_RTL
  956. PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
  957. ifneq ($(PACKAGEDIR_RTL),)
  958. ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
  959. UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
  960. else
  961. UNITDIR_RTL=$(PACKAGEDIR_RTL)
  962. endif
  963. ifdef CHECKDEPEND
  964. $(PACKAGEDIR_RTL)/$(FPCMADE):
  965. $(MAKE) -C $(PACKAGEDIR_RTL) $(FPCMADE)
  966. override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
  967. endif
  968. else
  969. PACKAGEDIR_RTL=
  970. UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
  971. ifneq ($(UNITDIR_RTL),)
  972. UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
  973. else
  974. UNITDIR_RTL=
  975. endif
  976. endif
  977. ifdef UNITDIR_RTL
  978. override COMPILER_UNITDIR+=$(UNITDIR_RTL)
  979. endif
  980. endif
  981. ifndef NOCPUDEF
  982. override FPCOPTDEF=$(CPU_TARGET)
  983. endif
  984. ifneq ($(OS_TARGET),$(OS_SOURCE))
  985. override FPCOPT+=-T$(OS_TARGET)
  986. endif
  987. ifeq ($(OS_SOURCE),openbsd)
  988. override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
  989. endif
  990. ifdef UNITDIR
  991. override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
  992. endif
  993. ifdef LIBDIR
  994. override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
  995. endif
  996. ifdef OBJDIR
  997. override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
  998. endif
  999. ifdef INCDIR
  1000. override FPCOPT+=$(addprefix -Fi,$(INCDIR))
  1001. endif
  1002. ifdef LINKSMART
  1003. override FPCOPT+=-XX
  1004. endif
  1005. ifdef CREATESMART
  1006. override FPCOPT+=-CX
  1007. endif
  1008. ifdef DEBUG
  1009. override FPCOPT+=-gl
  1010. override FPCOPTDEF+=DEBUG
  1011. endif
  1012. ifdef RELEASE
  1013. ifeq ($(CPU_TARGET),i386)
  1014. FPCCPUOPT:=-OG2p3
  1015. else
  1016. FPCCPUOPT:=
  1017. endif
  1018. override FPCOPT+=-Xs $(FPCCPUOPT) -n
  1019. override FPCOPTDEF+=RELEASE
  1020. endif
  1021. ifdef STRIP
  1022. override FPCOPT+=-Xs
  1023. endif
  1024. ifdef OPTIMIZE
  1025. ifeq ($(CPU_TARGET),i386)
  1026. override FPCOPT+=-OG2p3
  1027. endif
  1028. endif
  1029. ifdef VERBOSE
  1030. override FPCOPT+=-vwni
  1031. endif
  1032. ifdef COMPILER_OPTIONS
  1033. override FPCOPT+=$(COMPILER_OPTIONS)
  1034. endif
  1035. ifdef COMPILER_UNITDIR
  1036. override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
  1037. endif
  1038. ifdef COMPILER_LIBRARYDIR
  1039. override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
  1040. endif
  1041. ifdef COMPILER_OBJECTDIR
  1042. override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
  1043. endif
  1044. ifdef COMPILER_INCLUDEDIR
  1045. override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
  1046. endif
  1047. ifdef CROSSBINDIR
  1048. override FPCOPT+=-FD$(CROSSBINDIR)
  1049. endif
  1050. ifdef COMPILER_TARGETDIR
  1051. override FPCOPT+=-FE$(COMPILER_TARGETDIR)
  1052. ifeq ($(COMPILER_TARGETDIR),.)
  1053. override TARGETDIRPREFIX=
  1054. else
  1055. override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
  1056. endif
  1057. endif
  1058. ifdef COMPILER_UNITTARGETDIR
  1059. override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
  1060. ifeq ($(COMPILER_UNITTARGETDIR),.)
  1061. override UNITTARGETDIRPREFIX=
  1062. else
  1063. override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
  1064. endif
  1065. else
  1066. ifdef COMPILER_TARGETDIR
  1067. override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
  1068. override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
  1069. endif
  1070. endif
  1071. ifeq ($(OS_TARGET),linux)
  1072. ifeq ($(FPC_VERSION),1.0.6)
  1073. override FPCOPTDEF+=HASUNIX
  1074. endif
  1075. endif
  1076. ifdef GCCLIBDIR
  1077. override FPCOPT+=-Fl$(GCCLIBDIR)
  1078. endif
  1079. ifdef OTHERLIBDIR
  1080. override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
  1081. endif
  1082. ifdef OPT
  1083. override FPCOPT+=$(OPT)
  1084. endif
  1085. ifdef FPCOPTDEF
  1086. override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
  1087. endif
  1088. ifdef CFGFILE
  1089. override FPCOPT+=@$(CFGFILE)
  1090. endif
  1091. ifdef USEENV
  1092. override FPCEXTCMD:=$(FPCOPT)
  1093. override FPCOPT:=!FPCEXTCMD
  1094. export FPCEXTCMD
  1095. endif
  1096. override COMPILER:=$(FPC) $(FPCOPT)
  1097. ifeq (,$(findstring -s ,$(COMPILER)))
  1098. EXECPPAS=
  1099. else
  1100. ifeq ($(OS_SOURCE),$(OS_TARGET))
  1101. EXECPPAS:=@$(PPAS)
  1102. endif
  1103. endif
  1104. .PHONY: fpc_units
  1105. ifdef TARGET_UNITS
  1106. override ALLTARGET+=fpc_units
  1107. override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
  1108. override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
  1109. override INSTALLPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
  1110. override CLEANPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
  1111. endif
  1112. fpc_units: $(UNITPPUFILES)
  1113. ifdef TARGET_RSTS
  1114. override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
  1115. override CLEANRSTFILES+=$(RSTFILES)
  1116. endif
  1117. .PHONY: fpc_examples
  1118. ifdef TARGET_EXAMPLES
  1119. HASEXAMPLES=1
  1120. override EXAMPLESOURCEFILES:=$(wildcard $(addsuffix .pp,$(TARGET_EXAMPLES)) $(addsuffix .pas,$(TARGET_EXAMPLES)))
  1121. override EXAMPLEFILES:=$(addsuffix $(EXEEXT),$(TARGET_EXAMPLES))
  1122. override EXAMPLEOFILES:=$(addsuffix $(OEXT),$(TARGET_EXAMPLES)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES)))
  1123. override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
  1124. ifeq ($(OS_TARGET),os2)
  1125. override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_EXAMPLES))
  1126. endif
  1127. ifeq ($(OS_TARGET),emx)
  1128. override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_EXAMPLES))
  1129. endif
  1130. endif
  1131. ifdef TARGET_EXAMPLEDIRS
  1132. HASEXAMPLES=1
  1133. endif
  1134. fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
  1135. .PHONY: fpc_all fpc_smart fpc_debug fpc_release
  1136. $(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
  1137. @$(ECHOREDIR) Compiled > $(FPCMADE)
  1138. fpc_all: $(FPCMADE)
  1139. fpc_smart:
  1140. $(MAKE) all LINKSMART=1 CREATESMART=1
  1141. fpc_debug:
  1142. $(MAKE) all DEBUG=1
  1143. fpc_release:
  1144. $(MAKE) all RELEASE=1
  1145. .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
  1146. %$(PPUEXT): %.pp
  1147. $(COMPILER) $<
  1148. $(EXECPPAS)
  1149. %$(PPUEXT): %.pas
  1150. $(COMPILER) $<
  1151. $(EXECPPAS)
  1152. %$(EXEEXT): %.pp
  1153. $(COMPILER) $<
  1154. $(EXECPPAS)
  1155. %$(EXEEXT): %.pas
  1156. $(COMPILER) $<
  1157. $(EXECPPAS)
  1158. %.res: %.rc
  1159. windres -i $< -o $@
  1160. vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  1161. vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  1162. vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
  1163. .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
  1164. ifdef INSTALL_UNITS
  1165. override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
  1166. endif
  1167. ifdef INSTALL_BUILDUNIT
  1168. override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
  1169. endif
  1170. ifdef INSTALLPPUFILES
  1171. override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
  1172. override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPUFILES))
  1173. override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPULINKFILES)))
  1174. override INSTALL_CREATEPACKAGEFPC=1
  1175. endif
  1176. ifdef INSTALLEXEFILES
  1177. override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
  1178. endif
  1179. fpc_install: all $(INSTALLTARGET)
  1180. ifdef INSTALLEXEFILES
  1181. $(MKDIR) $(INSTALL_BINDIR)
  1182. ifdef UPXPROG
  1183. -$(UPXPROG) $(INSTALLEXEFILES)
  1184. endif
  1185. $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
  1186. endif
  1187. ifdef INSTALL_CREATEPACKAGEFPC
  1188. ifdef FPCMAKE
  1189. ifdef PACKAGE_VERSION
  1190. ifneq ($(wildcard Makefile.fpc),)
  1191. $(FPCMAKE) -p -T$(OS_TARGET) Makefile.fpc
  1192. $(MKDIR) $(INSTALL_UNITDIR)
  1193. $(INSTALL) Package.fpc $(INSTALL_UNITDIR)
  1194. endif
  1195. endif
  1196. endif
  1197. endif
  1198. ifdef INSTALLPPUFILES
  1199. $(MKDIR) $(INSTALL_UNITDIR)
  1200. $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
  1201. ifneq ($(INSTALLPPULINKFILES),)
  1202. $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
  1203. endif
  1204. ifneq ($(wildcard $(LIB_FULLNAME)),)
  1205. $(MKDIR) $(INSTALL_LIBDIR)
  1206. $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
  1207. ifdef inUnix
  1208. ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
  1209. endif
  1210. endif
  1211. endif
  1212. ifdef INSTALL_FILES
  1213. $(MKDIR) $(INSTALL_DATADIR)
  1214. $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
  1215. endif
  1216. fpc_sourceinstall: distclean
  1217. $(MKDIR) $(INSTALL_SOURCEDIR)
  1218. $(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
  1219. fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
  1220. ifdef HASEXAMPLES
  1221. $(MKDIR) $(INSTALL_EXAMPLEDIR)
  1222. endif
  1223. ifdef EXAMPLESOURCEFILES
  1224. $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
  1225. endif
  1226. ifdef TARGET_EXAMPLEDIRS
  1227. $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
  1228. endif
  1229. .PHONY: fpc_distinstall
  1230. fpc_distinstall: install exampleinstall
  1231. .PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall
  1232. ifndef PACKDIR
  1233. ifndef inUnix
  1234. PACKDIR=$(BASEDIR)/../fpc-pack
  1235. else
  1236. PACKDIR=/tmp/fpc-pack
  1237. endif
  1238. endif
  1239. ifndef ZIPNAME
  1240. ifdef DIST_ZIPNAME
  1241. ZIPNAME=$(DIST_ZIPNAME)
  1242. else
  1243. ZIPNAME=$(ZIPPREFIX)$(PACKAGE_NAME)$(ZIPSUFFIX)
  1244. endif
  1245. endif
  1246. ifndef ZIPTARGET
  1247. ifdef DIST_ZIPTARGET
  1248. ZIPTARGET=DIST_ZIPTARGET
  1249. else
  1250. ZIPTARGET=install
  1251. endif
  1252. endif
  1253. ifndef USEZIP
  1254. ifdef inUnix
  1255. USETAR=1
  1256. endif
  1257. endif
  1258. ifndef inUnix
  1259. USEZIPWRAPPER=1
  1260. endif
  1261. ifdef USEZIPWRAPPER
  1262. ZIPPATHSEP=$(PATHSEP)
  1263. ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(BATCHEXT))
  1264. else
  1265. ZIPPATHSEP=/
  1266. endif
  1267. ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
  1268. ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
  1269. ifdef USETAR
  1270. ZIPDESTFILE:=$(DIST_DESTDIR)/$(ZIPNAME)$(TAREXT)
  1271. ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *
  1272. else
  1273. ZIPDESTFILE:=$(DIST_DESTDIR)/$(ZIPNAME)$(ZIPEXT)
  1274. ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
  1275. endif
  1276. fpc_zipinstall:
  1277. $(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1
  1278. $(MKDIR) $(DIST_DESTDIR)
  1279. $(DEL) $(ZIPDESTFILE)
  1280. ifdef USEZIPWRAPPER
  1281. ifneq ($(ECHOREDIR),echo)
  1282. $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER)
  1283. $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)
  1284. $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER)
  1285. else
  1286. echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)
  1287. echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)
  1288. echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)
  1289. endif
  1290. ifdef inUnix
  1291. /bin/sh $(ZIPWRAPPER)
  1292. else
  1293. $(ZIPWRAPPER)
  1294. endif
  1295. $(DEL) $(ZIPWRAPPER)
  1296. else
  1297. $(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)
  1298. endif
  1299. $(DELTREE) $(PACKDIR)
  1300. fpc_zipsourceinstall:
  1301. $(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=src
  1302. fpc_zipexampleinstall:
  1303. ifdef HASEXAMPLES
  1304. $(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=exm
  1305. endif
  1306. fpc_zipdistinstall:
  1307. $(MAKE) fpc_zipinstall ZIPTARGET=distinstall
  1308. .PHONY: fpc_clean fpc_cleanall fpc_distclean
  1309. ifdef EXEFILES
  1310. override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
  1311. endif
  1312. ifdef CLEAN_UNITS
  1313. override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
  1314. endif
  1315. ifdef CLEANPPUFILES
  1316. override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
  1317. override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
  1318. override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
  1319. endif
  1320. fpc_clean: $(CLEANTARGET)
  1321. ifdef CLEANEXEFILES
  1322. -$(DEL) $(CLEANEXEFILES)
  1323. endif
  1324. ifdef CLEANPPUFILES
  1325. -$(DEL) $(CLEANPPUFILES)
  1326. endif
  1327. ifneq ($(CLEANPPULINKFILES),)
  1328. -$(DEL) $(CLEANPPULINKFILES)
  1329. endif
  1330. ifdef CLEANRSTFILES
  1331. -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
  1332. endif
  1333. ifdef CLEAN_FILES
  1334. -$(DEL) $(CLEAN_FILES)
  1335. endif
  1336. ifdef LIB_NAME
  1337. -$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
  1338. endif
  1339. -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  1340. fpc_distclean: clean
  1341. ifdef COMPILER_UNITTARGETDIR
  1342. TARGETDIRCLEAN=fpc_clean
  1343. endif
  1344. fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
  1345. ifdef CLEANEXEFILES
  1346. -$(DEL) $(CLEANEXEFILES)
  1347. endif
  1348. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  1349. -$(DELTREE) *$(SMARTEXT)
  1350. -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  1351. ifdef AOUTEXT
  1352. -$(DEL) *$(AOUTEXT)
  1353. endif
  1354. .PHONY: fpc_baseinfo
  1355. override INFORULES+=fpc_baseinfo
  1356. fpc_baseinfo:
  1357. @$(ECHO)
  1358. @$(ECHO) == Package info ==
  1359. @$(ECHO) Package Name..... $(PACKAGE_NAME)
  1360. @$(ECHO) Package Version.. $(PACKAGE_VERSION)
  1361. @$(ECHO)
  1362. @$(ECHO) == Configuration info ==
  1363. @$(ECHO)
  1364. @$(ECHO) FPC.......... $(FPC)
  1365. @$(ECHO) FPC Version.. $(FPC_VERSION)
  1366. @$(ECHO) Source CPU... $(CPU_SOURCE)
  1367. @$(ECHO) Target CPU... $(CPU_TARGET)
  1368. @$(ECHO) Source OS.... $(OS_SOURCE)
  1369. @$(ECHO) Target OS.... $(OS_TARGET)
  1370. @$(ECHO) Full Source.. $(FULL_SOURCE)
  1371. @$(ECHO) Full Target.. $(FULL_TARGET)
  1372. @$(ECHO)
  1373. @$(ECHO) == Directory info ==
  1374. @$(ECHO)
  1375. @$(ECHO) Required pkgs... $(REQUIRE_PACKAGES)
  1376. @$(ECHO)
  1377. @$(ECHO) Basedir......... $(BASEDIR)
  1378. @$(ECHO) FPCDir.......... $(FPCDIR)
  1379. @$(ECHO) CrossBinDir..... $(CROSSBINDIR)
  1380. @$(ECHO) UnitsDir........ $(UNITSDIR)
  1381. @$(ECHO) PackagesDir..... $(PACKAGESDIR)
  1382. @$(ECHO)
  1383. @$(ECHO) GCC library..... $(GCCLIBDIR)
  1384. @$(ECHO) Other library... $(OTHERLIBDIR)
  1385. @$(ECHO)
  1386. @$(ECHO) == Tools info ==
  1387. @$(ECHO)
  1388. @$(ECHO) As........ $(AS)
  1389. @$(ECHO) Ld........ $(LD)
  1390. @$(ECHO) Ar........ $(AR)
  1391. @$(ECHO) Rc........ $(RC)
  1392. @$(ECHO)
  1393. @$(ECHO) Mv........ $(MVPROG)
  1394. @$(ECHO) Cp........ $(CPPROG)
  1395. @$(ECHO) Rm........ $(RMPROG)
  1396. @$(ECHO) GInstall.. $(GINSTALL)
  1397. @$(ECHO) Echo...... $(ECHO)
  1398. @$(ECHO) Shell..... $(SHELL)
  1399. @$(ECHO) Date...... $(DATE)
  1400. @$(ECHO) FPCMake... $(FPCMAKE)
  1401. @$(ECHO) PPUMove... $(PPUMOVE)
  1402. @$(ECHO) Upx....... $(UPXPROG)
  1403. @$(ECHO) Zip....... $(ZIPPROG)
  1404. @$(ECHO)
  1405. @$(ECHO) == Object info ==
  1406. @$(ECHO)
  1407. @$(ECHO) Target Loaders........ $(TARGET_LOADERS)
  1408. @$(ECHO) Target Units.......... $(TARGET_UNITS)
  1409. @$(ECHO) Target Implicit Units. $(TARGET_IMPLICITUNITS)
  1410. @$(ECHO) Target Programs....... $(TARGET_PROGRAMS)
  1411. @$(ECHO) Target Dirs........... $(TARGET_DIRS)
  1412. @$(ECHO) Target Examples....... $(TARGET_EXAMPLES)
  1413. @$(ECHO) Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
  1414. @$(ECHO)
  1415. @$(ECHO) Clean Units......... $(CLEAN_UNITS)
  1416. @$(ECHO) Clean Files......... $(CLEAN_FILES)
  1417. @$(ECHO)
  1418. @$(ECHO) Install Units....... $(INSTALL_UNITS)
  1419. @$(ECHO) Install Files....... $(INSTALL_FILES)
  1420. @$(ECHO)
  1421. @$(ECHO) == Install info ==
  1422. @$(ECHO)
  1423. @$(ECHO) DateStr.............. $(DATESTR)
  1424. @$(ECHO) ZipPrefix............ $(ZIPPREFIX)
  1425. @$(ECHO) ZipSuffix............ $(ZIPSUFFIX)
  1426. @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE)
  1427. @$(ECHO)
  1428. @$(ECHO) Install base dir..... $(INSTALL_BASEDIR)
  1429. @$(ECHO) Install binary dir... $(INSTALL_BINDIR)
  1430. @$(ECHO) Install library dir.. $(INSTALL_LIBDIR)
  1431. @$(ECHO) Install units dir.... $(INSTALL_UNITDIR)
  1432. @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR)
  1433. @$(ECHO) Install doc dir...... $(INSTALL_DOCDIR)
  1434. @$(ECHO) Install example dir.. $(INSTALL_EXAMPLEDIR)
  1435. @$(ECHO) Install data dir..... $(INSTALL_DATADIR)
  1436. @$(ECHO)
  1437. @$(ECHO) Dist destination dir. $(DIST_DESTDIR)
  1438. @$(ECHO) Dist zip name........ $(DIST_ZIPNAME)
  1439. @$(ECHO)
  1440. .PHONY: fpc_info
  1441. fpc_info: $(INFORULES)
  1442. .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
  1443. fpc_makefile_dirs
  1444. fpc_makefile:
  1445. $(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
  1446. fpc_makefile_sub1:
  1447. ifdef TARGET_DIRS
  1448. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
  1449. endif
  1450. ifdef TARGET_EXAMPLEDIRS
  1451. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
  1452. endif
  1453. fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
  1454. fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
  1455. fpc_makefiles: fpc_makefile fpc_makefile_dirs
  1456. all: fpc_all
  1457. debug: fpc_debug
  1458. smart: fpc_smart
  1459. release: fpc_release
  1460. examples: fpc_examples
  1461. shared:
  1462. install: fpc_install
  1463. sourceinstall: fpc_sourceinstall
  1464. exampleinstall: fpc_exampleinstall
  1465. distinstall: fpc_distinstall
  1466. zipinstall: fpc_zipinstall
  1467. zipsourceinstall: fpc_zipsourceinstall
  1468. zipexampleinstall: fpc_zipexampleinstall
  1469. zipdistinstall: fpc_zipdistinstall
  1470. distclean: fpc_distclean
  1471. cleanall: fpc_cleanall
  1472. info: fpc_info
  1473. makefiles: fpc_makefiles
  1474. .PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall distclean cleanall info makefiles
  1475. ifneq ($(wildcard fpcmake.loc),)
  1476. include fpcmake.loc
  1477. endif
  1478. ifeq ($(OS_SOURCE)$(CPU_SOURCE),$(OS_TARGET)$(CPU_TARGET))
  1479. ifeq ($(GDBFOUND),1)
  1480. $(CURRDIR)getver$(EXEEXT) : gdbver.pp
  1481. $(COMPILER) -o$(CURRDIR)getver$(EXEEXT) gdbver.pp
  1482. ifndef GOTGDBVER
  1483. gdbint$(PPUEXT): $(CURRDIR)gdbver$(EXEEXT)
  1484. $(MAKE) gdbint$(PPUEXT) GOTGDBVER=1
  1485. else
  1486. GDBVER:=GDB_V$(strip $(shell $(CURRDIR)gdbver$(EXEEXT) -n))
  1487. gdbint$(PPUEXT): gdbint.pp
  1488. @$(ECHO) Using GDB $(GDBVER)
  1489. $(COMPILER) -d$(GDBVER) gdbint.pp
  1490. $(DEL) gdbver$(EXEEXT) gdbver$(OEXT)
  1491. endif
  1492. else
  1493. GDBVER=GDB_V5
  1494. gdbint$(PPUEXT): gdbint.pp
  1495. @$(ECHO) libgdb.a not found, using default GDB $(GDBVER)
  1496. $(COMPILER) -d$(GDBVER) gdbint.pp
  1497. endif
  1498. else
  1499. GDBVER=GDB_V5
  1500. gdbint$(PPUEXT): gdbint.pp
  1501. @$(ECHO) Different target os or cpu, using default GDB $(GDBVER)
  1502. $(COMPILER) -d$(GDBVER) gdbint.pp
  1503. endif
  1504. gdbcon$(PPUEXT): gdbcon.pp gdbint$(PPUEXT)
  1505. ifeq ($(OS_TARGET),go32v2)
  1506. DBGCOM=dbgcom$(OEXT)
  1507. else
  1508. DBGCOM=
  1509. endif
  1510. ifdef $(COMPILEDBGCOM)
  1511. $(DBGCOM): ../v4.16/dbgcom.c
  1512. gcc -c -DFPC -Dother_sel -gstabs -o dbgcom.o -I../v4.16 ../v4.16/dbgcom.c
  1513. else
  1514. $(DBGCOM):
  1515. endif
  1516. simple: $(DBGCOM)
  1517. -rm gdbint.ppu
  1518. ppc386 -dUSE_LIBGDB gdbint
  1519. ppc386 testgdb
  1520. testgdb$(EXEEXT): testgdb.pp gdbint$(PPUEXT) gdbcon$(PPUEXT) $(DBGCOM)
  1521. .PHONY: test
  1522. test: examples
  1523. clean: fpc_clean
  1524. $(DEL) gdbver$(EXEEXT) gdbver$(OEXT)