Makefile 26 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109
  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. override FPCDIR=../..
  111. ifeq ($(wildcard $(FPCDIR)/rtl),)
  112. ifeq ($(wildcard $(FPCDIR)/units),)
  113. override FPCDIR=wrong
  114. endif
  115. endif
  116. endif
  117. ifeq ($(FPCDIR),wrong)
  118. ifdef inUnix
  119. override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
  120. ifeq ($(wildcard $(FPCDIR)/units),)
  121. override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
  122. endif
  123. else
  124. override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
  125. override FPCDIR:=$(FPCDIR)/..
  126. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  127. override FPCDIR:=$(FPCDIR)/..
  128. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  129. override FPCDIR=c:/pp
  130. endif
  131. endif
  132. endif
  133. endif
  134. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
  135. PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages)
  136. override TARGET_PROGRAMS+=fpcmake
  137. override TARGET_RSTS+=fpcmmain
  138. override CLEAN_UNITS+=fpcmmain fpcmdic fpcmwr fpcmpkg
  139. override INSTALL_FPCPACKAGE=y
  140. ifndef ECHO
  141. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  142. ifeq ($(ECHO),)
  143. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  144. ifeq ($(ECHO),)
  145. ECHO=
  146. else
  147. ECHO:=$(firstword $(ECHO))
  148. endif
  149. else
  150. ECHO:=$(firstword $(ECHO))
  151. endif
  152. endif
  153. export ECHO
  154. ifndef DATE
  155. DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
  156. ifeq ($(DATE),)
  157. DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
  158. ifeq ($(DATE),)
  159. DATE=
  160. else
  161. DATE:=$(firstword $(DATE))
  162. endif
  163. else
  164. DATE:=$(firstword $(DATE))
  165. endif
  166. endif
  167. export DATE
  168. ifndef GINSTALL
  169. GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
  170. ifeq ($(GINSTALL),)
  171. GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
  172. ifeq ($(GINSTALL),)
  173. GINSTALL=
  174. else
  175. GINSTALL:=$(firstword $(GINSTALL))
  176. endif
  177. else
  178. GINSTALL:=$(firstword $(GINSTALL))
  179. endif
  180. endif
  181. export GINSTALL
  182. ifndef CPPROG
  183. CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
  184. ifeq ($(CPPROG),)
  185. CPPROG=
  186. else
  187. CPPROG:=$(firstword $(CPPROG))
  188. endif
  189. endif
  190. export CPPROG
  191. ifndef RMPROG
  192. RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
  193. ifeq ($(RMPROG),)
  194. RMPROG=
  195. else
  196. RMPROG:=$(firstword $(RMPROG))
  197. endif
  198. endif
  199. export RMPROG
  200. ifndef MVPROG
  201. MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
  202. ifeq ($(MVPROG),)
  203. MVPROG=
  204. else
  205. MVPROG:=$(firstword $(MVPROG))
  206. endif
  207. endif
  208. export MVPROG
  209. ifndef ECHOREDIR
  210. ECHOREDIR:=$(subst /,$(PATHSEP),$(ECHO))
  211. endif
  212. ifndef COPY
  213. COPY:=$(CPPROG) -fp
  214. endif
  215. ifndef COPYTREE
  216. COPYTREE:=$(CPPROG) -rfp
  217. endif
  218. ifndef MOVE
  219. MOVE:=$(MVPROG) -f
  220. endif
  221. ifndef DEL
  222. DEL:=$(RMPROG) -f
  223. endif
  224. ifndef DELTREE
  225. DELTREE:=$(RMPROG) -rf
  226. endif
  227. ifndef INSTALL
  228. ifdef inUnix
  229. INSTALL:=$(GINSTALL) -c -m 644
  230. else
  231. INSTALL:=$(COPY)
  232. endif
  233. endif
  234. ifndef INSTALLEXE
  235. ifdef inUnix
  236. INSTALLEXE:=$(GINSTALL) -c -m 755
  237. else
  238. INSTALLEXE:=$(COPY)
  239. endif
  240. endif
  241. ifndef MKDIR
  242. MKDIR:=$(GINSTALL) -m 755 -d
  243. endif
  244. export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
  245. ifndef PPUMOVE
  246. PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
  247. ifeq ($(PPUMOVE),)
  248. PPUMOVE=
  249. else
  250. PPUMOVE:=$(firstword $(PPUMOVE))
  251. endif
  252. endif
  253. export PPUMOVE
  254. ifndef FPCMAKE
  255. FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
  256. ifeq ($(FPCMAKE),)
  257. FPCMAKE=
  258. else
  259. FPCMAKE:=$(firstword $(FPCMAKE))
  260. endif
  261. endif
  262. export FPCMAKE
  263. ifndef ZIPPROG
  264. ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
  265. ifeq ($(ZIPPROG),)
  266. ZIPPROG=
  267. else
  268. ZIPPROG:=$(firstword $(ZIPPROG))
  269. endif
  270. endif
  271. export ZIPPROG
  272. ifndef TARPROG
  273. TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
  274. ifeq ($(TARPROG),)
  275. TARPROG=
  276. else
  277. TARPROG:=$(firstword $(TARPROG))
  278. endif
  279. endif
  280. export TARPROG
  281. ifndef AS
  282. AS=as
  283. endif
  284. ifndef LD
  285. LD=ld
  286. endif
  287. ifndef RC
  288. RC=rc
  289. endif
  290. PPAS=ppas$(BATCHEXT)
  291. ifdef inUnix
  292. LDCONFIG=ldconfig
  293. else
  294. LDCONFIG=
  295. endif
  296. ifdef DATE
  297. DATESTR:=$(shell $(DATE) +%Y%m%d)
  298. else
  299. DATESTR=
  300. endif
  301. ifndef UPXPROG
  302. ifeq ($(OS_TARGET),go32v2)
  303. UPXPROG:=1
  304. endif
  305. ifeq ($(OS_TARGET),win32)
  306. UPXPROG:=1
  307. endif
  308. ifdef UPXPROG
  309. UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
  310. ifeq ($(UPXPROG),)
  311. UPXPROG=
  312. else
  313. UPXPROG:=$(firstword $(UPXPROG))
  314. endif
  315. else
  316. UPXPROG=
  317. endif
  318. endif
  319. export UPXPROG
  320. ZIPOPT=-9
  321. ZIPEXT=.zip
  322. ifeq ($(USETAR),bz2)
  323. TAROPT=vI
  324. TAREXT=.tar.bz2
  325. else
  326. TAROPT=vz
  327. TAREXT=.tar.gz
  328. endif
  329. LOADEREXT=.as
  330. EXEEXT=.exe
  331. PPLEXT=.ppl
  332. PPUEXT=.ppu
  333. OEXT=.o
  334. ASMEXT=.s
  335. SMARTEXT=.sl
  336. STATICLIBEXT=.a
  337. SHAREDLIBEXT=.so
  338. STATICLIBPREFIX=libp
  339. RSTEXT=.rst
  340. FPCMADE=fpcmade
  341. ifeq ($(OS_TARGET),go32v1)
  342. PPUEXT=.pp1
  343. OEXT=.o1
  344. ASMEXT=.s1
  345. SMARTEXT=.sl1
  346. STATICLIBEXT=.a1
  347. SHAREDLIBEXT=.so1
  348. STATICLIBPREFIX=
  349. FPCMADE=fpcmade.v1
  350. PACKAGESUFFIX=v1
  351. endif
  352. ifeq ($(OS_TARGET),go32v2)
  353. STATICLIBPREFIX=
  354. FPCMADE=fpcmade.dos
  355. ZIPSUFFIX=go32
  356. endif
  357. ifeq ($(OS_TARGET),linux)
  358. EXEEXT=
  359. HASSHAREDLIB=1
  360. FPCMADE=fpcmade.lnx
  361. ZIPSUFFIX=linux
  362. endif
  363. ifeq ($(OS_TARGET),freebsd)
  364. EXEEXT=
  365. HASSHAREDLIB=1
  366. FPCMADE=fpcmade.freebsd
  367. ZIPSUFFIX=freebsd
  368. endif
  369. ifeq ($(OS_TARGET),win32)
  370. PPUEXT=.ppw
  371. OEXT=.ow
  372. ASMEXT=.sw
  373. SMARTEXT=.slw
  374. STATICLIBEXT=.aw
  375. SHAREDLIBEXT=.dll
  376. FPCMADE=fpcmade.w32
  377. ZIPSUFFIX=w32
  378. endif
  379. ifeq ($(OS_TARGET),os2)
  380. PPUEXT=.ppo
  381. ASMEXT=.so2
  382. OEXT=.oo2
  383. AOUTEXT=.out
  384. SMARTEXT=.so
  385. STATICLIBEXT=.ao2
  386. SHAREDLIBEXT=.dll
  387. FPCMADE=fpcmade.os2
  388. ZIPSUFFIX=emx
  389. endif
  390. ifeq ($(OS_TARGET),amiga)
  391. EXEEXT=
  392. PPUEXT=.ppa
  393. ASMEXT=.asm
  394. OEXT=.o
  395. SMARTEXT=.sl
  396. STATICLIBEXT=.a
  397. SHAREDLIBEXT=.library
  398. FPCMADE=fpcmade.amg
  399. endif
  400. ifeq ($(OS_TARGET),atari)
  401. PPUEXT=.ppt
  402. ASMEXT=.s
  403. OEXT=.o
  404. SMARTEXT=.sl
  405. STATICLIBEXT=.a
  406. EXEEXT=.ttp
  407. FPCMADE=fpcmade.ata
  408. endif
  409. ifdef REQUIRE_UNITSDIR
  410. override UNITSDIR+=$(REQUIRE_UNITSDIR)
  411. endif
  412. ifdef REQUIRE_PACKAGESDIR
  413. override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
  414. endif
  415. ifdef ZIPINSTALL
  416. ifeq ($(OS_TARGET),linux)
  417. UNIXINSTALLDIR=1
  418. endif
  419. ifeq ($(OS_TARGET),freebsd)
  420. UNIXINSTALLDIR=1
  421. endif
  422. else
  423. ifeq ($(OS_SOURCE),linux)
  424. UNIXINSTALLDIR=1
  425. endif
  426. ifeq ($(OS_SOURCE),freebsd)
  427. UNIXINSTALLDIR=1
  428. endif
  429. endif
  430. ifndef INSTALL_PREFIX
  431. ifdef UNIXINSTALLDIR
  432. INSTALL_PREFIX=/usr/local
  433. else
  434. ifdef INSTALL_FPCPACKAGE
  435. INSTALL_BASEDIR:=/pp
  436. else
  437. INSTALL_BASEDIR:=/$(PACKAGE_NAME)
  438. endif
  439. endif
  440. endif
  441. export INSTALL_PREFIX
  442. ifndef DIST_DESTDIR
  443. DIST_DESTDIR:=$(BASEDIR)
  444. endif
  445. export DIST_DESTDIR
  446. ifndef INSTALL_BASEDIR
  447. ifdef UNIXINSTALLDIR
  448. ifdef INSTALL_FPCPACKAGE
  449. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
  450. else
  451. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
  452. endif
  453. else
  454. INSTALL_BASEDIR:=$(INSTALL_PREFIX)
  455. endif
  456. endif
  457. ifndef INSTALL_BINDIR
  458. ifdef UNIXINSTALLDIR
  459. INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
  460. else
  461. INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
  462. ifdef INSTALL_FPCPACKAGE
  463. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)
  464. endif
  465. endif
  466. endif
  467. ifndef INSTALL_UNITDIR
  468. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(OS_TARGET)
  469. ifdef INSTALL_FPCPACKAGE
  470. ifdef PACKAGE_NAME
  471. INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
  472. endif
  473. endif
  474. endif
  475. ifndef INSTALL_LIBDIR
  476. ifdef UNIXINSTALLDIR
  477. INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
  478. else
  479. INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
  480. endif
  481. endif
  482. ifndef INSTALL_SOURCEDIR
  483. ifdef UNIXINSTALLDIR
  484. ifdef INSTALL_FPCPACKAGE
  485. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  486. else
  487. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  488. endif
  489. else
  490. ifdef INSTALL_FPCPACKAGE
  491. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
  492. else
  493. INSTALL_SOURCEDIRL:=$(INSTALL_BASEDIR)/source
  494. endif
  495. endif
  496. endif
  497. ifndef INSTALL_DOCDIR
  498. ifdef UNIXINSTALLDIR
  499. ifdef INSTALL_FPCPACKAGE
  500. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  501. else
  502. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  503. endif
  504. else
  505. ifdef INSTALL_FPCPACKAGE
  506. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
  507. else
  508. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
  509. endif
  510. endif
  511. endif
  512. ifndef INSTALL_EXAMPLEDIR
  513. ifdef UNIXINSTALLDIR
  514. ifdef INSTALL_FPCPACKAGE
  515. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
  516. else
  517. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  518. endif
  519. else
  520. ifdef INSTALL_FPCPACKAGE
  521. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
  522. else
  523. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
  524. endif
  525. endif
  526. endif
  527. ifndef INSTALL_DATADIR
  528. INSTALL_DATADIR=$(INSTALL_BASEDIR)
  529. endif
  530. ifdef inUnix
  531. ifndef GCCLIBDIR
  532. GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
  533. endif
  534. ifndef OTHERLIBDIR
  535. OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
  536. endif
  537. export GCCLIBDIR OTHERLIB
  538. endif
  539. ifeq ($(OS_TARGET),linux)
  540. REQUIRE_PACKAGES_RTL=1
  541. REQUIRE_PACKAGES_PASZLIB=1
  542. REQUIRE_PACKAGES_INET=1
  543. REQUIRE_PACKAGES_FCL=1
  544. REQUIRE_PACKAGES_MYSQL=1
  545. REQUIRE_PACKAGES_IBASE=1
  546. endif
  547. ifeq ($(OS_TARGET),go32v2)
  548. REQUIRE_PACKAGES_RTL=1
  549. REQUIRE_PACKAGES_PASZLIB=1
  550. REQUIRE_PACKAGES_FCL=1
  551. endif
  552. ifeq ($(OS_TARGET),win32)
  553. REQUIRE_PACKAGES_RTL=1
  554. REQUIRE_PACKAGES_PASZLIB=1
  555. REQUIRE_PACKAGES_FCL=1
  556. REQUIRE_PACKAGES_MYSQL=1
  557. REQUIRE_PACKAGES_IBASE=1
  558. endif
  559. ifeq ($(OS_TARGET),os2)
  560. REQUIRE_PACKAGES_RTL=1
  561. REQUIRE_PACKAGES_PASZLIB=1
  562. REQUIRE_PACKAGES_FCL=1
  563. endif
  564. ifeq ($(OS_TARGET),freebsd)
  565. REQUIRE_PACKAGES_RTL=1
  566. REQUIRE_PACKAGES_PASZLIB=1
  567. REQUIRE_PACKAGES_INET=1
  568. REQUIRE_PACKAGES_FCL=1
  569. REQUIRE_PACKAGES_MYSQL=1
  570. REQUIRE_PACKAGES_IBASE=1
  571. endif
  572. ifeq ($(OS_TARGET),beos)
  573. REQUIRE_PACKAGES_RTL=1
  574. REQUIRE_PACKAGES_PASZLIB=1
  575. REQUIRE_PACKAGES_FCL=1
  576. endif
  577. ifeq ($(OS_TARGET),amiga)
  578. REQUIRE_PACKAGES_RTL=1
  579. REQUIRE_PACKAGES_PASZLIB=1
  580. REQUIRE_PACKAGES_FCL=1
  581. endif
  582. ifeq ($(OS_TARGET),atari)
  583. REQUIRE_PACKAGES_RTL=1
  584. REQUIRE_PACKAGES_PASZLIB=1
  585. REQUIRE_PACKAGES_FCL=1
  586. endif
  587. ifdef REQUIRE_PACKAGES_RTL
  588. PACKAGEDIR_RTL:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR)))))
  589. ifneq ($(PACKAGEDIR_RTL),)
  590. PACKAGEDIR_RTL:=$(firstword $(PACKAGEDIR_RTL))
  591. ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
  592. override COMPILEPACKAGES+=package_rtl
  593. package_rtl:
  594. $(MAKE) -C $(PACKAGEDIR_RTL) all
  595. endif
  596. ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
  597. UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
  598. else
  599. UNITDIR_RTL=$(PACKAGEDIR_RTL)
  600. endif
  601. else
  602. PACKAGEDIR_RTL=
  603. UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
  604. ifneq ($(UNITDIR_RTL),)
  605. UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
  606. else
  607. UNITDIR_RTL=
  608. endif
  609. endif
  610. ifdef UNITDIR_RTL
  611. override COMPILER_UNITDIR+=$(UNITDIR_RTL)
  612. endif
  613. endif
  614. ifdef REQUIRE_PACKAGES_PASZLIB
  615. PACKAGEDIR_PASZLIB:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR)))))
  616. ifneq ($(PACKAGEDIR_PASZLIB),)
  617. PACKAGEDIR_PASZLIB:=$(firstword $(PACKAGEDIR_PASZLIB))
  618. ifeq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(FPCMADE)),)
  619. override COMPILEPACKAGES+=package_paszlib
  620. package_paszlib:
  621. $(MAKE) -C $(PACKAGEDIR_PASZLIB) all
  622. endif
  623. ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
  624. UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
  625. else
  626. UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)
  627. endif
  628. else
  629. PACKAGEDIR_PASZLIB=
  630. UNITDIR_PASZLIB:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Package.fpc,$(UNITSDIR)))))
  631. ifneq ($(UNITDIR_PASZLIB),)
  632. UNITDIR_PASZLIB:=$(firstword $(UNITDIR_PASZLIB))
  633. else
  634. UNITDIR_PASZLIB=
  635. endif
  636. endif
  637. ifdef UNITDIR_PASZLIB
  638. override COMPILER_UNITDIR+=$(UNITDIR_PASZLIB)
  639. endif
  640. endif
  641. ifdef REQUIRE_PACKAGES_INET
  642. PACKAGEDIR_INET:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR)))))
  643. ifneq ($(PACKAGEDIR_INET),)
  644. PACKAGEDIR_INET:=$(firstword $(PACKAGEDIR_INET))
  645. ifeq ($(wildcard $(PACKAGEDIR_INET)/$(FPCMADE)),)
  646. override COMPILEPACKAGES+=package_inet
  647. package_inet:
  648. $(MAKE) -C $(PACKAGEDIR_INET) all
  649. endif
  650. ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
  651. UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
  652. else
  653. UNITDIR_INET=$(PACKAGEDIR_INET)
  654. endif
  655. else
  656. PACKAGEDIR_INET=
  657. UNITDIR_INET:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /inet/Package.fpc,$(UNITSDIR)))))
  658. ifneq ($(UNITDIR_INET),)
  659. UNITDIR_INET:=$(firstword $(UNITDIR_INET))
  660. else
  661. UNITDIR_INET=
  662. endif
  663. endif
  664. ifdef UNITDIR_INET
  665. override COMPILER_UNITDIR+=$(UNITDIR_INET)
  666. endif
  667. endif
  668. ifdef REQUIRE_PACKAGES_FCL
  669. PACKAGEDIR_FCL:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR)))))
  670. ifneq ($(PACKAGEDIR_FCL),)
  671. PACKAGEDIR_FCL:=$(firstword $(PACKAGEDIR_FCL))
  672. ifeq ($(wildcard $(PACKAGEDIR_FCL)/$(FPCMADE)),)
  673. override COMPILEPACKAGES+=package_fcl
  674. package_fcl:
  675. $(MAKE) -C $(PACKAGEDIR_FCL) all
  676. endif
  677. ifneq ($(wildcard $(PACKAGEDIR_FCL)/$(OS_TARGET)),)
  678. UNITDIR_FCL=$(PACKAGEDIR_FCL)/$(OS_TARGET)
  679. else
  680. UNITDIR_FCL=$(PACKAGEDIR_FCL)
  681. endif
  682. else
  683. PACKAGEDIR_FCL=
  684. UNITDIR_FCL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /fcl/Package.fpc,$(UNITSDIR)))))
  685. ifneq ($(UNITDIR_FCL),)
  686. UNITDIR_FCL:=$(firstword $(UNITDIR_FCL))
  687. else
  688. UNITDIR_FCL=
  689. endif
  690. endif
  691. ifdef UNITDIR_FCL
  692. override COMPILER_UNITDIR+=$(UNITDIR_FCL)
  693. endif
  694. endif
  695. ifdef REQUIRE_PACKAGES_MYSQL
  696. PACKAGEDIR_MYSQL:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR)))))
  697. ifneq ($(PACKAGEDIR_MYSQL),)
  698. PACKAGEDIR_MYSQL:=$(firstword $(PACKAGEDIR_MYSQL))
  699. ifeq ($(wildcard $(PACKAGEDIR_MYSQL)/$(FPCMADE)),)
  700. override COMPILEPACKAGES+=package_mysql
  701. package_mysql:
  702. $(MAKE) -C $(PACKAGEDIR_MYSQL) all
  703. endif
  704. ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
  705. UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
  706. else
  707. UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)
  708. endif
  709. else
  710. PACKAGEDIR_MYSQL=
  711. UNITDIR_MYSQL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /mysql/Package.fpc,$(UNITSDIR)))))
  712. ifneq ($(UNITDIR_MYSQL),)
  713. UNITDIR_MYSQL:=$(firstword $(UNITDIR_MYSQL))
  714. else
  715. UNITDIR_MYSQL=
  716. endif
  717. endif
  718. ifdef UNITDIR_MYSQL
  719. override COMPILER_UNITDIR+=$(UNITDIR_MYSQL)
  720. endif
  721. endif
  722. ifdef REQUIRE_PACKAGES_IBASE
  723. PACKAGEDIR_IBASE:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR)))))
  724. ifneq ($(PACKAGEDIR_IBASE),)
  725. PACKAGEDIR_IBASE:=$(firstword $(PACKAGEDIR_IBASE))
  726. ifeq ($(wildcard $(PACKAGEDIR_IBASE)/$(FPCMADE)),)
  727. override COMPILEPACKAGES+=package_ibase
  728. package_ibase:
  729. $(MAKE) -C $(PACKAGEDIR_IBASE) all
  730. endif
  731. ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
  732. UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
  733. else
  734. UNITDIR_IBASE=$(PACKAGEDIR_IBASE)
  735. endif
  736. else
  737. PACKAGEDIR_IBASE=
  738. UNITDIR_IBASE:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /ibase/Package.fpc,$(UNITSDIR)))))
  739. ifneq ($(UNITDIR_IBASE),)
  740. UNITDIR_IBASE:=$(firstword $(UNITDIR_IBASE))
  741. else
  742. UNITDIR_IBASE=
  743. endif
  744. endif
  745. ifdef UNITDIR_IBASE
  746. override COMPILER_UNITDIR+=$(UNITDIR_IBASE)
  747. endif
  748. endif
  749. .PHONY: package_rtl package_paszlib package_inet package_fcl package_mysql package_ibase
  750. override FPCOPTDEF=$(CPU_TARGET)
  751. ifneq ($(OS_TARGET),$(OS_SOURCE))
  752. override FPCOPT+=-T$(OS_TARGET)
  753. endif
  754. ifdef UNITDIR
  755. override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
  756. endif
  757. ifdef LIBDIR
  758. override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
  759. endif
  760. ifdef OBJDIR
  761. override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
  762. endif
  763. ifdef INCDIR
  764. override FPCOPT+=$(addprefix -Fi,$(INCDIR))
  765. endif
  766. ifdef LINKSMART
  767. override FPCOPT+=-XX
  768. endif
  769. ifdef CREATESMART
  770. override FPCOPT+=-CX
  771. endif
  772. ifdef DEBUG
  773. override FPCOPT+=-gl
  774. override FPCOPTDEF+=DEBUG
  775. endif
  776. ifdef RELEASE
  777. override FPCOPT+=-Xs -OG2p3 -n
  778. override FPCOPTDEF+=RELEASE
  779. endif
  780. ifdef STRIP
  781. override FPCOPT+=-Xs
  782. endif
  783. ifdef OPTIMIZE
  784. override FPCOPT+=-OG2p3
  785. endif
  786. ifdef VERBOSE
  787. override FPCOPT+=-vwni
  788. endif
  789. ifdef COMPILER_OPTIONS
  790. override FPCOPT+=$(COMPILER_OPTIONS)
  791. endif
  792. ifdef COMPILER_UNITDIR
  793. override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
  794. endif
  795. ifdef COMPILER_LIBRARYDIR
  796. override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
  797. endif
  798. ifdef COMPILER_OBJECTDIR
  799. override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
  800. endif
  801. ifdef COMPILER_INCLUDEDIR
  802. override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
  803. endif
  804. ifdef COMPILER_TARGETDIR
  805. override FPCOPT+=-FE$(COMPILER_TARGETDIR)
  806. ifeq ($(COMPILER_TARGETDIR),.)
  807. override TARGETDIRPREFIX=
  808. else
  809. override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
  810. endif
  811. endif
  812. ifdef COMPILER_UNITTARGETDIR
  813. override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
  814. ifeq ($(COMPILER_UNITTARGETDIR),.)
  815. override UNITTARGETDIRPREFIX=
  816. else
  817. override UNITTARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
  818. endif
  819. else
  820. ifdef COMPILER_TARGETDIR
  821. override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
  822. override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
  823. endif
  824. endif
  825. ifdef GCCLIBDIR
  826. override FPCOPT+=-Fl$(GCCLIBDIR)
  827. endif
  828. ifdef OTHERLIBDIR
  829. override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
  830. endif
  831. ifdef OPT
  832. override FPCOPT+=$(OPT)
  833. endif
  834. ifdef FPCOPTDEF
  835. override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
  836. endif
  837. ifdef CFGFILE
  838. override FPCOPT+=@$(CFGFILE)
  839. endif
  840. ifdef USEENV
  841. override FPCEXTCMD:=$(FPCOPT)
  842. override FPCOPT:=!FPCEXTCMD
  843. export FPCEXTCMD
  844. endif
  845. override COMPILER:=$(FPC) $(FPCOPT)
  846. ifeq (,$(findstring -s ,$(COMPILER)))
  847. EXECPPAS=
  848. else
  849. ifeq ($(OS_SOURCE),$(OS_TARGET))
  850. EXECPPAS:=@$(PPAS)
  851. endif
  852. endif
  853. .PHONY: fpc_exes
  854. ifdef TARGET_PROGRAMS
  855. override EXEFILES=$(addsuffix $(EXEEXT),$(TARGET_PROGRAMS))
  856. override EXEOFILES:=$(addsuffix $(OEXT),$(TARGET_PROGRAMS)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS)))
  857. override ALLTARGET+=fpc_exes
  858. override INSTALLEXEFILES+=$(EXEFILES)
  859. override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
  860. ifeq ($(OS_TARGET),os2)
  861. override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
  862. endif
  863. endif
  864. fpc_exes: $(EXEFILES)
  865. ifdef TARGET_RSTS
  866. override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
  867. override CLEANRSTFILES+=$(RSTFILES)
  868. endif
  869. .PHONY: fpc_packages fpc_all fpc_smart fpc_debug
  870. $(FPCMADE): $(ALLTARGET)
  871. @$(ECHOREDIR) Compiled > $(FPCMADE)
  872. fpc_packages: $(COMPILEPACKAGES)
  873. fpc_all: fpc_packages $(FPCMADE)
  874. fpc_smart:
  875. $(MAKE) all LINKSMART=1 CREATESMART=1
  876. fpc_debug:
  877. $(MAKE) all DEBUG=1
  878. .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
  879. %$(PPUEXT): %.pp
  880. $(COMPILER) $<
  881. $(EXECPPAS)
  882. %$(PPUEXT): %.pas
  883. $(COMPILER) $<
  884. $(EXECPPAS)
  885. %$(EXEEXT): %.pp
  886. $(COMPILER) $<
  887. $(EXECPPAS)
  888. %$(EXEEXT): %.pas
  889. $(COMPILER) $<
  890. $(EXECPPAS)
  891. vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  892. vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  893. vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
  894. .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
  895. ifdef INSTALL_UNITS
  896. override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
  897. endif
  898. ifdef INSTALLPPUFILES
  899. override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
  900. override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPUFILES))
  901. override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPULINKFILES)))
  902. override INSTALL_CREATEPACKAGEFPC=1
  903. endif
  904. ifdef INSTALLEXEFILES
  905. override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
  906. endif
  907. fpc_install: $(INSTALLTARGET)
  908. ifdef INSTALLEXEFILES
  909. $(MKDIR) $(INSTALL_BINDIR)
  910. ifdef UPXPROG
  911. -$(UPXPROG) $(INSTALLEXEFILES)
  912. endif
  913. $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
  914. endif
  915. ifdef INSTALL_CREATEPACKAGEFPC
  916. ifdef FPCMAKE
  917. ifdef PACKAGE_VERSION
  918. ifneq ($(wildcard Makefile.fpc),)
  919. $(FPCMAKE) -p Makefile.fpc
  920. $(MKDIR) $(INSTALL_UNITDIR)
  921. $(INSTALL) Package.fpc $(INSTALL_UNITDIR)
  922. endif
  923. endif
  924. endif
  925. endif
  926. ifdef INSTALLPPUFILES
  927. $(MKDIR) $(INSTALL_UNITDIR)
  928. $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
  929. ifneq ($(INSTALLPPULINKFILES),)
  930. $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
  931. endif
  932. ifneq ($(wildcard $(LIB_FULLNAME)),)
  933. $(MKDIR) $(INSTALL_LIBDIR)
  934. $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
  935. ifdef inUnix
  936. ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
  937. endif
  938. endif
  939. endif
  940. ifdef INSTALL_FILES
  941. $(MKDIR) $(INSTALL_DATADIR)
  942. $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
  943. endif
  944. fpc_sourceinstall: distclean
  945. $(MKDIR) $(INSTALL_SOURCEDIR)
  946. $(COPYTREE) $(BASEDIR) $(INSTALL_SOURCEDIR)
  947. fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
  948. ifdef HASEXAMPLES
  949. $(MKDIR) $(INSTALL_EXAMPLEDIR)
  950. endif
  951. ifdef EXAMPLESOURCEFILES
  952. $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
  953. endif
  954. ifdef TARGET_EXAMPLEDIRS
  955. $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
  956. endif
  957. .PHONY: fpc_clean fpc_cleanall fpc_distclean
  958. ifdef EXEFILES
  959. override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
  960. endif
  961. ifdef CLEAN_UNITS
  962. override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
  963. endif
  964. ifdef CLEANPPUFILES
  965. override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
  966. override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
  967. override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
  968. endif
  969. fpc_clean: $(CLEANTARGET)
  970. ifdef CLEANEXEFILES
  971. -$(DEL) $(CLEANEXEFILES)
  972. endif
  973. ifdef CLEANPPUFILES
  974. -$(DEL) $(CLEANPPUFILES)
  975. endif
  976. ifneq ($(CLEANPPULINKFILES),)
  977. -$(DEL) $(CLEANPPULINKFILES)
  978. endif
  979. ifdef CLEANRSTFILES
  980. -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
  981. endif
  982. ifdef CLEAN_FILES
  983. -$(DEL) $(CLEAN_FILES)
  984. endif
  985. ifdef LIB_NAME
  986. -$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
  987. endif
  988. -$(DEL) $(FPCMADE) Package.fpc $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
  989. fpc_distclean: clean
  990. ifdef COMPILER_UNITTARGETDIR
  991. TARGETDIRCLEAN=fpc_clean
  992. endif
  993. fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
  994. ifdef CLEANEXEFILES
  995. -$(DEL) $(CLEANEXEFILES)
  996. endif
  997. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  998. -$(DELTREE) *$(SMARTEXT)
  999. -$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
  1000. ifdef AOUTEXT
  1001. -$(DEL) *$(AOUTEXT)
  1002. endif
  1003. .PHONY: fpc_info
  1004. fpc_info:
  1005. @$(ECHO)
  1006. @$(ECHO) == Package info ==
  1007. @$(ECHO) Package Name..... $(PACKAGE_NAME)
  1008. @$(ECHO) Package Version.. $(PACKAGE_VERSION)
  1009. @$(ECHO)
  1010. @$(ECHO) == Configuration info ==
  1011. @$(ECHO)
  1012. @$(ECHO) FPC.......... $(FPC)
  1013. @$(ECHO) FPC Version.. $(FPC_VERSION)
  1014. @$(ECHO) Source CPU... $(CPU_SOURCE)
  1015. @$(ECHO) Target CPU... $(CPU_TARGET)
  1016. @$(ECHO) Source OS.... $(OS_SOURCE)
  1017. @$(ECHO) Target OS.... $(OS_TARGET)
  1018. @$(ECHO)
  1019. @$(ECHO) == Directory info ==
  1020. @$(ECHO)
  1021. @$(ECHO) Basedir......... $(BASEDIR)
  1022. @$(ECHO) FPCDir.......... $(FPCDIR)
  1023. @$(ECHO) UnitsDir........ $(UNITSDIR)
  1024. @$(ECHO) PackagesDir..... $(PACKAGESDIR)
  1025. @$(ECHO)
  1026. @$(ECHO) GCC library..... $(GCCLIBDIR)
  1027. @$(ECHO) Other library... $(OTHERLIBDIR)
  1028. @$(ECHO)
  1029. @$(ECHO) == Tools info ==
  1030. @$(ECHO)
  1031. @$(ECHO) Pwd....... $(PWD)
  1032. @$(ECHO) Mv........ $(MVPROG)
  1033. @$(ECHO) Cp........ $(CPPROG)
  1034. @$(ECHO) Rm........ $(RMPROG)
  1035. @$(ECHO) GInstall.. $(GINSTALL)
  1036. @$(ECHO) Echo...... $(ECHO)
  1037. @$(ECHO) Date...... $(DATE)
  1038. @$(ECHO) FPCMake... $(FPCMAKE)
  1039. @$(ECHO) PPUMove... $(PPUMOVE)
  1040. @$(ECHO) Upx....... $(UPXPROG)
  1041. @$(ECHO) Zip....... $(ZIPPROG)
  1042. @$(ECHO)
  1043. @$(ECHO) == Object info ==
  1044. @$(ECHO)
  1045. @$(ECHO) Target Loaders...... $(TARGET_LOADERS)
  1046. @$(ECHO) Target Units........ $(TARGET_UNITS)
  1047. @$(ECHO) Target Programs..... $(TARGET_PROGRAMS)
  1048. @$(ECHO) Target Dirs......... $(TARGET_DIRS)
  1049. @$(ECHO) Target Examples..... $(TARGET_EXAMPLES)
  1050. @$(ECHO) Target ExampleDirs.. $(TARGET_EXAMPLEDIRS)
  1051. @$(ECHO)
  1052. @$(ECHO) Clean Units......... $(CLEAN_UNITS)
  1053. @$(ECHO) Clean Files......... $(CLEAN_FILES)
  1054. @$(ECHO)
  1055. @$(ECHO) Install Units....... $(INSTALL_UNITS)
  1056. @$(ECHO) Install Files....... $(INSTALL_FILES)
  1057. @$(ECHO)
  1058. @$(ECHO) == Install info ==
  1059. @$(ECHO)
  1060. @$(ECHO) DateStr.............. $(DATESTR)
  1061. @$(ECHO) ZipPrefix............ $(ZIPPREFIX)
  1062. @$(ECHO) ZipSuffix............ $(ZIPSUFFIX)
  1063. @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE)
  1064. @$(ECHO)
  1065. @$(ECHO) Install base dir..... $(INSTALL_BASEDIR)
  1066. @$(ECHO) Install binary dir... $(INSTALL_BINDIR)
  1067. @$(ECHO) Install library dir.. $(INSTALL_LIBDIR)
  1068. @$(ECHO) Install units dir.... $(INSTALL_UNITDIR)
  1069. @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR)
  1070. @$(ECHO) Install doc dir...... $(INSTALL_DOCDIR)
  1071. @$(ECHO) Install example dir.. $(INSTALL_EXAMPLEDIR)
  1072. @$(ECHO) Install data dir..... $(INSTALL_DATADIR)
  1073. @$(ECHO)
  1074. @$(ECHO) Dist destination dir. $(DIST_DESTDIR)
  1075. @$(ECHO) Dist zip name........ $(DIST_ZIPNAME)
  1076. @$(ECHO)
  1077. ifndef DATA2INC
  1078. DATA2INC:=$(strip $(wildcard $(addsuffix /data2inc$(SRCEXEEXT),$(SEARCHPATH))))
  1079. ifeq ($(DATA2INC),)
  1080. DATA2INC=
  1081. else
  1082. DATA2INC:=$(firstword $(DATA2INC))
  1083. endif
  1084. endif
  1085. export DATA2INC
  1086. all: fpc_all
  1087. debug: fpc_debug
  1088. smart: fpc_smart
  1089. examples:
  1090. shared:
  1091. install: fpc_install
  1092. sourceinstall: fpc_sourceinstall
  1093. exampleinstall: fpc_exampleinstall
  1094. distinstall:
  1095. zipinstall:
  1096. zipsourceinstall:
  1097. zipexampleinstall:
  1098. zipdistinstall:
  1099. clean: fpc_clean
  1100. distclean: fpc_distclean
  1101. cleanall: fpc_cleanall
  1102. info: fpc_info
  1103. .PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info
  1104. ifneq ($(wildcard fpcmake.loc),)
  1105. include fpcmake.loc
  1106. endif
  1107. fpcmake.inc: fpcmake.ini
  1108. $(DATA2INC) -b -s fpcmake.ini fpcmake.inc fpcmakeini
  1109. fpcmake$(EXEEXT): $(wildcard fpcm*.pp) fpcmake.inc