Makefile 17 KB

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