Makefile 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764
  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=fpgtk
  207. override PACKAGE_VERSION=1.0.8
  208. override TARGET_UNITS+=fpglib fpgtk fpgtkext
  209. override INSTALL_FPCPACKAGE=y
  210. ifdef REQUIRE_UNITSDIR
  211. override UNITSDIR+=$(REQUIRE_UNITSDIR)
  212. endif
  213. ifdef REQUIRE_PACKAGESDIR
  214. override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
  215. endif
  216. ifdef ZIPINSTALL
  217. ifeq ($(OS_TARGET),linux)
  218. UNIXINSTALLDIR=1
  219. endif
  220. ifeq ($(OS_TARGET),freebsd)
  221. UNIXINSTALLDIR=1
  222. endif
  223. ifeq ($(OS_TARGET),netbsd)
  224. UNIXINSTALLDIR=1
  225. endif
  226. ifeq ($(OS_TARGET),openbsd)
  227. UNIXINSTALLDIR=1
  228. endif
  229. ifeq ($(OS_TARGET),sunos)
  230. UNIXINSTALLDIR=1
  231. endif
  232. ifeq ($(OS_TARGET),qnx)
  233. UNIXINSTALLDIR=1
  234. endif
  235. else
  236. ifeq ($(OS_SOURCE),linux)
  237. UNIXINSTALLDIR=1
  238. endif
  239. ifeq ($(OS_SOURCE),freebsd)
  240. UNIXINSTALLDIR=1
  241. endif
  242. ifeq ($(OS_SOURCE),netbsd)
  243. UNIXINSTALLDIR=1
  244. endif
  245. ifeq ($(OS_SOURCE),openbsd)
  246. UNIXINSTALLDIR=1
  247. endif
  248. ifeq ($(OS_TARGET),sunos)
  249. UNIXINSTALLDIR=1
  250. endif
  251. ifeq ($(OS_TARGET),qnx)
  252. UNIXINSTALLDIR=1
  253. endif
  254. endif
  255. ifndef INSTALL_PREFIX
  256. ifdef PREFIX
  257. INSTALL_PREFIX=$(PREFIX)
  258. endif
  259. endif
  260. ifndef INSTALL_PREFIX
  261. ifdef UNIXINSTALLDIR
  262. INSTALL_PREFIX=/usr/local
  263. else
  264. ifdef INSTALL_FPCPACKAGE
  265. INSTALL_BASEDIR:=/pp
  266. else
  267. INSTALL_BASEDIR:=/$(PACKAGE_NAME)
  268. endif
  269. endif
  270. endif
  271. export INSTALL_PREFIX
  272. ifdef INSTALL_FPCSUBDIR
  273. export INSTALL_FPCSUBDIR
  274. endif
  275. ifndef DIST_DESTDIR
  276. DIST_DESTDIR:=$(BASEDIR)
  277. endif
  278. export DIST_DESTDIR
  279. ifndef INSTALL_BASEDIR
  280. ifdef UNIXINSTALLDIR
  281. ifdef INSTALL_FPCPACKAGE
  282. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
  283. else
  284. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
  285. endif
  286. else
  287. INSTALL_BASEDIR:=$(INSTALL_PREFIX)
  288. endif
  289. endif
  290. ifndef INSTALL_BINDIR
  291. ifdef UNIXINSTALLDIR
  292. INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
  293. else
  294. INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
  295. ifdef INSTALL_FPCPACKAGE
  296. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)
  297. endif
  298. endif
  299. endif
  300. ifndef INSTALL_UNITDIR
  301. ifdef CROSSCOMPILE
  302. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/units
  303. else
  304. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(OS_TARGET)
  305. endif
  306. ifdef INSTALL_FPCPACKAGE
  307. ifdef PACKAGE_NAME
  308. INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
  309. endif
  310. endif
  311. endif
  312. ifndef INSTALL_LIBDIR
  313. ifdef UNIXINSTALLDIR
  314. INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
  315. else
  316. INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
  317. endif
  318. endif
  319. ifndef INSTALL_SOURCEDIR
  320. ifdef UNIXINSTALLDIR
  321. ifdef BSDhier
  322. SRCPREFIXDIR=share/src
  323. else
  324. SRCPREFIXDIR=src
  325. endif
  326. ifdef INSTALL_FPCPACKAGE
  327. ifdef INSTALL_FPCSUBDIR
  328. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  329. else
  330. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  331. endif
  332. else
  333. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  334. endif
  335. else
  336. ifdef INSTALL_FPCPACKAGE
  337. ifdef INSTALL_FPCSUBDIR
  338. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  339. else
  340. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
  341. endif
  342. else
  343. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
  344. endif
  345. endif
  346. endif
  347. ifndef INSTALL_DOCDIR
  348. ifdef UNIXINSTALLDIR
  349. ifdef BSDhier
  350. DOCPREFIXDIR=share/doc
  351. else
  352. DOCPREFIXDIR=doc
  353. endif
  354. ifdef INSTALL_FPCPACKAGE
  355. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  356. else
  357. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  358. endif
  359. else
  360. ifdef INSTALL_FPCPACKAGE
  361. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
  362. else
  363. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
  364. endif
  365. endif
  366. endif
  367. ifndef INSTALL_EXAMPLEDIR
  368. ifdef UNIXINSTALLDIR
  369. ifdef INSTALL_FPCPACKAGE
  370. ifdef BSDhier
  371. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  372. else
  373. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
  374. endif
  375. else
  376. ifdef BSDhier
  377. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  378. else
  379. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  380. endif
  381. endif
  382. else
  383. ifdef INSTALL_FPCPACKAGE
  384. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
  385. else
  386. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
  387. endif
  388. endif
  389. endif
  390. ifndef INSTALL_DATADIR
  391. INSTALL_DATADIR=$(INSTALL_BASEDIR)
  392. endif
  393. ifdef CROSSCOMPILE
  394. ifndef CROSSBINDIR
  395. CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(FULL_SOURCE))
  396. ifeq ($(CROSSBINDIR),)
  397. CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/bin/$(FULL_SOURCE))
  398. endif
  399. endif
  400. else
  401. CROSSBINDIR=
  402. endif
  403. ifdef inUnix
  404. ifndef GCCLIBDIR
  405. GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
  406. endif
  407. ifeq ($(OS_TARGET),linux)
  408. ifndef OTHERLIBDIR
  409. OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
  410. endif
  411. endif
  412. ifeq ($(OS_TARGET),netbsd)
  413. OTHERLIBDIR+=/usr/pkg/lib
  414. endif
  415. export GCCLIBDIR OTHERLIB
  416. endif
  417. LOADEREXT=.as
  418. EXEEXT=.exe
  419. PPLEXT=.ppl
  420. PPUEXT=.ppu
  421. OEXT=.o
  422. ASMEXT=.s
  423. SMARTEXT=.sl
  424. STATICLIBEXT=.a
  425. SHAREDLIBEXT=.so
  426. STATICLIBPREFIX=libp
  427. RSTEXT=.rst
  428. FPCMADE=fpcmade
  429. ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
  430. ifeq ($(OS_TARGET),go32v1)
  431. STATICLIBPREFIX=
  432. FPCMADE=fpcmade.v1
  433. PACKAGESUFFIX=v1
  434. endif
  435. ifeq ($(OS_TARGET),go32v2)
  436. STATICLIBPREFIX=
  437. FPCMADE=fpcmade.dos
  438. ZIPSUFFIX=go32
  439. endif
  440. ifeq ($(OS_TARGET),linux)
  441. EXEEXT=
  442. HASSHAREDLIB=1
  443. FPCMADE=fpcmade.lnx
  444. ZIPSUFFIX=linux
  445. endif
  446. ifeq ($(OS_TARGET),freebsd)
  447. EXEEXT=
  448. HASSHAREDLIB=1
  449. FPCMADE=fpcmade.freebsd
  450. ZIPSUFFIX=freebsd
  451. endif
  452. ifeq ($(OS_TARGET),netbsd)
  453. EXEEXT=
  454. HASSHAREDLIB=1
  455. FPCMADE=fpcmade.netbsd
  456. ZIPSUFFIX=netbsd
  457. endif
  458. ifeq ($(OS_TARGET),openbsd)
  459. EXEEXT=
  460. HASSHAREDLIB=1
  461. FPCMADE=fpcmade.openbsd
  462. ZIPSUFFIX=openbsd
  463. endif
  464. ifeq ($(OS_TARGET),win32)
  465. SHAREDLIBEXT=.dll
  466. FPCMADE=fpcmade.w32
  467. ZIPSUFFIX=w32
  468. endif
  469. ifeq ($(OS_TARGET),os2)
  470. AOUTEXT=.out
  471. STATICLIBPREFIX=
  472. SHAREDLIBEXT=.dll
  473. FPCMADE=fpcmade.os2
  474. ZIPSUFFIX=os2
  475. ECHO=echo
  476. endif
  477. ifeq ($(OS_TARGET),emx)
  478. AOUTEXT=.out
  479. STATICLIBPREFIX=
  480. SHAREDLIBEXT=.dll
  481. FPCMADE=fpcmade.emx
  482. ZIPSUFFIX=emx
  483. ECHO=echo
  484. endif
  485. ifeq ($(OS_TARGET),amiga)
  486. EXEEXT=
  487. SHAREDLIBEXT=.library
  488. FPCMADE=fpcmade.amg
  489. endif
  490. ifeq ($(OS_TARGET),atari)
  491. EXEEXT=.ttp
  492. FPCMADE=fpcmade.ata
  493. endif
  494. ifeq ($(OS_TARGET),beos)
  495. EXEEXT=
  496. FPCMADE=fpcmade.be
  497. ZIPSUFFIX=be
  498. endif
  499. ifeq ($(OS_TARGET),sunos)
  500. EXEEXT=
  501. FPCMADE=fpcmade.sun
  502. ZIPSUFFIX=sun
  503. endif
  504. ifeq ($(OS_TARGET),qnx)
  505. EXEEXT=
  506. FPCMADE=fpcmade.qnx
  507. ZIPSUFFIX=qnx
  508. endif
  509. ifeq ($(OS_TARGET),netware)
  510. EXEEXT=.nlm
  511. STATICLIBPREFIX=
  512. FPCMADE=fpcmade.nw
  513. ZIPSUFFIX=nw
  514. endif
  515. ifeq ($(OS_TARGET),macos)
  516. EXEEXT=
  517. FPCMADE=fpcmade.mcc
  518. endif
  519. else
  520. ifeq ($(OS_TARGET),go32v1)
  521. PPUEXT=.pp1
  522. OEXT=.o1
  523. ASMEXT=.s1
  524. SMARTEXT=.sl1
  525. STATICLIBEXT=.a1
  526. SHAREDLIBEXT=.so1
  527. STATICLIBPREFIX=
  528. FPCMADE=fpcmade.v1
  529. PACKAGESUFFIX=v1
  530. endif
  531. ifeq ($(OS_TARGET),go32v2)
  532. STATICLIBPREFIX=
  533. FPCMADE=fpcmade.dos
  534. ZIPSUFFIX=go32
  535. endif
  536. ifeq ($(OS_TARGET),linux)
  537. EXEEXT=
  538. HASSHAREDLIB=1
  539. FPCMADE=fpcmade.lnx
  540. ZIPSUFFIX=linux
  541. endif
  542. ifeq ($(OS_TARGET),freebsd)
  543. EXEEXT=
  544. HASSHAREDLIB=1
  545. FPCMADE=fpcmade.freebsd
  546. ZIPSUFFIX=freebsd
  547. endif
  548. ifeq ($(OS_TARGET),netbsd)
  549. EXEEXT=
  550. HASSHAREDLIB=1
  551. FPCMADE=fpcmade.netbsd
  552. ZIPSUFFIX=netbsd
  553. endif
  554. ifeq ($(OS_TARGET),openbsd)
  555. EXEEXT=
  556. HASSHAREDLIB=1
  557. FPCMADE=fpcmade.openbsd
  558. ZIPSUFFIX=openbsd
  559. endif
  560. ifeq ($(OS_TARGET),win32)
  561. PPUEXT=.ppw
  562. OEXT=.ow
  563. ASMEXT=.sw
  564. SMARTEXT=.slw
  565. STATICLIBEXT=.aw
  566. SHAREDLIBEXT=.dll
  567. FPCMADE=fpcmade.w32
  568. ZIPSUFFIX=w32
  569. endif
  570. ifeq ($(OS_TARGET),os2)
  571. PPUEXT=.ppo
  572. ASMEXT=.so2
  573. OEXT=.oo2
  574. AOUTEXT=.out
  575. SMARTEXT=.sl2
  576. STATICLIBPREFIX=
  577. STATICLIBEXT=.ao2
  578. SHAREDLIBEXT=.dll
  579. FPCMADE=fpcmade.os2
  580. ZIPSUFFIX=emx
  581. ECHO=echo
  582. endif
  583. ifeq ($(OS_TARGET),amiga)
  584. EXEEXT=
  585. PPUEXT=.ppu
  586. ASMEXT=.asm
  587. OEXT=.o
  588. SMARTEXT=.sl
  589. STATICLIBEXT=.a
  590. SHAREDLIBEXT=.library
  591. FPCMADE=fpcmade.amg
  592. endif
  593. ifeq ($(OS_TARGET),atari)
  594. PPUEXT=.ppu
  595. ASMEXT=.s
  596. OEXT=.o
  597. SMARTEXT=.sl
  598. STATICLIBEXT=.a
  599. EXEEXT=.ttp
  600. FPCMADE=fpcmade.ata
  601. endif
  602. ifeq ($(OS_TARGET),beos)
  603. PPUEXT=.ppu
  604. ASMEXT=.s
  605. OEXT=.o
  606. SMARTEXT=.sl
  607. STATICLIBEXT=.a
  608. EXEEXT=
  609. FPCMADE=fpcmade.be
  610. ZIPSUFFIX=be
  611. endif
  612. ifeq ($(OS_TARGET),sunos)
  613. PPUEXT=.ppu
  614. ASMEXT=.s
  615. OEXT=.o
  616. SMARTEXT=.sl
  617. STATICLIBEXT=.a
  618. EXEEXT=
  619. FPCMADE=fpcmade.sun
  620. ZIPSUFFIX=sun
  621. endif
  622. ifeq ($(OS_TARGET),qnx)
  623. PPUEXT=.ppu
  624. ASMEXT=.s
  625. OEXT=.o
  626. SMARTEXT=.sl
  627. STATICLIBEXT=.a
  628. EXEEXT=
  629. FPCMADE=fpcmade.qnx
  630. ZIPSUFFIX=qnx
  631. endif
  632. ifeq ($(OS_TARGET),netware)
  633. STATICLIBPREFIX=
  634. PPUEXT=.ppu
  635. OEXT=.o
  636. ASMEXT=.s
  637. SMARTEXT=.sl
  638. STATICLIBEXT=.a
  639. SHAREDLIBEXT=.nlm
  640. FPCMADE=fpcmade.nw
  641. ZIPSUFFIX=nw
  642. EXEEXT=.nlm
  643. endif
  644. ifeq ($(OS_TARGET),macos)
  645. PPUEXT=.ppu
  646. ASMEXT=.s
  647. OEXT=.o
  648. SMARTEXT=.sl
  649. STATICLIBEXT=.a
  650. EXEEXT=
  651. FPCMADE=fpcmade.mcc
  652. endif
  653. endif
  654. ifndef ECHO
  655. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  656. ifeq ($(ECHO),)
  657. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  658. ifeq ($(ECHO),)
  659. ECHO=
  660. else
  661. ECHO:=$(firstword $(ECHO))
  662. endif
  663. else
  664. ECHO:=$(firstword $(ECHO))
  665. endif
  666. endif
  667. export ECHO
  668. ifndef DATE
  669. DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
  670. ifeq ($(DATE),)
  671. DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
  672. ifeq ($(DATE),)
  673. DATE=
  674. else
  675. DATE:=$(firstword $(DATE))
  676. endif
  677. else
  678. DATE:=$(firstword $(DATE))
  679. endif
  680. endif
  681. export DATE
  682. ifndef GINSTALL
  683. GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
  684. ifeq ($(GINSTALL),)
  685. GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
  686. ifeq ($(GINSTALL),)
  687. GINSTALL=
  688. else
  689. GINSTALL:=$(firstword $(GINSTALL))
  690. endif
  691. else
  692. GINSTALL:=$(firstword $(GINSTALL))
  693. endif
  694. endif
  695. export GINSTALL
  696. ifndef CPPROG
  697. CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
  698. ifeq ($(CPPROG),)
  699. CPPROG=
  700. else
  701. CPPROG:=$(firstword $(CPPROG))
  702. endif
  703. endif
  704. export CPPROG
  705. ifndef RMPROG
  706. RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
  707. ifeq ($(RMPROG),)
  708. RMPROG=
  709. else
  710. RMPROG:=$(firstword $(RMPROG))
  711. endif
  712. endif
  713. export RMPROG
  714. ifndef MVPROG
  715. MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
  716. ifeq ($(MVPROG),)
  717. MVPROG=
  718. else
  719. MVPROG:=$(firstword $(MVPROG))
  720. endif
  721. endif
  722. export MVPROG
  723. ifndef ECHOREDIR
  724. ECHOREDIR:=$(subst /,$(PATHSEP),$(ECHO))
  725. endif
  726. ifndef COPY
  727. COPY:=$(CPPROG) -fp
  728. endif
  729. ifndef COPYTREE
  730. COPYTREE:=$(CPPROG) -rfp
  731. endif
  732. ifndef MOVE
  733. MOVE:=$(MVPROG) -f
  734. endif
  735. ifndef DEL
  736. DEL:=$(RMPROG) -f
  737. endif
  738. ifndef DELTREE
  739. DELTREE:=$(RMPROG) -rf
  740. endif
  741. ifndef INSTALL
  742. ifdef inUnix
  743. INSTALL:=$(GINSTALL) -c -m 644
  744. else
  745. INSTALL:=$(COPY)
  746. endif
  747. endif
  748. ifndef INSTALLEXE
  749. ifdef inUnix
  750. INSTALLEXE:=$(GINSTALL) -c -m 755
  751. else
  752. INSTALLEXE:=$(COPY)
  753. endif
  754. endif
  755. ifndef MKDIR
  756. MKDIR:=$(GINSTALL) -m 755 -d
  757. endif
  758. export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
  759. ifndef PPUMOVE
  760. PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
  761. ifeq ($(PPUMOVE),)
  762. PPUMOVE=
  763. else
  764. PPUMOVE:=$(firstword $(PPUMOVE))
  765. endif
  766. endif
  767. export PPUMOVE
  768. ifndef FPCMAKE
  769. FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
  770. ifeq ($(FPCMAKE),)
  771. FPCMAKE=
  772. else
  773. FPCMAKE:=$(firstword $(FPCMAKE))
  774. endif
  775. endif
  776. export FPCMAKE
  777. ifndef ZIPPROG
  778. ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
  779. ifeq ($(ZIPPROG),)
  780. ZIPPROG=
  781. else
  782. ZIPPROG:=$(firstword $(ZIPPROG))
  783. endif
  784. endif
  785. export ZIPPROG
  786. ifndef TARPROG
  787. TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
  788. ifeq ($(TARPROG),)
  789. TARPROG=
  790. else
  791. TARPROG:=$(firstword $(TARPROG))
  792. endif
  793. endif
  794. export TARPROG
  795. ASNAME=as
  796. LDNAME=ld
  797. ARNAME=ar
  798. RCNAME=rc
  799. ifeq ($(OS_TARGET),win32)
  800. ASNAME=asw
  801. LDNAME=ldw
  802. ARNAME=arw
  803. endif
  804. ifndef ASPROG
  805. ifdef CROSSBINDIR
  806. ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
  807. else
  808. ASPROG=$(ASNAME)
  809. endif
  810. endif
  811. ifndef LDPROG
  812. ifdef CROSSBINDIR
  813. LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
  814. else
  815. LDPROG=$(LDNAME)
  816. endif
  817. endif
  818. ifndef RCPROG
  819. ifdef CROSSBINDIR
  820. RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
  821. else
  822. RCPROG=$(RCNAME)
  823. endif
  824. endif
  825. ifndef ARPROG
  826. ifdef CROSSBINDIR
  827. ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
  828. else
  829. ARPROG=$(ARNAME)
  830. endif
  831. endif
  832. AS=$(ASPROG)
  833. LD=$(LDPROG)
  834. RC=$(RCPROG)
  835. AR=$(ARPROG)
  836. PPAS=ppas$(BATCHEXT)
  837. ifdef inUnix
  838. LDCONFIG=ldconfig
  839. else
  840. LDCONFIG=
  841. endif
  842. ifdef DATE
  843. DATESTR:=$(shell $(DATE) +%Y%m%d)
  844. else
  845. DATESTR=
  846. endif
  847. ifndef UPXPROG
  848. ifeq ($(OS_TARGET),go32v2)
  849. UPXPROG:=1
  850. endif
  851. ifeq ($(OS_TARGET),win32)
  852. UPXPROG:=1
  853. endif
  854. ifdef UPXPROG
  855. UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
  856. ifeq ($(UPXPROG),)
  857. UPXPROG=
  858. else
  859. UPXPROG:=$(firstword $(UPXPROG))
  860. endif
  861. else
  862. UPXPROG=
  863. endif
  864. endif
  865. export UPXPROG
  866. ZIPOPT=-9
  867. ZIPEXT=.zip
  868. ifeq ($(USETAR),bz2)
  869. TAROPT=vI
  870. TAREXT=.tar.bz2
  871. else
  872. TAROPT=vz
  873. TAREXT=.tar.gz
  874. endif
  875. override REQUIRE_PACKAGES=rtl fcl gtk
  876. ifeq ($(OS_TARGET),linux)
  877. REQUIRE_PACKAGES_RTL=1
  878. REQUIRE_PACKAGES_PASZLIB=1
  879. REQUIRE_PACKAGES_NETDB=1
  880. REQUIRE_PACKAGES_LIBASYNC=1
  881. REQUIRE_PACKAGES_FCL=1
  882. REQUIRE_PACKAGES_GTK=1
  883. REQUIRE_PACKAGES_MYSQL=1
  884. REQUIRE_PACKAGES_IBASE=1
  885. REQUIRE_PACKAGES_X11=1
  886. REQUIRE_PACKAGES_OPENGL=1
  887. endif
  888. ifeq ($(OS_TARGET),go32v2)
  889. REQUIRE_PACKAGES_RTL=1
  890. REQUIRE_PACKAGES_PASZLIB=1
  891. REQUIRE_PACKAGES_FCL=1
  892. REQUIRE_PACKAGES_GTK=1
  893. REQUIRE_PACKAGES_OPENGL=1
  894. endif
  895. ifeq ($(OS_TARGET),win32)
  896. REQUIRE_PACKAGES_RTL=1
  897. REQUIRE_PACKAGES_PASZLIB=1
  898. REQUIRE_PACKAGES_NETDB=1
  899. REQUIRE_PACKAGES_FCL=1
  900. REQUIRE_PACKAGES_GTK=1
  901. REQUIRE_PACKAGES_MYSQL=1
  902. REQUIRE_PACKAGES_IBASE=1
  903. REQUIRE_PACKAGES_OPENGL=1
  904. endif
  905. ifeq ($(OS_TARGET),os2)
  906. REQUIRE_PACKAGES_RTL=1
  907. REQUIRE_PACKAGES_PASZLIB=1
  908. REQUIRE_PACKAGES_FCL=1
  909. REQUIRE_PACKAGES_GTK=1
  910. REQUIRE_PACKAGES_OPENGL=1
  911. endif
  912. ifeq ($(OS_TARGET),freebsd)
  913. REQUIRE_PACKAGES_RTL=1
  914. REQUIRE_PACKAGES_PASZLIB=1
  915. REQUIRE_PACKAGES_NETDB=1
  916. REQUIRE_PACKAGES_LIBASYNC=1
  917. REQUIRE_PACKAGES_FCL=1
  918. REQUIRE_PACKAGES_GTK=1
  919. REQUIRE_PACKAGES_MYSQL=1
  920. REQUIRE_PACKAGES_IBASE=1
  921. REQUIRE_PACKAGES_X11=1
  922. REQUIRE_PACKAGES_OPENGL=1
  923. endif
  924. ifeq ($(OS_TARGET),beos)
  925. REQUIRE_PACKAGES_RTL=1
  926. REQUIRE_PACKAGES_PASZLIB=1
  927. REQUIRE_PACKAGES_FCL=1
  928. REQUIRE_PACKAGES_GTK=1
  929. REQUIRE_PACKAGES_OPENGL=1
  930. endif
  931. ifeq ($(OS_TARGET),netbsd)
  932. REQUIRE_PACKAGES_RTL=1
  933. REQUIRE_PACKAGES_PASZLIB=1
  934. REQUIRE_PACKAGES_NETDB=1
  935. REQUIRE_PACKAGES_LIBASYNC=1
  936. REQUIRE_PACKAGES_FCL=1
  937. REQUIRE_PACKAGES_GTK=1
  938. REQUIRE_PACKAGES_MYSQL=1
  939. REQUIRE_PACKAGES_IBASE=1
  940. REQUIRE_PACKAGES_X11=1
  941. REQUIRE_PACKAGES_OPENGL=1
  942. endif
  943. ifeq ($(OS_TARGET),amiga)
  944. REQUIRE_PACKAGES_RTL=1
  945. REQUIRE_PACKAGES_PASZLIB=1
  946. REQUIRE_PACKAGES_FCL=1
  947. REQUIRE_PACKAGES_GTK=1
  948. REQUIRE_PACKAGES_OPENGL=1
  949. endif
  950. ifeq ($(OS_TARGET),atari)
  951. REQUIRE_PACKAGES_RTL=1
  952. REQUIRE_PACKAGES_PASZLIB=1
  953. REQUIRE_PACKAGES_FCL=1
  954. REQUIRE_PACKAGES_GTK=1
  955. REQUIRE_PACKAGES_OPENGL=1
  956. endif
  957. ifeq ($(OS_TARGET),sunos)
  958. REQUIRE_PACKAGES_RTL=1
  959. REQUIRE_PACKAGES_PASZLIB=1
  960. REQUIRE_PACKAGES_FCL=1
  961. REQUIRE_PACKAGES_GTK=1
  962. REQUIRE_PACKAGES_OPENGL=1
  963. endif
  964. ifeq ($(OS_TARGET),qnx)
  965. REQUIRE_PACKAGES_RTL=1
  966. REQUIRE_PACKAGES_PASZLIB=1
  967. REQUIRE_PACKAGES_FCL=1
  968. REQUIRE_PACKAGES_GTK=1
  969. REQUIRE_PACKAGES_OPENGL=1
  970. endif
  971. ifeq ($(OS_TARGET),netware)
  972. REQUIRE_PACKAGES_RTL=1
  973. REQUIRE_PACKAGES_PASZLIB=1
  974. REQUIRE_PACKAGES_FCL=1
  975. REQUIRE_PACKAGES_GTK=1
  976. REQUIRE_PACKAGES_OPENGL=1
  977. endif
  978. ifeq ($(OS_TARGET),openbsd)
  979. REQUIRE_PACKAGES_RTL=1
  980. REQUIRE_PACKAGES_PASZLIB=1
  981. REQUIRE_PACKAGES_NETDB=1
  982. REQUIRE_PACKAGES_LIBASYNC=1
  983. REQUIRE_PACKAGES_FCL=1
  984. REQUIRE_PACKAGES_GTK=1
  985. REQUIRE_PACKAGES_MYSQL=1
  986. REQUIRE_PACKAGES_IBASE=1
  987. REQUIRE_PACKAGES_X11=1
  988. REQUIRE_PACKAGES_OPENGL=1
  989. endif
  990. ifeq ($(OS_TARGET),wdosx)
  991. REQUIRE_PACKAGES_RTL=1
  992. REQUIRE_PACKAGES_PASZLIB=1
  993. REQUIRE_PACKAGES_FCL=1
  994. REQUIRE_PACKAGES_GTK=1
  995. REQUIRE_PACKAGES_OPENGL=1
  996. endif
  997. ifeq ($(OS_TARGET),palmos)
  998. REQUIRE_PACKAGES_RTL=1
  999. REQUIRE_PACKAGES_PASZLIB=1
  1000. REQUIRE_PACKAGES_FCL=1
  1001. REQUIRE_PACKAGES_GTK=1
  1002. REQUIRE_PACKAGES_OPENGL=1
  1003. endif
  1004. ifeq ($(OS_TARGET),macos)
  1005. REQUIRE_PACKAGES_RTL=1
  1006. REQUIRE_PACKAGES_PASZLIB=1
  1007. REQUIRE_PACKAGES_FCL=1
  1008. REQUIRE_PACKAGES_GTK=1
  1009. REQUIRE_PACKAGES_OPENGL=1
  1010. endif
  1011. ifeq ($(OS_TARGET),macosx)
  1012. REQUIRE_PACKAGES_RTL=1
  1013. REQUIRE_PACKAGES_PASZLIB=1
  1014. REQUIRE_PACKAGES_FCL=1
  1015. REQUIRE_PACKAGES_GTK=1
  1016. REQUIRE_PACKAGES_OPENGL=1
  1017. endif
  1018. ifeq ($(OS_TARGET),emx)
  1019. REQUIRE_PACKAGES_RTL=1
  1020. REQUIRE_PACKAGES_PASZLIB=1
  1021. REQUIRE_PACKAGES_FCL=1
  1022. REQUIRE_PACKAGES_GTK=1
  1023. REQUIRE_PACKAGES_OPENGL=1
  1024. endif
  1025. ifdef REQUIRE_PACKAGES_RTL
  1026. PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
  1027. ifneq ($(PACKAGEDIR_RTL),)
  1028. ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
  1029. UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
  1030. else
  1031. UNITDIR_RTL=$(PACKAGEDIR_RTL)
  1032. endif
  1033. ifdef CHECKDEPEND
  1034. $(PACKAGEDIR_RTL)/$(FPCMADE):
  1035. $(MAKE) -C $(PACKAGEDIR_RTL) $(FPCMADE)
  1036. override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
  1037. endif
  1038. else
  1039. PACKAGEDIR_RTL=
  1040. UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
  1041. ifneq ($(UNITDIR_RTL),)
  1042. UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
  1043. else
  1044. UNITDIR_RTL=
  1045. endif
  1046. endif
  1047. ifdef UNITDIR_RTL
  1048. override COMPILER_UNITDIR+=$(UNITDIR_RTL)
  1049. endif
  1050. endif
  1051. ifdef REQUIRE_PACKAGES_PASZLIB
  1052. PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
  1053. ifneq ($(PACKAGEDIR_PASZLIB),)
  1054. ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
  1055. UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
  1056. else
  1057. UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)
  1058. endif
  1059. ifdef CHECKDEPEND
  1060. $(PACKAGEDIR_PASZLIB)/$(FPCMADE):
  1061. $(MAKE) -C $(PACKAGEDIR_PASZLIB) $(FPCMADE)
  1062. override ALLDEPENDENCIES+=$(PACKAGEDIR_PASZLIB)/$(FPCMADE)
  1063. endif
  1064. else
  1065. PACKAGEDIR_PASZLIB=
  1066. UNITDIR_PASZLIB:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Package.fpc,$(UNITSDIR)))))
  1067. ifneq ($(UNITDIR_PASZLIB),)
  1068. UNITDIR_PASZLIB:=$(firstword $(UNITDIR_PASZLIB))
  1069. else
  1070. UNITDIR_PASZLIB=
  1071. endif
  1072. endif
  1073. ifdef UNITDIR_PASZLIB
  1074. override COMPILER_UNITDIR+=$(UNITDIR_PASZLIB)
  1075. endif
  1076. endif
  1077. ifdef REQUIRE_PACKAGES_NETDB
  1078. PACKAGEDIR_NETDB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /netdb/Makefile.fpc,$(PACKAGESDIR))))))
  1079. ifneq ($(PACKAGEDIR_NETDB),)
  1080. ifneq ($(wildcard $(PACKAGEDIR_NETDB)/$(OS_TARGET)),)
  1081. UNITDIR_NETDB=$(PACKAGEDIR_NETDB)/$(OS_TARGET)
  1082. else
  1083. UNITDIR_NETDB=$(PACKAGEDIR_NETDB)
  1084. endif
  1085. ifdef CHECKDEPEND
  1086. $(PACKAGEDIR_NETDB)/$(FPCMADE):
  1087. $(MAKE) -C $(PACKAGEDIR_NETDB) $(FPCMADE)
  1088. override ALLDEPENDENCIES+=$(PACKAGEDIR_NETDB)/$(FPCMADE)
  1089. endif
  1090. else
  1091. PACKAGEDIR_NETDB=
  1092. UNITDIR_NETDB:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /netdb/Package.fpc,$(UNITSDIR)))))
  1093. ifneq ($(UNITDIR_NETDB),)
  1094. UNITDIR_NETDB:=$(firstword $(UNITDIR_NETDB))
  1095. else
  1096. UNITDIR_NETDB=
  1097. endif
  1098. endif
  1099. ifdef UNITDIR_NETDB
  1100. override COMPILER_UNITDIR+=$(UNITDIR_NETDB)
  1101. endif
  1102. endif
  1103. ifdef REQUIRE_PACKAGES_LIBASYNC
  1104. PACKAGEDIR_LIBASYNC:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /libasync/Makefile.fpc,$(PACKAGESDIR))))))
  1105. ifneq ($(PACKAGEDIR_LIBASYNC),)
  1106. ifneq ($(wildcard $(PACKAGEDIR_LIBASYNC)/$(OS_TARGET)),)
  1107. UNITDIR_LIBASYNC=$(PACKAGEDIR_LIBASYNC)/$(OS_TARGET)
  1108. else
  1109. UNITDIR_LIBASYNC=$(PACKAGEDIR_LIBASYNC)
  1110. endif
  1111. ifdef CHECKDEPEND
  1112. $(PACKAGEDIR_LIBASYNC)/$(FPCMADE):
  1113. $(MAKE) -C $(PACKAGEDIR_LIBASYNC) $(FPCMADE)
  1114. override ALLDEPENDENCIES+=$(PACKAGEDIR_LIBASYNC)/$(FPCMADE)
  1115. endif
  1116. else
  1117. PACKAGEDIR_LIBASYNC=
  1118. UNITDIR_LIBASYNC:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /libasync/Package.fpc,$(UNITSDIR)))))
  1119. ifneq ($(UNITDIR_LIBASYNC),)
  1120. UNITDIR_LIBASYNC:=$(firstword $(UNITDIR_LIBASYNC))
  1121. else
  1122. UNITDIR_LIBASYNC=
  1123. endif
  1124. endif
  1125. ifdef UNITDIR_LIBASYNC
  1126. override COMPILER_UNITDIR+=$(UNITDIR_LIBASYNC)
  1127. endif
  1128. endif
  1129. ifdef REQUIRE_PACKAGES_FCL
  1130. PACKAGEDIR_FCL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
  1131. ifneq ($(PACKAGEDIR_FCL),)
  1132. ifneq ($(wildcard $(PACKAGEDIR_FCL)/$(OS_TARGET)),)
  1133. UNITDIR_FCL=$(PACKAGEDIR_FCL)/$(OS_TARGET)
  1134. else
  1135. UNITDIR_FCL=$(PACKAGEDIR_FCL)
  1136. endif
  1137. ifdef CHECKDEPEND
  1138. $(PACKAGEDIR_FCL)/$(FPCMADE):
  1139. $(MAKE) -C $(PACKAGEDIR_FCL) $(FPCMADE)
  1140. override ALLDEPENDENCIES+=$(PACKAGEDIR_FCL)/$(FPCMADE)
  1141. endif
  1142. else
  1143. PACKAGEDIR_FCL=
  1144. UNITDIR_FCL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /fcl/Package.fpc,$(UNITSDIR)))))
  1145. ifneq ($(UNITDIR_FCL),)
  1146. UNITDIR_FCL:=$(firstword $(UNITDIR_FCL))
  1147. else
  1148. UNITDIR_FCL=
  1149. endif
  1150. endif
  1151. ifdef UNITDIR_FCL
  1152. override COMPILER_UNITDIR+=$(UNITDIR_FCL)
  1153. endif
  1154. endif
  1155. ifdef REQUIRE_PACKAGES_GTK
  1156. PACKAGEDIR_GTK:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /gtk/Makefile.fpc,$(PACKAGESDIR))))))
  1157. ifneq ($(PACKAGEDIR_GTK),)
  1158. ifneq ($(wildcard $(PACKAGEDIR_GTK)/$(OS_TARGET)),)
  1159. UNITDIR_GTK=$(PACKAGEDIR_GTK)/$(OS_TARGET)
  1160. else
  1161. UNITDIR_GTK=$(PACKAGEDIR_GTK)
  1162. endif
  1163. ifdef CHECKDEPEND
  1164. $(PACKAGEDIR_GTK)/$(FPCMADE):
  1165. $(MAKE) -C $(PACKAGEDIR_GTK) $(FPCMADE)
  1166. override ALLDEPENDENCIES+=$(PACKAGEDIR_GTK)/$(FPCMADE)
  1167. endif
  1168. else
  1169. PACKAGEDIR_GTK=
  1170. UNITDIR_GTK:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /gtk/Package.fpc,$(UNITSDIR)))))
  1171. ifneq ($(UNITDIR_GTK),)
  1172. UNITDIR_GTK:=$(firstword $(UNITDIR_GTK))
  1173. else
  1174. UNITDIR_GTK=
  1175. endif
  1176. endif
  1177. ifdef UNITDIR_GTK
  1178. override COMPILER_UNITDIR+=$(UNITDIR_GTK)
  1179. endif
  1180. endif
  1181. ifdef REQUIRE_PACKAGES_MYSQL
  1182. PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
  1183. ifneq ($(PACKAGEDIR_MYSQL),)
  1184. ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
  1185. UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
  1186. else
  1187. UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)
  1188. endif
  1189. ifdef CHECKDEPEND
  1190. $(PACKAGEDIR_MYSQL)/$(FPCMADE):
  1191. $(MAKE) -C $(PACKAGEDIR_MYSQL) $(FPCMADE)
  1192. override ALLDEPENDENCIES+=$(PACKAGEDIR_MYSQL)/$(FPCMADE)
  1193. endif
  1194. else
  1195. PACKAGEDIR_MYSQL=
  1196. UNITDIR_MYSQL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /mysql/Package.fpc,$(UNITSDIR)))))
  1197. ifneq ($(UNITDIR_MYSQL),)
  1198. UNITDIR_MYSQL:=$(firstword $(UNITDIR_MYSQL))
  1199. else
  1200. UNITDIR_MYSQL=
  1201. endif
  1202. endif
  1203. ifdef UNITDIR_MYSQL
  1204. override COMPILER_UNITDIR+=$(UNITDIR_MYSQL)
  1205. endif
  1206. endif
  1207. ifdef REQUIRE_PACKAGES_IBASE
  1208. PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
  1209. ifneq ($(PACKAGEDIR_IBASE),)
  1210. ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
  1211. UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
  1212. else
  1213. UNITDIR_IBASE=$(PACKAGEDIR_IBASE)
  1214. endif
  1215. ifdef CHECKDEPEND
  1216. $(PACKAGEDIR_IBASE)/$(FPCMADE):
  1217. $(MAKE) -C $(PACKAGEDIR_IBASE) $(FPCMADE)
  1218. override ALLDEPENDENCIES+=$(PACKAGEDIR_IBASE)/$(FPCMADE)
  1219. endif
  1220. else
  1221. PACKAGEDIR_IBASE=
  1222. UNITDIR_IBASE:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /ibase/Package.fpc,$(UNITSDIR)))))
  1223. ifneq ($(UNITDIR_IBASE),)
  1224. UNITDIR_IBASE:=$(firstword $(UNITDIR_IBASE))
  1225. else
  1226. UNITDIR_IBASE=
  1227. endif
  1228. endif
  1229. ifdef UNITDIR_IBASE
  1230. override COMPILER_UNITDIR+=$(UNITDIR_IBASE)
  1231. endif
  1232. endif
  1233. ifdef REQUIRE_PACKAGES_X11
  1234. PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
  1235. ifneq ($(PACKAGEDIR_X11),)
  1236. ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
  1237. UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
  1238. else
  1239. UNITDIR_X11=$(PACKAGEDIR_X11)
  1240. endif
  1241. ifdef CHECKDEPEND
  1242. $(PACKAGEDIR_X11)/$(FPCMADE):
  1243. $(MAKE) -C $(PACKAGEDIR_X11) $(FPCMADE)
  1244. override ALLDEPENDENCIES+=$(PACKAGEDIR_X11)/$(FPCMADE)
  1245. endif
  1246. else
  1247. PACKAGEDIR_X11=
  1248. UNITDIR_X11:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /x11/Package.fpc,$(UNITSDIR)))))
  1249. ifneq ($(UNITDIR_X11),)
  1250. UNITDIR_X11:=$(firstword $(UNITDIR_X11))
  1251. else
  1252. UNITDIR_X11=
  1253. endif
  1254. endif
  1255. ifdef UNITDIR_X11
  1256. override COMPILER_UNITDIR+=$(UNITDIR_X11)
  1257. endif
  1258. endif
  1259. ifdef REQUIRE_PACKAGES_OPENGL
  1260. PACKAGEDIR_OPENGL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /opengl/Makefile.fpc,$(PACKAGESDIR))))))
  1261. ifneq ($(PACKAGEDIR_OPENGL),)
  1262. ifneq ($(wildcard $(PACKAGEDIR_OPENGL)/$(OS_TARGET)),)
  1263. UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)/$(OS_TARGET)
  1264. else
  1265. UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)
  1266. endif
  1267. ifdef CHECKDEPEND
  1268. $(PACKAGEDIR_OPENGL)/$(FPCMADE):
  1269. $(MAKE) -C $(PACKAGEDIR_OPENGL) $(FPCMADE)
  1270. override ALLDEPENDENCIES+=$(PACKAGEDIR_OPENGL)/$(FPCMADE)
  1271. endif
  1272. else
  1273. PACKAGEDIR_OPENGL=
  1274. UNITDIR_OPENGL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /opengl/Package.fpc,$(UNITSDIR)))))
  1275. ifneq ($(UNITDIR_OPENGL),)
  1276. UNITDIR_OPENGL:=$(firstword $(UNITDIR_OPENGL))
  1277. else
  1278. UNITDIR_OPENGL=
  1279. endif
  1280. endif
  1281. ifdef UNITDIR_OPENGL
  1282. override COMPILER_UNITDIR+=$(UNITDIR_OPENGL)
  1283. endif
  1284. endif
  1285. ifndef NOCPUDEF
  1286. override FPCOPTDEF=$(CPU_TARGET)
  1287. endif
  1288. ifneq ($(OS_TARGET),$(OS_SOURCE))
  1289. override FPCOPT+=-T$(OS_TARGET)
  1290. endif
  1291. ifeq ($(OS_SOURCE),openbsd)
  1292. override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
  1293. endif
  1294. ifdef UNITDIR
  1295. override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
  1296. endif
  1297. ifdef LIBDIR
  1298. override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
  1299. endif
  1300. ifdef OBJDIR
  1301. override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
  1302. endif
  1303. ifdef INCDIR
  1304. override FPCOPT+=$(addprefix -Fi,$(INCDIR))
  1305. endif
  1306. ifdef LINKSMART
  1307. override FPCOPT+=-XX
  1308. endif
  1309. ifdef CREATESMART
  1310. override FPCOPT+=-CX
  1311. endif
  1312. ifdef DEBUG
  1313. override FPCOPT+=-gl
  1314. override FPCOPTDEF+=DEBUG
  1315. endif
  1316. ifdef RELEASE
  1317. ifeq ($(CPU_TARGET),i386)
  1318. FPCCPUOPT:=-OG2p3
  1319. else
  1320. FPCCPUOPT:=
  1321. endif
  1322. override FPCOPT+=-Xs $(FPCCPUOPT) -n
  1323. override FPCOPTDEF+=RELEASE
  1324. endif
  1325. ifdef STRIP
  1326. override FPCOPT+=-Xs
  1327. endif
  1328. ifdef OPTIMIZE
  1329. ifeq ($(CPU_TARGET),i386)
  1330. override FPCOPT+=-OG2p3
  1331. endif
  1332. endif
  1333. ifdef VERBOSE
  1334. override FPCOPT+=-vwni
  1335. endif
  1336. ifdef COMPILER_OPTIONS
  1337. override FPCOPT+=$(COMPILER_OPTIONS)
  1338. endif
  1339. ifdef COMPILER_UNITDIR
  1340. override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
  1341. endif
  1342. ifdef COMPILER_LIBRARYDIR
  1343. override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
  1344. endif
  1345. ifdef COMPILER_OBJECTDIR
  1346. override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
  1347. endif
  1348. ifdef COMPILER_INCLUDEDIR
  1349. override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
  1350. endif
  1351. ifdef CROSSBINDIR
  1352. override FPCOPT+=-FD$(CROSSBINDIR)
  1353. endif
  1354. ifdef COMPILER_TARGETDIR
  1355. override FPCOPT+=-FE$(COMPILER_TARGETDIR)
  1356. ifeq ($(COMPILER_TARGETDIR),.)
  1357. override TARGETDIRPREFIX=
  1358. else
  1359. override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
  1360. endif
  1361. endif
  1362. ifdef COMPILER_UNITTARGETDIR
  1363. override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
  1364. ifeq ($(COMPILER_UNITTARGETDIR),.)
  1365. override UNITTARGETDIRPREFIX=
  1366. else
  1367. override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
  1368. endif
  1369. else
  1370. ifdef COMPILER_TARGETDIR
  1371. override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
  1372. override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
  1373. endif
  1374. endif
  1375. ifeq ($(OS_TARGET),linux)
  1376. ifeq ($(FPC_VERSION),1.0.6)
  1377. override FPCOPTDEF+=HASUNIX
  1378. endif
  1379. endif
  1380. ifdef GCCLIBDIR
  1381. override FPCOPT+=-Fl$(GCCLIBDIR)
  1382. endif
  1383. ifdef OTHERLIBDIR
  1384. override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
  1385. endif
  1386. ifdef OPT
  1387. override FPCOPT+=$(OPT)
  1388. endif
  1389. ifdef FPCOPTDEF
  1390. override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
  1391. endif
  1392. ifdef CFGFILE
  1393. override FPCOPT+=@$(CFGFILE)
  1394. endif
  1395. ifdef USEENV
  1396. override FPCEXTCMD:=$(FPCOPT)
  1397. override FPCOPT:=!FPCEXTCMD
  1398. export FPCEXTCMD
  1399. endif
  1400. override COMPILER:=$(FPC) $(FPCOPT)
  1401. ifeq (,$(findstring -s ,$(COMPILER)))
  1402. EXECPPAS=
  1403. else
  1404. ifeq ($(OS_SOURCE),$(OS_TARGET))
  1405. EXECPPAS:=@$(PPAS)
  1406. endif
  1407. endif
  1408. .PHONY: fpc_units
  1409. ifdef TARGET_UNITS
  1410. override ALLTARGET+=fpc_units
  1411. override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
  1412. override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
  1413. override INSTALLPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
  1414. override CLEANPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
  1415. endif
  1416. fpc_units: $(UNITPPUFILES)
  1417. ifdef TARGET_RSTS
  1418. override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
  1419. override CLEANRSTFILES+=$(RSTFILES)
  1420. endif
  1421. .PHONY: fpc_all fpc_smart fpc_debug fpc_release
  1422. $(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
  1423. @$(ECHOREDIR) Compiled > $(FPCMADE)
  1424. fpc_all: $(FPCMADE)
  1425. fpc_smart:
  1426. $(MAKE) all LINKSMART=1 CREATESMART=1
  1427. fpc_debug:
  1428. $(MAKE) all DEBUG=1
  1429. fpc_release:
  1430. $(MAKE) all RELEASE=1
  1431. .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
  1432. %$(PPUEXT): %.pp
  1433. $(COMPILER) $<
  1434. $(EXECPPAS)
  1435. %$(PPUEXT): %.pas
  1436. $(COMPILER) $<
  1437. $(EXECPPAS)
  1438. %$(EXEEXT): %.pp
  1439. $(COMPILER) $<
  1440. $(EXECPPAS)
  1441. %$(EXEEXT): %.pas
  1442. $(COMPILER) $<
  1443. $(EXECPPAS)
  1444. %.res: %.rc
  1445. windres -i $< -o $@
  1446. vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  1447. vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  1448. vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
  1449. .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
  1450. ifdef INSTALL_UNITS
  1451. override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
  1452. endif
  1453. ifdef INSTALL_BUILDUNIT
  1454. override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
  1455. endif
  1456. ifdef INSTALLPPUFILES
  1457. override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
  1458. override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPUFILES))
  1459. override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPULINKFILES)))
  1460. override INSTALL_CREATEPACKAGEFPC=1
  1461. endif
  1462. ifdef INSTALLEXEFILES
  1463. override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
  1464. endif
  1465. fpc_install: all $(INSTALLTARGET)
  1466. ifdef INSTALLEXEFILES
  1467. $(MKDIR) $(INSTALL_BINDIR)
  1468. ifdef UPXPROG
  1469. -$(UPXPROG) $(INSTALLEXEFILES)
  1470. endif
  1471. $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
  1472. endif
  1473. ifdef INSTALL_CREATEPACKAGEFPC
  1474. ifdef FPCMAKE
  1475. ifdef PACKAGE_VERSION
  1476. ifneq ($(wildcard Makefile.fpc),)
  1477. $(FPCMAKE) -p -T$(OS_TARGET) Makefile.fpc
  1478. $(MKDIR) $(INSTALL_UNITDIR)
  1479. $(INSTALL) Package.fpc $(INSTALL_UNITDIR)
  1480. endif
  1481. endif
  1482. endif
  1483. endif
  1484. ifdef INSTALLPPUFILES
  1485. $(MKDIR) $(INSTALL_UNITDIR)
  1486. $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
  1487. ifneq ($(INSTALLPPULINKFILES),)
  1488. $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
  1489. endif
  1490. ifneq ($(wildcard $(LIB_FULLNAME)),)
  1491. $(MKDIR) $(INSTALL_LIBDIR)
  1492. $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
  1493. ifdef inUnix
  1494. ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
  1495. endif
  1496. endif
  1497. endif
  1498. ifdef INSTALL_FILES
  1499. $(MKDIR) $(INSTALL_DATADIR)
  1500. $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
  1501. endif
  1502. fpc_sourceinstall: distclean
  1503. $(MKDIR) $(INSTALL_SOURCEDIR)
  1504. $(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
  1505. fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
  1506. ifdef HASEXAMPLES
  1507. $(MKDIR) $(INSTALL_EXAMPLEDIR)
  1508. endif
  1509. ifdef EXAMPLESOURCEFILES
  1510. $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
  1511. endif
  1512. ifdef TARGET_EXAMPLEDIRS
  1513. $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
  1514. endif
  1515. .PHONY: fpc_distinstall
  1516. fpc_distinstall: install exampleinstall
  1517. .PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall
  1518. ifndef PACKDIR
  1519. ifndef inUnix
  1520. PACKDIR=$(BASEDIR)/../fpc-pack
  1521. else
  1522. PACKDIR=/tmp/fpc-pack
  1523. endif
  1524. endif
  1525. ifndef ZIPNAME
  1526. ifdef DIST_ZIPNAME
  1527. ZIPNAME=$(DIST_ZIPNAME)
  1528. else
  1529. ZIPNAME=$(ZIPPREFIX)$(PACKAGE_NAME)$(ZIPSUFFIX)
  1530. endif
  1531. endif
  1532. ifndef ZIPTARGET
  1533. ifdef DIST_ZIPTARGET
  1534. ZIPTARGET=DIST_ZIPTARGET
  1535. else
  1536. ZIPTARGET=install
  1537. endif
  1538. endif
  1539. ifndef USEZIP
  1540. ifdef inUnix
  1541. USETAR=1
  1542. endif
  1543. endif
  1544. ifndef inUnix
  1545. USEZIPWRAPPER=1
  1546. endif
  1547. ifdef USEZIPWRAPPER
  1548. ZIPPATHSEP=$(PATHSEP)
  1549. ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(BATCHEXT))
  1550. else
  1551. ZIPPATHSEP=/
  1552. endif
  1553. ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
  1554. ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
  1555. ifdef USETAR
  1556. ZIPDESTFILE:=$(DIST_DESTDIR)/$(ZIPNAME)$(TAREXT)
  1557. ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *
  1558. else
  1559. ZIPDESTFILE:=$(DIST_DESTDIR)/$(ZIPNAME)$(ZIPEXT)
  1560. ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
  1561. endif
  1562. fpc_zipinstall:
  1563. $(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1
  1564. $(MKDIR) $(DIST_DESTDIR)
  1565. $(DEL) $(ZIPDESTFILE)
  1566. ifdef USEZIPWRAPPER
  1567. ifneq ($(ECHOREDIR),echo)
  1568. $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER)
  1569. $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)
  1570. $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER)
  1571. else
  1572. echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)
  1573. echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)
  1574. echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)
  1575. endif
  1576. ifdef inUnix
  1577. /bin/sh $(ZIPWRAPPER)
  1578. else
  1579. $(ZIPWRAPPER)
  1580. endif
  1581. $(DEL) $(ZIPWRAPPER)
  1582. else
  1583. $(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)
  1584. endif
  1585. $(DELTREE) $(PACKDIR)
  1586. fpc_zipsourceinstall:
  1587. $(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=src
  1588. fpc_zipexampleinstall:
  1589. ifdef HASEXAMPLES
  1590. $(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=exm
  1591. endif
  1592. fpc_zipdistinstall:
  1593. $(MAKE) fpc_zipinstall ZIPTARGET=distinstall
  1594. .PHONY: fpc_clean fpc_cleanall fpc_distclean
  1595. ifdef EXEFILES
  1596. override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
  1597. endif
  1598. ifdef CLEAN_UNITS
  1599. override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
  1600. endif
  1601. ifdef CLEANPPUFILES
  1602. override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
  1603. override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
  1604. override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
  1605. endif
  1606. fpc_clean: $(CLEANTARGET)
  1607. ifdef CLEANEXEFILES
  1608. -$(DEL) $(CLEANEXEFILES)
  1609. endif
  1610. ifdef CLEANPPUFILES
  1611. -$(DEL) $(CLEANPPUFILES)
  1612. endif
  1613. ifneq ($(CLEANPPULINKFILES),)
  1614. -$(DEL) $(CLEANPPULINKFILES)
  1615. endif
  1616. ifdef CLEANRSTFILES
  1617. -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
  1618. endif
  1619. ifdef CLEAN_FILES
  1620. -$(DEL) $(CLEAN_FILES)
  1621. endif
  1622. ifdef LIB_NAME
  1623. -$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
  1624. endif
  1625. -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  1626. fpc_distclean: clean
  1627. ifdef COMPILER_UNITTARGETDIR
  1628. TARGETDIRCLEAN=fpc_clean
  1629. endif
  1630. fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
  1631. ifdef CLEANEXEFILES
  1632. -$(DEL) $(CLEANEXEFILES)
  1633. endif
  1634. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  1635. -$(DELTREE) *$(SMARTEXT)
  1636. -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  1637. ifdef AOUTEXT
  1638. -$(DEL) *$(AOUTEXT)
  1639. endif
  1640. .PHONY: fpc_baseinfo
  1641. override INFORULES+=fpc_baseinfo
  1642. fpc_baseinfo:
  1643. @$(ECHO)
  1644. @$(ECHO) == Package info ==
  1645. @$(ECHO) Package Name..... $(PACKAGE_NAME)
  1646. @$(ECHO) Package Version.. $(PACKAGE_VERSION)
  1647. @$(ECHO)
  1648. @$(ECHO) == Configuration info ==
  1649. @$(ECHO)
  1650. @$(ECHO) FPC.......... $(FPC)
  1651. @$(ECHO) FPC Version.. $(FPC_VERSION)
  1652. @$(ECHO) Source CPU... $(CPU_SOURCE)
  1653. @$(ECHO) Target CPU... $(CPU_TARGET)
  1654. @$(ECHO) Source OS.... $(OS_SOURCE)
  1655. @$(ECHO) Target OS.... $(OS_TARGET)
  1656. @$(ECHO) Full Source.. $(FULL_SOURCE)
  1657. @$(ECHO) Full Target.. $(FULL_TARGET)
  1658. @$(ECHO)
  1659. @$(ECHO) == Directory info ==
  1660. @$(ECHO)
  1661. @$(ECHO) Required pkgs... $(REQUIRE_PACKAGES)
  1662. @$(ECHO)
  1663. @$(ECHO) Basedir......... $(BASEDIR)
  1664. @$(ECHO) FPCDir.......... $(FPCDIR)
  1665. @$(ECHO) CrossBinDir..... $(CROSSBINDIR)
  1666. @$(ECHO) UnitsDir........ $(UNITSDIR)
  1667. @$(ECHO) PackagesDir..... $(PACKAGESDIR)
  1668. @$(ECHO)
  1669. @$(ECHO) GCC library..... $(GCCLIBDIR)
  1670. @$(ECHO) Other library... $(OTHERLIBDIR)
  1671. @$(ECHO)
  1672. @$(ECHO) == Tools info ==
  1673. @$(ECHO)
  1674. @$(ECHO) As........ $(AS)
  1675. @$(ECHO) Ld........ $(LD)
  1676. @$(ECHO) Ar........ $(AR)
  1677. @$(ECHO) Rc........ $(RC)
  1678. @$(ECHO)
  1679. @$(ECHO) Mv........ $(MVPROG)
  1680. @$(ECHO) Cp........ $(CPPROG)
  1681. @$(ECHO) Rm........ $(RMPROG)
  1682. @$(ECHO) GInstall.. $(GINSTALL)
  1683. @$(ECHO) Echo...... $(ECHO)
  1684. @$(ECHO) Shell..... $(SHELL)
  1685. @$(ECHO) Date...... $(DATE)
  1686. @$(ECHO) FPCMake... $(FPCMAKE)
  1687. @$(ECHO) PPUMove... $(PPUMOVE)
  1688. @$(ECHO) Upx....... $(UPXPROG)
  1689. @$(ECHO) Zip....... $(ZIPPROG)
  1690. @$(ECHO)
  1691. @$(ECHO) == Object info ==
  1692. @$(ECHO)
  1693. @$(ECHO) Target Loaders........ $(TARGET_LOADERS)
  1694. @$(ECHO) Target Units.......... $(TARGET_UNITS)
  1695. @$(ECHO) Target Implicit Units. $(TARGET_IMPLICITUNITS)
  1696. @$(ECHO) Target Programs....... $(TARGET_PROGRAMS)
  1697. @$(ECHO) Target Dirs........... $(TARGET_DIRS)
  1698. @$(ECHO) Target Examples....... $(TARGET_EXAMPLES)
  1699. @$(ECHO) Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
  1700. @$(ECHO)
  1701. @$(ECHO) Clean Units......... $(CLEAN_UNITS)
  1702. @$(ECHO) Clean Files......... $(CLEAN_FILES)
  1703. @$(ECHO)
  1704. @$(ECHO) Install Units....... $(INSTALL_UNITS)
  1705. @$(ECHO) Install Files....... $(INSTALL_FILES)
  1706. @$(ECHO)
  1707. @$(ECHO) == Install info ==
  1708. @$(ECHO)
  1709. @$(ECHO) DateStr.............. $(DATESTR)
  1710. @$(ECHO) ZipPrefix............ $(ZIPPREFIX)
  1711. @$(ECHO) ZipSuffix............ $(ZIPSUFFIX)
  1712. @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE)
  1713. @$(ECHO)
  1714. @$(ECHO) Install base dir..... $(INSTALL_BASEDIR)
  1715. @$(ECHO) Install binary dir... $(INSTALL_BINDIR)
  1716. @$(ECHO) Install library dir.. $(INSTALL_LIBDIR)
  1717. @$(ECHO) Install units dir.... $(INSTALL_UNITDIR)
  1718. @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR)
  1719. @$(ECHO) Install doc dir...... $(INSTALL_DOCDIR)
  1720. @$(ECHO) Install example dir.. $(INSTALL_EXAMPLEDIR)
  1721. @$(ECHO) Install data dir..... $(INSTALL_DATADIR)
  1722. @$(ECHO)
  1723. @$(ECHO) Dist destination dir. $(DIST_DESTDIR)
  1724. @$(ECHO) Dist zip name........ $(DIST_ZIPNAME)
  1725. @$(ECHO)
  1726. .PHONY: fpc_info
  1727. fpc_info: $(INFORULES)
  1728. .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
  1729. fpc_makefile_dirs
  1730. fpc_makefile:
  1731. $(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
  1732. fpc_makefile_sub1:
  1733. ifdef TARGET_DIRS
  1734. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
  1735. endif
  1736. ifdef TARGET_EXAMPLEDIRS
  1737. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
  1738. endif
  1739. fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
  1740. fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
  1741. fpc_makefiles: fpc_makefile fpc_makefile_dirs
  1742. all: fpc_all
  1743. debug: fpc_debug
  1744. smart: fpc_smart
  1745. release: fpc_release
  1746. examples:
  1747. shared:
  1748. install: fpc_install
  1749. sourceinstall: fpc_sourceinstall
  1750. exampleinstall: fpc_exampleinstall
  1751. distinstall: fpc_distinstall
  1752. zipinstall: fpc_zipinstall
  1753. zipsourceinstall: fpc_zipsourceinstall
  1754. zipexampleinstall: fpc_zipexampleinstall
  1755. zipdistinstall: fpc_zipdistinstall
  1756. clean: fpc_clean
  1757. distclean: fpc_distclean
  1758. cleanall: fpc_cleanall
  1759. info: fpc_info
  1760. makefiles: fpc_makefiles
  1761. .PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
  1762. ifneq ($(wildcard fpcmake.loc),)
  1763. include fpcmake.loc
  1764. endif