makefile.fpc 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833
  1. #
  2. # $Id$
  3. # Copyright (c) 1998 by the Free Pascal Development Team
  4. #
  5. # Common makefile for Free Pascal
  6. #
  7. # See the file COPYING.FPC, included in this distribution,
  8. # for details about the copyright.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. #
  14. #####################################################################
  15. # Force default settings
  16. #####################################################################
  17. # Latest release version
  18. override RELEASEVER:=0.99.11
  19. #####################################################################
  20. # Autodetect OS (Linux or Dos or Windows NT)
  21. # define inlinux when running under linux
  22. # define inWinNT when running under WinNT
  23. #####################################################################
  24. # We want only / in the path !
  25. override PATH:=$(subst \,/,$(PATH))
  26. PWD=$(strip $(wildcard $(addsuffix /pwd.exe,$(subst ;, ,$(PATH)))))
  27. ifeq ($(PWD),)
  28. PWD=$(strip $(wildcard $(addsuffix /pwd,$(subst :, ,$(PATH)))))
  29. ifeq ($(PWD),)
  30. nopwd:
  31. @echo
  32. @echo You need the GNU pwd,cp,mv,rm,install utils to use this makefile!
  33. @echo Get ftp://tflily.fys.kuleuven.ac.be/pub/fpc/dist/gnuutils.zip
  34. @echo
  35. @exit
  36. else
  37. inlinux=1
  38. endif
  39. else
  40. PWD:=$(subst \,/,$(firstword $(PWD)))
  41. endif
  42. # Detect NT - NT sets OS to Windows_NT
  43. ifndef inlinux
  44. ifeq ($(OS),Windows_NT)
  45. inWinNT=1
  46. endif
  47. endif
  48. #####################################################################
  49. # Check for FPCDIR environment
  50. #####################################################################
  51. ifndef FPCDIR
  52. nofpcdir:
  53. @echo
  54. @echo You need to set the FPCDIR environment variable to use
  55. @echo this Makefile.
  56. @echo Example: SET FPCDIR=/pp
  57. @echo
  58. @exit
  59. endif
  60. #####################################################################
  61. # Targets
  62. #####################################################################
  63. # Target OS
  64. ifndef OS_TARGET
  65. ifdef inlinux
  66. OS_TARGET=linux
  67. else
  68. ifdef inWinNT
  69. OS_TARGET=win32
  70. else
  71. OS_TARGET=go32v2
  72. endif
  73. endif
  74. endif
  75. # Source OS
  76. ifndef OS_SOURCE
  77. ifdef inlinux
  78. OS_SOURCE=linux
  79. else
  80. ifndef inWinNT
  81. OS_SOURCE=win32
  82. else
  83. OS_SOURCE=go32v2
  84. endif
  85. endif
  86. endif
  87. # CPU
  88. ifndef CPU
  89. CPU=i386
  90. endif
  91. # Options
  92. ifndef OPT
  93. OPT=
  94. endif
  95. # What compiler to use ?
  96. ifndef PP
  97. PP=ppc386
  98. endif
  99. # assembler, redefine it if cross compiling
  100. ifndef AS
  101. AS=as
  102. endif
  103. # linker, but probably not used
  104. ifndef LD
  105. LD=ld
  106. endif
  107. # Release ? Then force OPT and don't use extra opts via commandline
  108. ifdef RELEASE
  109. override OPT:=-Xs -OG2p2 -n
  110. endif
  111. # Verbose settings (warning,note,info)
  112. ifdef VERBOSE
  113. override OPT+=-vwni
  114. endif
  115. #####################################################################
  116. # Shell commands
  117. #####################################################################
  118. # To copy pograms
  119. ifndef COPY
  120. COPY=cp -fp
  121. endif
  122. # To move pograms
  123. ifndef MOVE
  124. MOVE=mv -f
  125. endif
  126. # Check delete program
  127. ifndef DEL
  128. DEL=rm -f
  129. endif
  130. # Check deltree program
  131. ifndef DELTREE
  132. DELTREE=rm -rf
  133. endif
  134. # To install files
  135. ifndef INSTALL
  136. ifdef inlinux
  137. INSTALL=install -m 644
  138. else
  139. INSTALL=$(COPY)
  140. # ginstall has the strange thing to stubify all .o files !
  141. #INSTALL=ginstall -m 644
  142. endif
  143. endif
  144. # To install programs
  145. ifndef INSTALLEXE
  146. ifdef inlinux
  147. INSTALLEXE=install -m 755
  148. else
  149. INSTALLEXE=$(COPY)
  150. # ginstall has the strange thing to stubify all .o files !
  151. #INSTALLEXE=ginstall -m 755
  152. endif
  153. endif
  154. # To make a directory.
  155. ifndef MKDIR
  156. ifdef inlinux
  157. MKDIR=install -m 755 -d
  158. else
  159. MKDIR=ginstall -m 755 -d
  160. endif
  161. endif
  162. #####################################################################
  163. # Default Tools
  164. #####################################################################
  165. # ppas.bat / ppas.sh
  166. ifdef inlinux
  167. PPAS=ppas.sh
  168. else
  169. PPAS=ppas.bat
  170. endif
  171. # ldconfig to rebuild .so cache
  172. ifdef inlinux
  173. LDCONFIG=ldconfig
  174. else
  175. LDCONFIG=
  176. endif
  177. # Where is the ppumove program ?
  178. ifndef PPUMOVE
  179. PPUMOVE=ppumove
  180. endif
  181. # diff
  182. ifndef DIFF
  183. DIFF=diff
  184. endif
  185. # date
  186. ifndef DATE
  187. # first try go32v2 specific gdate
  188. DATE=$(strip $(wildcard $(addsuffix /gdate.exe,$(subst ;, ,$(PATH)))))
  189. # try generic date.exe
  190. ifeq ($(DATE),)
  191. DATE=$(strip $(wildcard $(addsuffix /date.exe,$(subst ;, ,$(PATH)))))
  192. # finally try for linux
  193. ifeq ($(DATE),)
  194. DATE=$(strip $(wildcard $(addsuffix /date,$(subst :, ,$(PATH)))))
  195. ifeq ($(DATE),)
  196. DATE=
  197. endif
  198. else
  199. DATE:=$(subst \,/,$(firstword $(DATE)))
  200. endif
  201. else
  202. DATE:=$(subst \,/,$(firstword $(DATE)))
  203. endif
  204. endif
  205. # Sed
  206. ifndef SED
  207. SED=$(strip $(wildcard $(addsuffix /sed.exe,$(subst ;, ,$(PATH)))))
  208. ifeq ($(SED),)
  209. SED=$(strip $(wildcard $(addsuffix /sed,$(subst :, ,$(PATH)))))
  210. ifeq ($(SED),)
  211. SED=
  212. endif
  213. else
  214. SED:=$(subst \,/,$(firstword $(SED)))
  215. endif
  216. endif
  217. # Look if UPX is found for go32v2 and win32
  218. ifeq ($(OS_TARGET),go32v2)
  219. UPX=1
  220. endif
  221. ifeq ($(OS_TARGET),win32)
  222. UPX=1
  223. endif
  224. ifdef UPX
  225. UPX=$(strip $(wildcard $(addsuffix /upx.exe,$(subst ;, ,$(PATH)))))
  226. ifeq ($(UPX),)
  227. UPX=
  228. endif
  229. else
  230. UPX=
  231. endif
  232. # Zip
  233. ifndef ZIP
  234. ZIP=zip -D9 -r
  235. endif
  236. #####################################################################
  237. # Default Directories
  238. #####################################################################
  239. # Base dir
  240. ifdef PWD
  241. BASEDIR=$(shell $(PWD))
  242. endif
  243. # set the directory to the rtl base
  244. ifndef RTLDIR
  245. ifdef RTL
  246. RTLDIR=$(RTL)/$(OS_TARGET)
  247. else
  248. RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
  249. endif
  250. endif
  251. # specify where units are.
  252. ifndef UNITDIR
  253. ifdef UNITS
  254. UNITDIR=$(UNITS)/$(OS_TARGET)
  255. else
  256. UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
  257. endif
  258. endif
  259. # set the prefix directory where to install everything
  260. ifndef PREFIXINSTALLDIR
  261. ifdef inlinux
  262. PREFIXINSTALLDIR=/usr
  263. else
  264. PREFIXINSTALLDIR=$(FPCDIR)
  265. endif
  266. endif
  267. # set the base directory where to install everything
  268. ifndef BASEINSTALLDIR
  269. ifdef inlinux
  270. BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(RELEASEVER)
  271. else
  272. BASEINSTALLDIR=$(PREFIXINSTALLDIR)
  273. endif
  274. endif
  275. #####################################################################
  276. # Install Directories based on BASEINSTALLDIR
  277. #####################################################################
  278. # Linux binary really goes to baseinstalldir
  279. ifndef LIBINSTALLDIR
  280. ifdef inlinux
  281. LIBINSTALLDIR=$(BASEINSTALLDIR)
  282. else
  283. LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
  284. endif
  285. endif
  286. # set the directory where to install the binaries
  287. ifndef BININSTALLDIR
  288. ifdef inlinux
  289. BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
  290. else
  291. BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
  292. endif
  293. endif
  294. # set the directory where to install extra files
  295. ifndef EXTRAINSTALLDIR
  296. EXTRAINSTALLDIR=$(BININSTALLDIR)
  297. endif
  298. # Where the .msg files will be stored
  299. ifndef MSGINSTALLDIR
  300. ifdef inlinux
  301. MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
  302. else
  303. MSGINSTALLDIR=$(BININSTALLDIR)
  304. endif
  305. endif
  306. # Where the doc files will be stored
  307. ifndef DOCINSTALLDIR
  308. ifdef inlinux
  309. DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(RELEASEVER)
  310. else
  311. DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
  312. endif
  313. endif
  314. ########################
  315. # Unit Directories
  316. ########################
  317. # this can be set to 'rtl' when the RTL units are installed
  318. ifndef UNITPREFIX
  319. UNITPREFIX=units
  320. endif
  321. # set the directory where to install the units.
  322. ifndef UNITINSTALLDIR
  323. ifdef inlinux
  324. UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)
  325. else
  326. UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
  327. endif
  328. endif
  329. # set the directory where to install the units.
  330. ifndef STATIC_UNITINSTALLDIR
  331. STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
  332. endif
  333. # set the directory where to install the units.
  334. ifndef SHARED_UNITINSTALLDIR
  335. SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
  336. endif
  337. # set the directory where to install the libs (must exist)
  338. ifndef STATIC_LIBINSTALLDIR
  339. STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
  340. endif
  341. # set the directory where to install the libs (must exist)
  342. ifndef SHARED_LIBINSTALLDIR
  343. ifdef inlinux
  344. SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
  345. else
  346. SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
  347. endif
  348. endif
  349. #####################################################################
  350. # Compiler Command Line
  351. #####################################################################
  352. # Load commandline OPTDEF and add CPU define
  353. override PPOPTDEF:=$(OPTDEF) -d$(CPU)
  354. # Load commandline OPT and add target and unit dir to be sure
  355. override PPOPT:=$(OPT) -T$(OS_TARGET) $(NEEDOPT)
  356. # RTL first and then Unit dir (a unit can override RTLunit)
  357. ifdef RTLDIR
  358. override PPOPT+=$(addprefix -Fu,$(RTLDIR))
  359. endif
  360. ifdef UNITDIR
  361. override PPOPT+=$(addprefix -Fu,$(UNITDIR))
  362. endif
  363. ifdef NEEDUNITDIR
  364. override PPOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
  365. endif
  366. # Library dirs
  367. ifdef LIBDIR
  368. override PPOPT+=$(addprefix -Fl,$(LIBDIR))
  369. endif
  370. ifdef NEEDLIBDIR
  371. override PPOPT+=$(addprefix -Fl,$(NEEDLIBDIR))
  372. endif
  373. # Object dirs
  374. ifdef OBJDIR
  375. override PPOPT+=$(addprefix -Fo,$(OBJDIR))
  376. endif
  377. ifdef NEEDOBJDIR
  378. override PPOPT+=$(addprefix -Fo,$(NEEDOBJDIR))
  379. endif
  380. # Add include dirs INC and PROCINC and OSINC
  381. ifdef INC
  382. override PPOPT+=$(addprefix -Fi,$(INC))
  383. endif
  384. ifdef PROCINC
  385. override PPOPT+=$(addprefix -Fi,$(PROCINC))
  386. endif
  387. ifdef OSINC
  388. override PPOPT+=$(addprefix -Fi,$(OSINC))
  389. endif
  390. # Target dirs
  391. ifdef TARGETDIR
  392. override PPOPT+=-FE$(TARGETDIR)
  393. endif
  394. ifdef UNITTARGETDIR
  395. override PPOPT+=-FU$(UNITTARGETDIR)
  396. endif
  397. # Smartlinking
  398. ifeq ($(SMARTLINK),YES)
  399. ifeq ($(LIBTYPE),shared)
  400. override SMARTLINK=NO
  401. else
  402. override PPOPT+=-Cx
  403. ifneq ($(LIBNAME),)
  404. override PPOPT+=-o$(LIBNAME)
  405. endif
  406. endif
  407. endif
  408. # Add library type, for static libraries smartlinking is automatic used
  409. ifeq ($(LIBTYPE),shared)
  410. override PPOPT+=-CD
  411. ifneq ($(LIBNAME),)
  412. override PPOPT+=-o$(LIBNAME)
  413. endif
  414. else
  415. ifeq ($(LIBTYPE),static)
  416. override PPOPT+=-CS
  417. ifneq ($(LIBNAME),)
  418. override PPOPT+=-o$(LIBNAME)
  419. endif
  420. endif
  421. endif
  422. # Add defines from PPOPTDEF to PPOPT
  423. override PPOPT:=$(PPOPT) $(PPOPTDEF)
  424. # Was a config file specified ?
  425. ifdef CFGFILE
  426. override PPOPT:=$(PPOPT) @$(CFGFILE)
  427. endif
  428. override COMPILER=$(PP) $(PPOPT)
  429. #####################################################################
  430. # Default extensions
  431. #####################################################################
  432. # Default needed extensions (Go32v2,Linux)
  433. PPLEXT=.ppl
  434. PPUEXT=.ppu
  435. OEXT=.o
  436. ASMEXT=.s
  437. SMARTEXT=.sl
  438. STATICLIBEXT=.a
  439. SHAREDLIBEXT=.so
  440. # Executable extension
  441. ifdef inlinux
  442. EXEEXT=
  443. else
  444. EXEEXT=.exe
  445. endif
  446. # Go32v1
  447. ifeq ($(OS_TARGET),go32v1)
  448. PPUEXT=.pp1
  449. OEXT=.o1
  450. ASMEXT=.s1
  451. SMARTEXT=.sl1
  452. STATICLIBEXT=.a1
  453. SHAREDLIBEXT=.so1
  454. endif
  455. # Win32
  456. ifeq ($(OS_TARGET),win32)
  457. PPUEXT=.ppw
  458. OEXT=.ow
  459. ASMEXT=.sw
  460. SMARTEXT=.slw
  461. STATICLIBEXT=.aw
  462. SHAREDLIBEXT=.dll
  463. endif
  464. # OS/2
  465. ifeq ($(OS_TARGET),os2)
  466. PPUEXT=.ppo
  467. ASMEXT=.so2
  468. OEXT=.o2
  469. SMARTEXT=.so
  470. STATICLIBEXT=.ao
  471. SHAREDLIBEXT=.dll
  472. endif
  473. # determine libary extension.
  474. ifeq ($(LIBTYPE),static)
  475. LIBEXT=$(STATICLIBEXT)
  476. else
  477. LIBEXT=$(SHAREDLIBEXT)
  478. endif
  479. # library prefix
  480. LIBPREFIX=lib
  481. ifeq ($(OS_TARGET),go32v2)
  482. LIBPREFIX=
  483. endif
  484. ifeq ($(OS_TARGET),go32v1)
  485. LIBPREFIX=
  486. endif
  487. # determine with .pas extension is used
  488. ifdef EXEOBJECTS
  489. override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(EXEOBJECTS)))))
  490. else
  491. override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(UNITOBJECTS)))))
  492. endif
  493. ifeq ($(TESTPAS),)
  494. PASEXT=.pp
  495. else
  496. PASEXT=.pas
  497. endif
  498. #####################################################################
  499. # Export commandline values, so nesting use the same values
  500. #####################################################################
  501. export FPCDIR FPCMAKE
  502. export RELEASEVER OS_SOURCE OS_TARGET OPT OPTDEF CPU PP RELEASE VERBOSE
  503. export SMARTLINK LIBTYPE LIBNAME
  504. export BASEINSTALLDIR
  505. #####################################################################
  506. # General compile rules
  507. #####################################################################
  508. ifndef NODEFAULTRULES
  509. # Create Filenames
  510. EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
  511. EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
  512. UNITFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
  513. UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
  514. .PHONY : all clean install \
  515. info cfginfo objectinfo installinfo filesinfo
  516. .SUFFIXES : $(EXEEXT) $(PPUEXT) $(PASEXT)
  517. #####################################################################
  518. # Default
  519. #####################################################################
  520. ifdef DEFAULTUNITS
  521. all: units
  522. else
  523. all: units exes
  524. endif
  525. units: $(UNITFILES)
  526. exes: $(EXEFILES)
  527. # General compile rules
  528. %$(PPUEXT): %$(PASEXT)
  529. $(COMPILER) $<
  530. %$(EXEEXT): %$(PASEXT)
  531. $(COMPILER) $<
  532. #####################################################################
  533. # Library
  534. #####################################################################
  535. staticlib:
  536. $(MAKE) libsclean
  537. $(MAKE) all SMARTLINK=YES LIBTYPE=static
  538. sharedlib:
  539. ifdef inlinux
  540. $(MAKE) libsclean
  541. $(MAKE) all LIBTYPE=shared
  542. else
  543. @echo Shared Libraries not supported
  544. endif
  545. libsclean : clean
  546. -$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  547. #####################################################################
  548. # Install rules
  549. #####################################################################
  550. install : all
  551. ifndef DEFAULTUNITS
  552. ifdef EXEOBJECTS
  553. $(MKDIR) $(BININSTALLDIR)
  554. # Compress the exes if upx is defined
  555. ifdef UPX
  556. -$(UPX) $(EXEFILES)
  557. endif
  558. $(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
  559. endif
  560. endif
  561. ifdef UNITOBJECTS
  562. $(MKDIR) $(UNITINSTALLDIR)
  563. $(INSTALL) $(UNITFILES) $(UNITINSTALLDIR)
  564. ifeq ($(SMARTLINK),YES)
  565. $(INSTALL) $(LIBPREFIX)$(LIBNAME)$(LIBEXT) $(UNITINSTALLDIR)
  566. else
  567. -$(INSTALL) $(UNITOFILES) $(UNITINSTALLDIR)
  568. endif
  569. endif
  570. ifdef INSTALLEXTRA
  571. $(INSTALL) $(INSTALLEXTRA) $(EXTRAINSTALLDIR)
  572. endif
  573. staticlibinstall: staticlib
  574. $(MKDIR) $(STATIC_UNITINSTALLDIR)
  575. $(INSTALL) $(UNITFILES) $(STATIC_UNITINSTALLDIR)
  576. $(MKDIR) $(STATIC_LIBINSTALLDIR)
  577. $(INSTALLEXE) *$(STATICLIBEXT) $(STATIC_LIBINSTALLDIR)
  578. sharedlibinstall: sharedlib
  579. $(MKDIR) $(SHARED_UNITINSTALLDIR)
  580. $(INSTALL) $(UNITFILES) $(SHARED_UNITINSTALLDIR)
  581. $(MKDIR) $(SHARED_LIBINSTALLDIR)
  582. $(INSTALLEXE) *$(SHAREDLIBEXT) $(SHARED_LIBINSTALLDIR)
  583. libinstall: staticlibinstall sharedlibinstall
  584. #####################################################################
  585. # Zip
  586. #####################################################################
  587. # Temporary path to pack a file
  588. ifndef PACKDIR
  589. PACKDIR=pack_tmp
  590. endif
  591. # Test dir if none specified
  592. ifndef PACKAGEDIR
  593. PACKAGEDIR=$(BASEDIR)
  594. endif
  595. zipinstall:
  596. # Some checks first
  597. ifndef ZIPNAME
  598. @echo Please specify ZIPNAME!
  599. @exit
  600. endif
  601. make install BASEINSTALLDIR=$(PACKDIR)
  602. cd $(PACKDIR)
  603. $(ZIP) $(PACKAGEDIR)/$(ZIPNAME) *
  604. cd $(BASEDIR)
  605. $(DELTREE) $(PACKDIR)
  606. #####################################################################
  607. # Clean rules
  608. #####################################################################
  609. clean:
  610. -$(DEL) $(UNITOFILES) $(UNITFILES) $(PPAS) link.res log
  611. ifeq ($(SMARTLINK),YES)
  612. -$(DELTREE) *$(SMARTEXT)
  613. endif
  614. ifdef EXEOBJECTS
  615. -$(DEL) $(EXEFILES) $(EXEOFILES)
  616. endif
  617. ifdef EXTRACLEAN
  618. -$(DEL) $(EXTRACLEAN)
  619. endif
  620. #####################################################################
  621. # Depend rules
  622. #####################################################################
  623. depend:
  624. makedep $(UNITOBJECTS)
  625. #####################################################################
  626. # Info rules
  627. #####################################################################
  628. info: cfginfo objectinfo installinfo
  629. cfginfo:
  630. @echo
  631. @echo == Configuration info ==
  632. @echo
  633. @echo FPCDir.... $(FPCDIR)
  634. @echo FPCMake... $(FPCMAKE)
  635. @echo
  636. @echo Target.... $(OS_TARGET)
  637. @echo Source.... $(OS_SOURCE)
  638. @echo Target.... $(OS_TARGET)
  639. @echo Basedir... $(BASEDIR)
  640. @echo Pwd....... $(PWD)
  641. ifdef SED
  642. @echo Sed....... $(SED)
  643. endif
  644. ifdef UPX
  645. @echo Upx....... $(UPX)
  646. endif
  647. @echo
  648. objectinfo:
  649. @echo
  650. @echo == Object info ==
  651. @echo
  652. @echo UnitObjects... $(UNITOBJECTS)
  653. @echo ExeObjects.... $(EXEOBJECTS)
  654. @echo
  655. installinfo:
  656. @echo
  657. @echo == Install info ==
  658. @echo
  659. @echo BaseInstallDir....... $(BASEINSTALLDIR)
  660. @echo BinInstallDir........ $(BININSTALLDIR)
  661. @echo UnitInstallDir....... $(UNITINSTALLDIR)
  662. @echo StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
  663. @echo SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
  664. @echo LibInstallDir........ $(LIBINSTALLDIR)
  665. @echo StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
  666. @echo SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
  667. @echo MsgInstallDir........ $(MSGINSTALLDIR)
  668. @echo DocInstallDir........ $(DOCINSTALLDIR)
  669. @echo ExtraInstallDir...... $(EXTRAINSTALLDIR)
  670. @echo
  671. # try to get the files in the currentdir
  672. PASFILES:=$(wildcard *.pas)
  673. PPFILES:=$(wildcard *.pp)
  674. INCFILES:=$(wildcard *.inc)
  675. MSGFILES:=$(wildcard *.msg)
  676. ASFILES:=$(wildcard *.as)
  677. filesinfo:
  678. @echo
  679. @echo == Files info ==
  680. @echo
  681. ifdef PASFILES
  682. @echo Pas files are $(PASFILES)
  683. endif
  684. ifdef PPFILES
  685. @echo PP files are $(PPFILES)
  686. endif
  687. ifdef INCFILES
  688. @echo Inc files are $(INCFILES)
  689. endif
  690. ifdef MSGFILES
  691. @echo Msg files are $(MSGFILES)
  692. endif
  693. ifdef ASFILES
  694. @echo As files are $(ASFILES)
  695. endif
  696. endif #NODEFAULTRULES