Makefile 30 KB

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