Makefile 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  1. #
  2. # Don't edit, this file is generated by fpcmake v1.99.0 [2001/07/31]
  3. #
  4. default: all
  5. override PATH:=$(subst \,/,$(PATH))
  6. ifeq ($(findstring ;,$(PATH)),)
  7. inUnix=1
  8. SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
  9. else
  10. SEARCHPATH:=$(subst ;, ,$(PATH))
  11. endif
  12. PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
  13. ifeq ($(PWD),)
  14. PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
  15. ifeq ($(PWD),)
  16. nopwd:
  17. @echo You need the GNU utils package to use this Makefile!
  18. @echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
  19. @exit
  20. else
  21. PWD:=$(firstword $(PWD))
  22. SRCEXEEXT=
  23. endif
  24. else
  25. PWD:=$(firstword $(PWD))
  26. SRCEXEEXT=.exe
  27. endif
  28. ifndef inUnix
  29. ifeq ($(OS),Windows_NT)
  30. inWinNT=1
  31. else
  32. ifdef OS2_SHELL
  33. inOS2=1
  34. endif
  35. endif
  36. else
  37. ifneq ($(findstring cygwin,$(MACHTYPE)),)
  38. inCygWin=1
  39. endif
  40. endif
  41. ifdef inUnix
  42. BATCHEXT=.sh
  43. else
  44. ifdef inOS2
  45. BATCHEXT=.cmd
  46. else
  47. BATCHEXT=.bat
  48. endif
  49. endif
  50. ifdef inUnix
  51. PATHSEP=/
  52. else
  53. PATHSEP:=$(subst /,\,/)
  54. endif
  55. ifdef PWD
  56. BASEDIR:=$(subst \,/,$(shell $(PWD)))
  57. ifdef inCygWin
  58. ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
  59. BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
  60. BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
  61. BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
  62. endif
  63. endif
  64. else
  65. BASEDIR=.
  66. endif
  67. ifndef FPC
  68. ifdef PP
  69. FPC=$(PP)
  70. else
  71. ifdef inUnix
  72. CPU_SOURCE=$(shell uname -m)
  73. ifeq (m68k,$(CPU_SOURCE))
  74. FPC=ppc68k
  75. else
  76. FPC=ppc386
  77. endif
  78. else
  79. FPC=ppc386
  80. endif
  81. endif
  82. endif
  83. override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
  84. override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
  85. ifndef OS_TARGET
  86. OS_TARGET:=$(shell $(FPC) -iTO)
  87. endif
  88. ifndef OS_SOURCE
  89. OS_SOURCE:=$(shell $(FPC) -iSO)
  90. endif
  91. ifndef CPU_TARGET
  92. CPU_TARGET:=$(shell $(FPC) -iTP)
  93. endif
  94. ifndef CPU_SOURCE
  95. CPU_SOURCE:=$(shell $(FPC) -iSP)
  96. endif
  97. ifndef FPC_VERSION
  98. FPC_VERSION:=$(shell $(FPC) -iV)
  99. endif
  100. export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
  101. ifdef FPCDIR
  102. override FPCDIR:=$(subst \,/,$(FPCDIR))
  103. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  104. override FPCDIR=wrong
  105. endif
  106. else
  107. override FPCDIR=wrong
  108. endif
  109. ifeq ($(FPCDIR),wrong)
  110. ifdef inUnix
  111. override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
  112. ifeq ($(wildcard $(FPCDIR)/units),)
  113. override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
  114. endif
  115. else
  116. override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
  117. override FPCDIR:=$(FPCDIR)/..
  118. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  119. override FPCDIR:=$(FPCDIR)/..
  120. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  121. override FPCDIR=c:/pp
  122. endif
  123. endif
  124. endif
  125. endif
  126. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
  127. PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages)
  128. override INSTALL_FPCPACKAGE=y
  129. ifndef ECHO
  130. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  131. ifeq ($(ECHO),)
  132. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  133. ifeq ($(ECHO),)
  134. ECHO=
  135. else
  136. ECHO:=$(firstword $(ECHO))
  137. endif
  138. else
  139. ECHO:=$(firstword $(ECHO))
  140. endif
  141. endif
  142. export ECHO
  143. ifndef DATE
  144. DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
  145. ifeq ($(DATE),)
  146. DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
  147. ifeq ($(DATE),)
  148. DATE=
  149. else
  150. DATE:=$(firstword $(DATE))
  151. endif
  152. else
  153. DATE:=$(firstword $(DATE))
  154. endif
  155. endif
  156. export DATE
  157. ifndef GINSTALL
  158. GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
  159. ifeq ($(GINSTALL),)
  160. GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
  161. ifeq ($(GINSTALL),)
  162. GINSTALL=
  163. else
  164. GINSTALL:=$(firstword $(GINSTALL))
  165. endif
  166. else
  167. GINSTALL:=$(firstword $(GINSTALL))
  168. endif
  169. endif
  170. export GINSTALL
  171. ifndef CPPROG
  172. CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
  173. ifeq ($(CPPROG),)
  174. CPPROG=
  175. else
  176. CPPROG:=$(firstword $(CPPROG))
  177. endif
  178. endif
  179. export CPPROG
  180. ifndef RMPROG
  181. RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
  182. ifeq ($(RMPROG),)
  183. RMPROG=
  184. else
  185. RMPROG:=$(firstword $(RMPROG))
  186. endif
  187. endif
  188. export RMPROG
  189. ifndef MVPROG
  190. MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
  191. ifeq ($(MVPROG),)
  192. MVPROG=
  193. else
  194. MVPROG:=$(firstword $(MVPROG))
  195. endif
  196. endif
  197. export MVPROG
  198. ifndef ECHOREDIR
  199. ECHOREDIR:=$(subst /,$(PATHSEP),$(ECHO))
  200. endif
  201. ifndef COPY
  202. COPY:=$(CPPROG) -fp
  203. endif
  204. ifndef COPYTREE
  205. COPYTREE:=$(CPPROG) -rfp
  206. endif
  207. ifndef MOVE
  208. MOVE:=$(MVPROG) -f
  209. endif
  210. ifndef DEL
  211. DEL:=$(RMPROG) -f
  212. endif
  213. ifndef DELTREE
  214. DELTREE:=$(RMPROG) -rf
  215. endif
  216. ifndef INSTALL
  217. ifdef inUnix
  218. INSTALL:=$(GINSTALL) -c -m 644
  219. else
  220. INSTALL:=$(COPY)
  221. endif
  222. endif
  223. ifndef INSTALLEXE
  224. ifdef inUnix
  225. INSTALLEXE:=$(GINSTALL) -c -m 755
  226. else
  227. INSTALLEXE:=$(COPY)
  228. endif
  229. endif
  230. ifndef MKDIR
  231. MKDIR:=$(GINSTALL) -m 755 -d
  232. endif
  233. export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
  234. ifndef PPUMOVE
  235. PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
  236. ifeq ($(PPUMOVE),)
  237. PPUMOVE=
  238. else
  239. PPUMOVE:=$(firstword $(PPUMOVE))
  240. endif
  241. endif
  242. export PPUMOVE
  243. ifndef FPCMAKE
  244. FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
  245. ifeq ($(FPCMAKE),)
  246. FPCMAKE=
  247. else
  248. FPCMAKE:=$(firstword $(FPCMAKE))
  249. endif
  250. endif
  251. export FPCMAKE
  252. ifndef ZIPPROG
  253. ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
  254. ifeq ($(ZIPPROG),)
  255. ZIPPROG=
  256. else
  257. ZIPPROG:=$(firstword $(ZIPPROG))
  258. endif
  259. endif
  260. export ZIPPROG
  261. ifndef TARPROG
  262. TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
  263. ifeq ($(TARPROG),)
  264. TARPROG=
  265. else
  266. TARPROG:=$(firstword $(TARPROG))
  267. endif
  268. endif
  269. export TARPROG
  270. ifndef AS
  271. AS=as
  272. endif
  273. ifndef LD
  274. LD=ld
  275. endif
  276. ifndef RC
  277. RC=rc
  278. endif
  279. PPAS=ppas$(BATCHEXT)
  280. ifdef inUnix
  281. LDCONFIG=ldconfig
  282. else
  283. LDCONFIG=
  284. endif
  285. ifdef DATE
  286. DATESTR:=$(shell $(DATE) +%Y%m%d)
  287. else
  288. DATESTR=
  289. endif
  290. ifndef UPXPROG
  291. ifeq ($(OS_TARGET),go32v2)
  292. UPXPROG:=1
  293. endif
  294. ifeq ($(OS_TARGET),win32)
  295. UPXPROG:=1
  296. endif
  297. ifdef UPXPROG
  298. UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
  299. ifeq ($(UPXPROG),)
  300. UPXPROG=
  301. else
  302. UPXPROG:=$(firstword $(UPXPROG))
  303. endif
  304. else
  305. UPXPROG=
  306. endif
  307. endif
  308. export UPXPROG
  309. ZIPOPT=-9
  310. ZIPEXT=.zip
  311. ifeq ($(USETAR),bz2)
  312. TAROPT=vI
  313. TAREXT=.tar.bz2
  314. else
  315. TAROPT=vz
  316. TAREXT=.tar.gz
  317. endif
  318. LOADEREXT=.as
  319. EXEEXT=.exe
  320. PPLEXT=.ppl
  321. PPUEXT=.ppu
  322. OEXT=.o
  323. ASMEXT=.s
  324. SMARTEXT=.sl
  325. STATICLIBEXT=.a
  326. SHAREDLIBEXT=.so
  327. STATICLIBPREFIX=libp
  328. RSTEXT=.rst
  329. FPCMADE=fpcmade
  330. ifeq ($(OS_TARGET),go32v1)
  331. PPUEXT=.pp1
  332. OEXT=.o1
  333. ASMEXT=.s1
  334. SMARTEXT=.sl1
  335. STATICLIBEXT=.a1
  336. SHAREDLIBEXT=.so1
  337. STATICLIBPREFIX=
  338. FPCMADE=fpcmade.v1
  339. PACKAGESUFFIX=v1
  340. endif
  341. ifeq ($(OS_TARGET),go32v2)
  342. STATICLIBPREFIX=
  343. FPCMADE=fpcmade.dos
  344. ZIPSUFFIX=go32
  345. endif
  346. ifeq ($(OS_TARGET),linux)
  347. EXEEXT=
  348. HASSHAREDLIB=1
  349. FPCMADE=fpcmade.lnx
  350. ZIPSUFFIX=linux
  351. endif
  352. ifeq ($(OS_TARGET),freebsd)
  353. EXEEXT=
  354. HASSHAREDLIB=1
  355. FPCMADE=fpcmade.freebsd
  356. ZIPSUFFIX=freebsd
  357. endif
  358. ifeq ($(OS_TARGET),win32)
  359. PPUEXT=.ppw
  360. OEXT=.ow
  361. ASMEXT=.sw
  362. SMARTEXT=.slw
  363. STATICLIBEXT=.aw
  364. SHAREDLIBEXT=.dll
  365. FPCMADE=fpcmade.w32
  366. ZIPSUFFIX=w32
  367. endif
  368. ifeq ($(OS_TARGET),os2)
  369. PPUEXT=.ppo
  370. ASMEXT=.so2
  371. OEXT=.oo2
  372. AOUTEXT=.out
  373. SMARTEXT=.so
  374. STATICLIBEXT=.ao2
  375. SHAREDLIBEXT=.dll
  376. FPCMADE=fpcmade.os2
  377. ZIPSUFFIX=emx
  378. endif
  379. ifeq ($(OS_TARGET),amiga)
  380. EXEEXT=
  381. PPUEXT=.ppa
  382. ASMEXT=.asm
  383. OEXT=.o
  384. SMARTEXT=.sl
  385. STATICLIBEXT=.a
  386. SHAREDLIBEXT=.library
  387. FPCMADE=fpcmade.amg
  388. endif
  389. ifeq ($(OS_TARGET),atari)
  390. PPUEXT=.ppt
  391. ASMEXT=.s
  392. OEXT=.o
  393. SMARTEXT=.sl
  394. STATICLIBEXT=.a
  395. EXEEXT=.ttp
  396. FPCMADE=fpcmade.ata
  397. endif
  398. ifdef REQUIRE_UNITSDIR
  399. override UNITSDIR+=$(REQUIRE_UNITSDIR)
  400. endif
  401. ifdef REQUIRE_PACKAGESDIR
  402. override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
  403. endif
  404. ifdef ZIPINSTALL
  405. ifeq ($(OS_TARGET),linux)
  406. UNIXINSTALLDIR=1
  407. endif
  408. ifeq ($(OS_TARGET),freebsd)
  409. UNIXINSTALLDIR=1
  410. endif
  411. else
  412. ifeq ($(OS_SOURCE),linux)
  413. UNIXINSTALLDIR=1
  414. endif
  415. ifeq ($(OS_SOURCE),freebsd)
  416. UNIXINSTALLDIR=1
  417. endif
  418. endif
  419. ifndef INSTALL_PREFIX
  420. ifdef UNIXINSTALLDIR
  421. INSTALL_PREFIX=/usr/local
  422. else
  423. ifdef INSTALL_FPCPACKAGE
  424. INSTALL_BASEDIR:=/pp
  425. else
  426. INSTALL_BASEDIR:=/$(PACKAGE_NAME)
  427. endif
  428. endif
  429. endif
  430. export INSTALL_PREFIX
  431. ifndef DIST_DESTDIR
  432. DIST_DESTDIR:=$(BASEDIR)
  433. endif
  434. export DIST_DESTDIR
  435. ifndef INSTALL_BASEDIR
  436. ifdef UNIXINSTALLDIR
  437. ifdef INSTALL_FPCPACKAGE
  438. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
  439. else
  440. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
  441. endif
  442. else
  443. INSTALL_BASEDIR:=$(INSTALL_PREFIX)
  444. endif
  445. endif
  446. ifndef INSTALL_BINDIR
  447. ifdef UNIXINSTALLDIR
  448. INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
  449. else
  450. INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
  451. ifdef INSTALL_FPCPACKAGE
  452. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)
  453. endif
  454. endif
  455. endif
  456. ifndef INSTALL_UNITDIR
  457. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(OS_TARGET)
  458. ifdef INSTALL_FPCPACKAGE
  459. ifdef PACKAGE_NAME
  460. INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
  461. endif
  462. endif
  463. endif
  464. ifndef INSTALL_LIBDIR
  465. ifdef UNIXINSTALLDIR
  466. INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
  467. else
  468. INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
  469. endif
  470. endif
  471. ifndef INSTALL_SOURCEDIR
  472. ifdef UNIXINSTALLDIR
  473. ifdef INSTALL_FPCPACKAGE
  474. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  475. else
  476. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  477. endif
  478. else
  479. ifdef INSTALL_FPCPACKAGE
  480. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
  481. else
  482. INSTALL_SOURCEDIRL:=$(INSTALL_BASEDIR)/source
  483. endif
  484. endif
  485. endif
  486. ifndef INSTALL_DOCDIR
  487. ifdef UNIXINSTALLDIR
  488. ifdef INSTALL_FPCPACKAGE
  489. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  490. else
  491. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  492. endif
  493. else
  494. ifdef INSTALL_FPCPACKAGE
  495. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
  496. else
  497. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
  498. endif
  499. endif
  500. endif
  501. ifndef INSTALL_EXAMPLEDIR
  502. ifdef UNIXINSTALLDIR
  503. ifdef INSTALL_FPCPACKAGE
  504. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
  505. else
  506. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  507. endif
  508. else
  509. ifdef INSTALL_FPCPACKAGE
  510. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
  511. else
  512. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
  513. endif
  514. endif
  515. endif
  516. ifndef INSTALL_DATADIR
  517. INSTALL_DATADIR=$(INSTALL_BASEDIR)
  518. endif
  519. override FPCOPTDEF=$(CPU_TARGET)
  520. ifneq ($(OS_TARGET),$(OS_SOURCE))
  521. override FPCOPT+=-T$(OS_TARGET)
  522. endif
  523. ifdef UNITDIR
  524. override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
  525. endif
  526. ifdef LIBDIR
  527. override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
  528. endif
  529. ifdef OBJDIR
  530. override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
  531. endif
  532. ifdef INCDIR
  533. override FPCOPT+=$(addprefix -Fi,$(INCDIR))
  534. endif
  535. ifdef LINKSMART
  536. override FPCOPT+=-XX
  537. endif
  538. ifdef CREATESMART
  539. override FPCOPT+=-CX
  540. endif
  541. ifdef DEBUG
  542. override FPCOPT+=-gl
  543. override FPCOPTDEF+=DEBUG
  544. endif
  545. ifdef RELEASE
  546. override FPCOPT+=-Xs -OG2p3 -n
  547. override FPCOPTDEF+=RELEASE
  548. endif
  549. ifdef STRIP
  550. override FPCOPT+=-Xs
  551. endif
  552. ifdef OPTIMIZE
  553. override FPCOPT+=-OG2p3
  554. endif
  555. ifdef VERBOSE
  556. override FPCOPT+=-vwni
  557. endif
  558. ifdef COMPILER_OPTIONS
  559. override FPCOPT+=$(COMPILER_OPTIONS)
  560. endif
  561. ifdef COMPILER_UNITDIR
  562. override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
  563. endif
  564. ifdef COMPILER_LIBRARYDIR
  565. override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
  566. endif
  567. ifdef COMPILER_OBJECTDIR
  568. override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
  569. endif
  570. ifdef COMPILER_INCLUDEDIR
  571. override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
  572. endif
  573. ifdef COMPILER_TARGETDIR
  574. override FPCOPT+=-FE$(COMPILER_TARGETDIR)
  575. ifeq ($(COMPILER_TARGETDIR),.)
  576. override TARGETDIRPREFIX=
  577. else
  578. override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
  579. endif
  580. endif
  581. ifdef COMPILER_UNITTARGETDIR
  582. override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
  583. ifeq ($(COMPILER_UNITTARGETDIR),.)
  584. override UNITTARGETDIRPREFIX=
  585. else
  586. override UNITTARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
  587. endif
  588. else
  589. ifdef COMPILER_TARGETDIR
  590. override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
  591. override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
  592. endif
  593. endif
  594. ifdef OPT
  595. override FPCOPT+=$(OPT)
  596. endif
  597. ifdef FPCOPTDEF
  598. override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
  599. endif
  600. ifdef CFGFILE
  601. override FPCOPT+=@$(CFGFILE)
  602. endif
  603. ifdef USEENV
  604. override FPCEXTCMD:=$(FPCOPT)
  605. override FPCOPT:=!FPCEXTCMD
  606. export FPCEXTCMD
  607. endif
  608. override COMPILER:=$(FPC) $(FPCOPT)
  609. ifeq (,$(findstring -s ,$(COMPILER)))
  610. EXECPPAS=
  611. else
  612. ifeq ($(OS_SOURCE),$(OS_TARGET))
  613. EXECPPAS:=@$(PPAS)
  614. endif
  615. endif
  616. ifdef TARGET_RSTS
  617. override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
  618. override CLEANRSTFILES+=$(RSTFILES)
  619. endif
  620. .PHONY: fpc_clean fpc_cleanall fpc_distclean
  621. ifdef EXEFILES
  622. override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
  623. endif
  624. ifdef CLEAN_UNITS
  625. override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
  626. endif
  627. ifdef CLEANPPUFILES
  628. override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
  629. override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
  630. override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
  631. endif
  632. fpc_clean: $(CLEANTARGET)
  633. ifdef CLEANEXEFILES
  634. -$(DEL) $(CLEANEXEFILES)
  635. endif
  636. ifdef CLEANPPUFILES
  637. -$(DEL) $(CLEANPPUFILES)
  638. endif
  639. ifneq ($(CLEANPPULINKFILES),)
  640. -$(DEL) $(CLEANPPULINKFILES)
  641. endif
  642. ifdef CLEANRSTFILES
  643. -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
  644. endif
  645. ifdef CLEAN_FILES
  646. -$(DEL) $(CLEAN_FILES)
  647. endif
  648. ifdef LIB_NAME
  649. -$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
  650. endif
  651. -$(DEL) $(FPCMADE) Package.fpc $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
  652. fpc_distclean: clean
  653. ifdef COMPILER_UNITTARGETDIR
  654. TARGETDIRCLEAN=fpc_clean
  655. endif
  656. fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
  657. ifdef CLEANEXEFILES
  658. -$(DEL) $(CLEANEXEFILES)
  659. endif
  660. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  661. -$(DELTREE) *$(SMARTEXT)
  662. -$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
  663. ifdef AOUTEXT
  664. -$(DEL) *$(AOUTEXT)
  665. endif
  666. .PHONY: fpc_info
  667. fpc_info:
  668. @$(ECHO)
  669. @$(ECHO) == Package info ==
  670. @$(ECHO) Package Name..... $(PACKAGE_NAME)
  671. @$(ECHO) Package Version.. $(PACKAGE_VERSION)
  672. @$(ECHO)
  673. @$(ECHO) == Configuration info ==
  674. @$(ECHO)
  675. @$(ECHO) FPC.......... $(FPC)
  676. @$(ECHO) FPC Version.. $(FPC_VERSION)
  677. @$(ECHO) Source CPU... $(CPU_SOURCE)
  678. @$(ECHO) Target CPU... $(CPU_TARGET)
  679. @$(ECHO) Source OS.... $(OS_SOURCE)
  680. @$(ECHO) Target OS.... $(OS_TARGET)
  681. @$(ECHO)
  682. @$(ECHO) == Directory info ==
  683. @$(ECHO)
  684. @$(ECHO) Basedir......... $(BASEDIR)
  685. @$(ECHO) FPCDir.......... $(FPCDIR)
  686. @$(ECHO) UnitsDir........ $(UNITSDIR)
  687. @$(ECHO) PackagesDir..... $(PACKAGESDIR)
  688. @$(ECHO)
  689. @$(ECHO) GCC library..... $(GCCLIBDIR)
  690. @$(ECHO) Other library... $(OTHERLIBDIR)
  691. @$(ECHO)
  692. @$(ECHO) == Tools info ==
  693. @$(ECHO)
  694. @$(ECHO) Pwd....... $(PWD)
  695. @$(ECHO) Mv........ $(MVPROG)
  696. @$(ECHO) Cp........ $(CPPROG)
  697. @$(ECHO) Rm........ $(RMPROG)
  698. @$(ECHO) GInstall.. $(GINSTALL)
  699. @$(ECHO) Echo...... $(ECHO)
  700. @$(ECHO) Date...... $(DATE)
  701. @$(ECHO) FPCMake... $(FPCMAKE)
  702. @$(ECHO) PPUMove... $(PPUMOVE)
  703. @$(ECHO) Upx....... $(UPXPROG)
  704. @$(ECHO) Zip....... $(ZIPPROG)
  705. @$(ECHO)
  706. @$(ECHO) == Object info ==
  707. @$(ECHO)
  708. @$(ECHO) Target Loaders...... $(TARGET_LOADERS)
  709. @$(ECHO) Target Units........ $(TARGET_UNITS)
  710. @$(ECHO) Target Programs..... $(TARGET_PROGRAMS)
  711. @$(ECHO) Target Dirs......... $(TARGET_DIRS)
  712. @$(ECHO) Target Examples..... $(TARGET_EXAMPLES)
  713. @$(ECHO) Target ExampleDirs.. $(TARGET_EXAMPLEDIRS)
  714. @$(ECHO)
  715. @$(ECHO) Clean Units......... $(CLEAN_UNITS)
  716. @$(ECHO) Clean Files......... $(CLEAN_FILES)
  717. @$(ECHO)
  718. @$(ECHO) Install Units....... $(INSTALL_UNITS)
  719. @$(ECHO) Install Files....... $(INSTALL_FILES)
  720. @$(ECHO)
  721. @$(ECHO) == Install info ==
  722. @$(ECHO)
  723. @$(ECHO) DateStr.............. $(DATESTR)
  724. @$(ECHO) ZipPrefix............ $(ZIPPREFIX)
  725. @$(ECHO) ZipSuffix............ $(ZIPSUFFIX)
  726. @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE)
  727. @$(ECHO)
  728. @$(ECHO) Install base dir..... $(INSTALL_BASEDIR)
  729. @$(ECHO) Install binary dir... $(INSTALL_BINDIR)
  730. @$(ECHO) Install library dir.. $(INSTALL_LIBDIR)
  731. @$(ECHO) Install units dir.... $(INSTALL_UNITDIR)
  732. @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR)
  733. @$(ECHO) Install doc dir...... $(INSTALL_DOCDIR)
  734. @$(ECHO) Install example dir.. $(INSTALL_EXAMPLEDIR)
  735. @$(ECHO) Install data dir..... $(INSTALL_DATADIR)
  736. @$(ECHO)
  737. @$(ECHO) Dist destination dir. $(DIST_DESTDIR)
  738. @$(ECHO) Dist zip name........ $(DIST_ZIPNAME)
  739. @$(ECHO)
  740. all:
  741. debug:
  742. smart:
  743. examples:
  744. shared:
  745. install:
  746. sourceinstall:
  747. exampleinstall:
  748. distinstall:
  749. zipinstall:
  750. zipsourceinstall:
  751. zipexampleinstall:
  752. zipdistinstall:
  753. clean:
  754. distclean:
  755. cleanall:
  756. info: fpc_info
  757. .PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info
  758. ifneq ($(wildcard fpcmake.loc),)
  759. include fpcmake.loc
  760. endif
  761. testgdbm$(EXEEXT): testgdbm.pp gdbm$(PPUEXT)
  762. testgdbm2$(EXEEXT): testgdbm2.pp gdbm$(PPUEXT)