Makefile 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454
  1. #
  2. # Makefile generated by fpcmake v0.99.13 [2000/02/09]
  3. #
  4. defaultrule: all
  5. #####################################################################
  6. # Autodetect OS (Linux or Dos or Windows NT)
  7. # define inlinux when running under linux
  8. # define inWinNT when running under WinNT
  9. #####################################################################
  10. # We need only / in the path
  11. override PATH:=$(subst \,/,$(PATH))
  12. # Search for PWD and determine also if we are under linux
  13. PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(subst ;, ,$(PATH)))))
  14. ifeq ($(PWD),)
  15. PWD:=$(strip $(wildcard $(addsuffix /pwd,$(subst :, ,$(PATH)))))
  16. ifeq ($(PWD),)
  17. nopwd:
  18. @echo You need the GNU utils package to use this Makefile!
  19. @echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
  20. @exit
  21. else
  22. inlinux=1
  23. endif
  24. else
  25. PWD:=$(firstword $(PWD))
  26. endif
  27. # Detect NT - NT sets OS to Windows_NT
  28. ifndef inlinux
  29. ifeq ($(OS),Windows_NT)
  30. inWinNT=1
  31. endif
  32. endif
  33. # Detect OS/2 - OS/2 has OS2_SHELL defined
  34. ifndef inlinux
  35. ifndef inWinNT
  36. ifdef OS2_SHELL
  37. inOS2=1
  38. endif
  39. endif
  40. endif
  41. # The extension of executables
  42. ifdef inlinux
  43. EXEEXT=
  44. else
  45. EXEEXT=.exe
  46. endif
  47. # The path which is searched separated by spaces
  48. ifdef inlinux
  49. SEARCHPATH=$(subst :, ,$(PATH))
  50. else
  51. SEARCHPATH=$(subst ;, ,$(PATH))
  52. endif
  53. # Base dir
  54. ifdef PWD
  55. BASEDIR:=$(shell $(PWD))
  56. else
  57. BASEDIR=.
  58. endif
  59. #####################################################################
  60. # FPC version/target Detection
  61. #####################################################################
  62. # What compiler to use ?
  63. ifndef FPC
  64. # Compatibility with old makefiles
  65. ifdef PP
  66. FPC=$(PP)
  67. else
  68. ifdef inOS2
  69. FPC=ppos2
  70. else
  71. FPC=ppc386
  72. endif
  73. endif
  74. endif
  75. override FPC:=$(subst $(EXEEXT),,$(FPC))
  76. override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
  77. # Target OS
  78. ifndef OS_TARGET
  79. OS_TARGET:=$(shell $(FPC) -iTO)
  80. endif
  81. # Source OS
  82. ifndef OS_SOURCE
  83. OS_SOURCE:=$(shell $(FPC) -iSO)
  84. endif
  85. # Target CPU
  86. ifndef CPU_TARGET
  87. CPU_TARGET:=$(shell $(FPC) -iTP)
  88. endif
  89. # Source CPU
  90. ifndef CPU_SOURCE
  91. CPU_SOURCE:=$(shell $(FPC) -iSP)
  92. endif
  93. # FPC version
  94. ifndef FPC_VERSION
  95. FPC_VERSION:=$(shell $(FPC) -iV)
  96. endif
  97. export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
  98. #####################################################################
  99. # FPCDIR Setting
  100. #####################################################################
  101. # Test FPCDIR to look if the RTL dir exists
  102. ifdef FPCDIR
  103. override FPCDIR:=$(subst \,/,$(FPCDIR))
  104. ifeq ($(wildcard $(FPCDIR)/rtl),)
  105. ifeq ($(wildcard $(FPCDIR)/units),)
  106. override FPCDIR=wrong
  107. endif
  108. endif
  109. else
  110. override FPCDIR=wrong
  111. endif
  112. # Default FPCDIR
  113. ifeq ($(FPCDIR),wrong)
  114. override FPCDIR=..
  115. ifeq ($(wildcard $(FPCDIR)/rtl),)
  116. ifeq ($(wildcard $(FPCDIR)/units),)
  117. override FPCDIR=wrong
  118. endif
  119. endif
  120. endif
  121. # Detect FPCDIR
  122. ifeq ($(FPCDIR),wrong)
  123. ifdef inlinux
  124. override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
  125. ifeq ($(wildcard $(FPCDIR)/units),)
  126. override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
  127. endif
  128. else
  129. override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
  130. override FPCDIR:=$(FPCDIR)/..
  131. ifeq ($(wildcard $(FPCDIR)/rtl),)
  132. ifeq ($(wildcard $(FPCDIR)/units),)
  133. override FPCDIR:=$(FPCDIR)/..
  134. ifeq ($(wildcard $(FPCDIR)/rtl),)
  135. ifeq ($(wildcard $(FPCDIR)/units),)
  136. override FPCDIR=c:/pp
  137. endif
  138. endif
  139. endif
  140. endif
  141. endif
  142. endif
  143. ifndef PACKAGESDIR
  144. PACKAGESDIR=$(FPCDIR)/packages
  145. endif
  146. ifndef TOOLKITSDIR
  147. TOOLKITSDIR=
  148. endif
  149. ifndef COMPONENTSDIR
  150. COMPONENTSDIR=
  151. endif
  152. # Create units dir
  153. ifneq ($(FPCDIR),.)
  154. UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
  155. endif
  156. #####################################################################
  157. # User Settings
  158. #####################################################################
  159. # Targets
  160. override DIROBJECTS+=$(wildcard tply h2pas fprcp)
  161. override EXEOBJECTS+=ppufiles ppudump ppumove ppdep ptop rstconv data2inc fpcmake delp bin2obj
  162. # Clean
  163. override EXTRACLEANUNITS+=ppu ptopu
  164. # Install
  165. PACKAGENAME=util
  166. ZIPTARGET=install
  167. # Defaults
  168. # Directories
  169. ifndef TARGETDIR
  170. TARGETDIR=.
  171. endif
  172. # Packages
  173. override PACKAGES+=rtl fcl
  174. ifeq ($(OS_TARGET),linux)
  175. override PACKAGES+=zlib
  176. endif
  177. ifeq ($(OS_TARGET),go32v2)
  178. override PACKAGES+=paszlib
  179. endif
  180. ifeq ($(OS_TARGET),win32)
  181. override PACKAGES+=paszlib
  182. endif
  183. ifeq ($(OS_TARGET),os2)
  184. override PACKAGES+=paszlib
  185. endif
  186. # Libraries
  187. # Info
  188. INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
  189. #####################################################################
  190. # Shell tools
  191. #####################################################################
  192. # echo
  193. ifndef ECHO
  194. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
  195. ifeq ($(ECHO),)
  196. ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
  197. ifeq ($(ECHO),)
  198. ECHO:=echo
  199. ECHOE:=echo
  200. else
  201. ECHO:=$(firstword $(ECHO))
  202. ECHOE=$(ECHO) -E
  203. endif
  204. else
  205. ECHO:=$(firstword $(ECHO))
  206. ECHOE=$(ECHO) -E
  207. endif
  208. endif
  209. # To copy pograms
  210. ifndef COPY
  211. COPY:=cp -fp
  212. endif
  213. # Copy a whole tree
  214. ifndef COPYTREE
  215. COPYTREE:=cp -rfp
  216. endif
  217. # To move pograms
  218. ifndef MOVE
  219. MOVE:=mv -f
  220. endif
  221. # Check delete program
  222. ifndef DEL
  223. DEL:=rm -f
  224. endif
  225. # Check deltree program
  226. ifndef DELTREE
  227. DELTREE:=rm -rf
  228. endif
  229. # To install files
  230. ifndef INSTALL
  231. ifdef inlinux
  232. INSTALL:=install -m 644
  233. else
  234. INSTALL:=$(COPY)
  235. endif
  236. endif
  237. # To install programs
  238. ifndef INSTALLEXE
  239. ifdef inlinux
  240. INSTALLEXE:=install -m 755
  241. else
  242. INSTALLEXE:=$(COPY)
  243. endif
  244. endif
  245. # To make a directory.
  246. ifndef MKDIR
  247. ifdef inlinux
  248. MKDIR:=install -m 755 -d
  249. else
  250. MKDIR:=ginstall -m 755 -d
  251. endif
  252. endif
  253. export ECHO ECHOE COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
  254. #####################################################################
  255. # Default Tools
  256. #####################################################################
  257. # assembler, redefine it if cross compiling
  258. ifndef AS
  259. AS=as
  260. endif
  261. # linker, but probably not used
  262. ifndef LD
  263. LD=ld
  264. endif
  265. # ppas.bat / ppas.sh
  266. ifdef inlinux
  267. PPAS=ppas.sh
  268. else
  269. ifdef inOS2
  270. PPAS=ppas.cmd
  271. else
  272. PPAS=ppas.bat
  273. endif
  274. endif
  275. # ldconfig to rebuild .so cache
  276. ifdef inlinux
  277. LDCONFIG=ldconfig
  278. else
  279. LDCONFIG=
  280. endif
  281. # ppumove
  282. ifndef PPUMOVE
  283. PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
  284. ifeq ($(PPUMOVE),)
  285. PPUMOVE=
  286. else
  287. PPUMOVE:=$(firstword $(PPUMOVE))
  288. endif
  289. endif
  290. export PPUMOVE
  291. # ppufiles
  292. ifndef PPUFILES
  293. PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
  294. ifeq ($(PPUFILES),)
  295. PPUFILES=
  296. else
  297. PPUFILES:=$(firstword $(PPUFILES))
  298. endif
  299. endif
  300. export PPUFILES
  301. # data2inc
  302. ifndef DATA2INC
  303. DATA2INC:=$(strip $(wildcard $(addsuffix /data2inc$(EXEEXT),$(SEARCHPATH))))
  304. ifeq ($(DATA2INC),)
  305. DATA2INC=
  306. else
  307. DATA2INC:=$(firstword $(DATA2INC))
  308. endif
  309. endif
  310. export DATA2INC
  311. # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
  312. # upx uses that one itself (PFV)
  313. ifndef UPXPROG
  314. ifeq ($(OS_TARGET),go32v2)
  315. UPXPROG:=1
  316. endif
  317. ifeq ($(OS_TARGET),win32)
  318. UPXPROG:=1
  319. endif
  320. ifdef UPXPROG
  321. UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
  322. ifeq ($(UPXPROG),)
  323. UPXPROG=
  324. else
  325. UPXPROG:=$(firstword $(UPXPROG))
  326. endif
  327. else
  328. UPXPROG=
  329. endif
  330. endif
  331. export UPXPROG
  332. # ZipProg, you can't use Zip as the var name (PFV)
  333. ifndef ZIPPROG
  334. ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
  335. ifeq ($(ZIPPROG),)
  336. ZIPPROG=
  337. else
  338. ZIPPROG:=$(firstword $(ZIPPROG))
  339. endif
  340. endif
  341. export ZIPPROG
  342. ZIPOPT=-9
  343. ZIPEXT=.zip
  344. # Tar
  345. ifndef TARPROG
  346. TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
  347. ifeq ($(TARPROG),)
  348. TARPROG=
  349. else
  350. TARPROG:=$(firstword $(TARPROG))
  351. endif
  352. endif
  353. export TARPROG
  354. ifeq ($(USETAR),bz2)
  355. TAROPT=vI
  356. TAREXT=.tar.bz2
  357. else
  358. TAROPT=vz
  359. TAREXT=.tar.gz
  360. endif
  361. #####################################################################
  362. # Default extensions
  363. #####################################################################
  364. # Default needed extensions (Go32v2,Linux)
  365. LOADEREXT=.as
  366. PPLEXT=.ppl
  367. PPUEXT=.ppu
  368. OEXT=.o
  369. ASMEXT=.s
  370. SMARTEXT=.sl
  371. STATICLIBEXT=.a
  372. SHAREDLIBEXT=.so
  373. RSTEXT=.rst
  374. FPCMADE=fpcmade
  375. # Go32v1
  376. ifeq ($(OS_TARGET),go32v1)
  377. PPUEXT=.pp1
  378. OEXT=.o1
  379. ASMEXT=.s1
  380. SMARTEXT=.sl1
  381. STATICLIBEXT=.a1
  382. SHAREDLIBEXT=.so1
  383. FPCMADE=fpcmade.v1
  384. endif
  385. # Go32v2
  386. ifeq ($(OS_TARGET),go32v2)
  387. FPCMADE=fpcmade.dos
  388. endif
  389. # Linux
  390. ifeq ($(OS_TARGET),linux)
  391. FPCMADE=fpcmade.lnx
  392. endif
  393. # Win32
  394. ifeq ($(OS_TARGET),win32)
  395. PPUEXT=.ppw
  396. OEXT=.ow
  397. ASMEXT=.sw
  398. SMARTEXT=.slw
  399. STATICLIBEXT=.aw
  400. SHAREDLIBEXT=.dll
  401. FPCMADE=fpcmade.w32
  402. endif
  403. # OS/2
  404. ifeq ($(OS_TARGET),os2)
  405. PPUEXT=.ppo
  406. ASMEXT=.so2
  407. OEXT=.oo2
  408. SMARTEXT=.so
  409. STATICLIBEXT=.ao2
  410. SHAREDLIBEXT=.dll
  411. FPCMADE=fpcmade.os2
  412. endif
  413. # library prefix
  414. LIBPREFIX=lib
  415. ifeq ($(OS_TARGET),go32v2)
  416. LIBPREFIX=
  417. endif
  418. ifeq ($(OS_TARGET),go32v1)
  419. LIBPREFIX=
  420. endif
  421. # determine which .pas extension is used
  422. ifndef PASEXT
  423. ifdef EXEOBJECTS
  424. override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(EXEOBJECTS)))))
  425. else
  426. override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(UNITOBJECTS)))))
  427. endif
  428. ifeq ($(TESTPAS),)
  429. PASEXT=.pp
  430. else
  431. PASEXT=.pas
  432. endif
  433. endif
  434. # Check if the dirs really exists, else turn it off
  435. ifeq ($(wildcard $(UNITSDIR)),)
  436. UNITSDIR=
  437. endif
  438. ifeq ($(wildcard $(TOOLKITSDIR)),)
  439. TOOLKITSDIR=
  440. endif
  441. ifeq ($(wildcard $(PACKAGESDIR)),)
  442. PACKAGESDIR=
  443. endif
  444. ifeq ($(wildcard $(COMPONENTSDIR)),)
  445. COMPONENTSDIR=
  446. endif
  447. # PACKAGESDIR packages
  448. PACKAGERTL=1
  449. PACKAGEFCL=1
  450. ifeq ($(OS_TARGET),linux)
  451. PACKAGEZLIB=1
  452. endif
  453. ifeq ($(OS_TARGET),go32v2)
  454. PACKAGEPASZLIB=1
  455. endif
  456. ifeq ($(OS_TARGET),win32)
  457. PACKAGEPASZLIB=1
  458. endif
  459. ifeq ($(OS_TARGET),os2)
  460. PACKAGEPASZLIB=1
  461. endif
  462. ifdef PACKAGERTL
  463. ifneq ($(wildcard $(FPCDIR)/rtl),)
  464. ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
  465. PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
  466. else
  467. PACKAGEDIR_RTL=$(FPCDIR)/rtl
  468. endif
  469. ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
  470. override COMPILEPACKAGES+=package_rtl
  471. package_rtl:
  472. $(MAKE) -C $(PACKAGEDIR_RTL) all
  473. endif
  474. UNITDIR_RTL=$(PACKAGEDIR_RTL)
  475. else
  476. PACKAGEDIR_RTL=
  477. ifneq ($(wildcard $(UNITSDIR)/rtl),)
  478. ifneq ($(wildcard $(UNITSDIR)/rtl/$(OS_TARGET)),)
  479. UNITDIR_RTL=$(UNITSDIR)/rtl/$(OS_TARGET)
  480. else
  481. UNITDIR_RTL=$(UNITSDIR)/rtl
  482. endif
  483. else
  484. UNITDIR_RTL=
  485. endif
  486. endif
  487. ifdef UNITDIR_RTL
  488. override NEEDUNITDIR+=$(UNITDIR_RTL)
  489. endif
  490. endif
  491. ifdef PACKAGEFCL
  492. ifneq ($(wildcard $(FPCDIR)/fcl),)
  493. ifneq ($(wildcard $(FPCDIR)/fcl/$(OS_TARGET)),)
  494. PACKAGEDIR_FCL=$(FPCDIR)/fcl/$(OS_TARGET)
  495. else
  496. PACKAGEDIR_FCL=$(FPCDIR)/fcl
  497. endif
  498. ifeq ($(wildcard $(PACKAGEDIR_FCL)/$(FPCMADE)),)
  499. override COMPILEPACKAGES+=package_fcl
  500. package_fcl:
  501. $(MAKE) -C $(PACKAGEDIR_FCL) all
  502. endif
  503. UNITDIR_FCL=$(PACKAGEDIR_FCL)
  504. else
  505. PACKAGEDIR_FCL=
  506. ifneq ($(wildcard $(UNITSDIR)/fcl),)
  507. ifneq ($(wildcard $(UNITSDIR)/fcl/$(OS_TARGET)),)
  508. UNITDIR_FCL=$(UNITSDIR)/fcl/$(OS_TARGET)
  509. else
  510. UNITDIR_FCL=$(UNITSDIR)/fcl
  511. endif
  512. else
  513. UNITDIR_FCL=
  514. endif
  515. endif
  516. ifdef UNITDIR_FCL
  517. override NEEDUNITDIR+=$(UNITDIR_FCL)
  518. endif
  519. endif
  520. ifdef PACKAGEZLIB
  521. ifneq ($(wildcard $(PACKAGESDIR)/zlib),)
  522. ifneq ($(wildcard $(PACKAGESDIR)/zlib/$(OS_TARGET)),)
  523. PACKAGEDIR_ZLIB=$(PACKAGESDIR)/zlib/$(OS_TARGET)
  524. else
  525. PACKAGEDIR_ZLIB=$(PACKAGESDIR)/zlib
  526. endif
  527. ifeq ($(wildcard $(PACKAGEDIR_ZLIB)/$(FPCMADE)),)
  528. override COMPILEPACKAGES+=package_zlib
  529. package_zlib:
  530. $(MAKE) -C $(PACKAGEDIR_ZLIB) all
  531. endif
  532. UNITDIR_ZLIB=$(PACKAGEDIR_ZLIB)
  533. else
  534. PACKAGEDIR_ZLIB=
  535. ifneq ($(wildcard $(UNITSDIR)/zlib),)
  536. ifneq ($(wildcard $(UNITSDIR)/zlib/$(OS_TARGET)),)
  537. UNITDIR_ZLIB=$(UNITSDIR)/zlib/$(OS_TARGET)
  538. else
  539. UNITDIR_ZLIB=$(UNITSDIR)/zlib
  540. endif
  541. else
  542. UNITDIR_ZLIB=
  543. endif
  544. endif
  545. ifdef UNITDIR_ZLIB
  546. override NEEDUNITDIR+=$(UNITDIR_ZLIB)
  547. endif
  548. endif
  549. ifdef PACKAGEPASZLIB
  550. ifneq ($(wildcard $(PACKAGESDIR)/paszlib),)
  551. ifneq ($(wildcard $(PACKAGESDIR)/paszlib/$(OS_TARGET)),)
  552. PACKAGEDIR_PASZLIB=$(PACKAGESDIR)/paszlib/$(OS_TARGET)
  553. else
  554. PACKAGEDIR_PASZLIB=$(PACKAGESDIR)/paszlib
  555. endif
  556. ifeq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(FPCMADE)),)
  557. override COMPILEPACKAGES+=package_paszlib
  558. package_paszlib:
  559. $(MAKE) -C $(PACKAGEDIR_PASZLIB) all
  560. endif
  561. UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)
  562. else
  563. PACKAGEDIR_PASZLIB=
  564. ifneq ($(wildcard $(UNITSDIR)/paszlib),)
  565. ifneq ($(wildcard $(UNITSDIR)/paszlib/$(OS_TARGET)),)
  566. UNITDIR_PASZLIB=$(UNITSDIR)/paszlib/$(OS_TARGET)
  567. else
  568. UNITDIR_PASZLIB=$(UNITSDIR)/paszlib
  569. endif
  570. else
  571. UNITDIR_PASZLIB=
  572. endif
  573. endif
  574. ifdef UNITDIR_PASZLIB
  575. override NEEDUNITDIR+=$(UNITDIR_PASZLIB)
  576. endif
  577. endif
  578. #####################################################################
  579. # Default Directories
  580. #####################################################################
  581. # set the prefix directory where to install everything
  582. ifndef PREFIXINSTALLDIR
  583. ifdef inlinux
  584. PREFIXINSTALLDIR=/usr
  585. else
  586. PREFIXINSTALLDIR=/pp
  587. endif
  588. endif
  589. export PREFIXINSTALLDIR
  590. # Where to place the resulting zip files
  591. ifndef DESTZIPDIR
  592. DESTZIPDIR:=$(BASEDIR)
  593. endif
  594. export DESTZIPDIR
  595. #####################################################################
  596. # Install Directories
  597. #####################################################################
  598. # set the base directory where to install everything
  599. ifndef BASEINSTALLDIR
  600. ifdef inlinux
  601. BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
  602. else
  603. BASEINSTALLDIR=$(PREFIXINSTALLDIR)
  604. endif
  605. endif
  606. # set the directory where to install the binaries
  607. ifndef BININSTALLDIR
  608. ifdef inlinux
  609. BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
  610. else
  611. BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
  612. endif
  613. endif
  614. # set the directory where to install the units.
  615. ifndef UNITINSTALLDIR
  616. UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
  617. ifdef UNITSUBDIR
  618. UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
  619. endif
  620. endif
  621. # Where to install shared libraries
  622. ifndef LIBINSTALLDIR
  623. ifdef inlinux
  624. LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
  625. else
  626. LIBINSTALLDIR=$(UNITINSTALLDIR)
  627. endif
  628. endif
  629. # Where the source files will be stored
  630. ifndef SOURCEINSTALLDIR
  631. ifdef inlinux
  632. SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
  633. else
  634. SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
  635. endif
  636. ifdef SOURCESUBDIR
  637. SOURCEINSTALLDIR:=$(SOURCEINSTALLDIR)/$(SOURCESUBDIR)
  638. endif
  639. endif
  640. # Where the doc files will be stored
  641. ifndef DOCINSTALLDIR
  642. ifdef inlinux
  643. DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
  644. else
  645. DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
  646. endif
  647. endif
  648. # Where the some extra (data)files will be stored
  649. ifndef DATAINSTALLDIR
  650. DATAINSTALLDIR=$(BASEINSTALLDIR)
  651. endif
  652. #####################################################################
  653. # Redirection
  654. #####################################################################
  655. ifndef REDIRFILE
  656. REDIRFILE=log
  657. endif
  658. ifdef REDIR
  659. ifndef inlinux
  660. override FPC=redir -eo $(FPC)
  661. endif
  662. # set the verbosity to max
  663. override FPCOPT+=-va
  664. override REDIR:= >> $(REDIRFILE)
  665. endif
  666. #####################################################################
  667. # Compiler Command Line
  668. #####################################################################
  669. # Load commandline OPTDEF and add FPC_CPU define
  670. override FPCOPTDEF:=-d$(CPU_TARGET)
  671. # Load commandline OPT and add target and unit dir to be sure
  672. ifneq ($(OS_TARGET),$(OS_SOURCE))
  673. override FPCOPT+=-T$(OS_TARGET)
  674. endif
  675. ifdef NEEDUNITDIR
  676. override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
  677. endif
  678. ifdef UNITSDIR
  679. override FPCOPT+=-Fu$(UNITSDIR)
  680. endif
  681. # Target dirs
  682. ifdef TARGETDIR
  683. override FPCOPT+=-FE$(TARGETDIR)
  684. endif
  685. # Smartlinking
  686. ifdef LINKSMART
  687. override FPCOPT+=-CX
  688. endif
  689. # Smartlinking
  690. ifdef CREATESMART
  691. override FPCOPT+=-XX
  692. endif
  693. # Debug
  694. ifdef DEBUG
  695. override FPCOPT+=-g -dDEBUG
  696. endif
  697. # Release mode (strip, optimize and don't load ppc386.cfg)
  698. # 0.99.12b has a bug in the optimizer so don't use it by default
  699. ifdef RELEASE
  700. ifeq ($(FPC_VERSION),0.99.12)
  701. override FPCOPT+=-Xs -OGp3 -n
  702. else
  703. override FPCOPT+=-Xs -OG2p3 -n
  704. endif
  705. endif
  706. # Strip
  707. ifdef STRIP
  708. override FPCOPT+=-Xs
  709. endif
  710. # Optimizer
  711. ifdef OPTIMIZE
  712. override FPCOPT+=-OG2p3
  713. endif
  714. # Verbose settings (warning,note,info)
  715. ifdef VERBOSE
  716. override FPCOPT+=-vwni
  717. endif
  718. # Add commandline options
  719. ifdef OPT
  720. override FPCOPT+=$(OPT)
  721. endif
  722. ifdef UNITDIR
  723. override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
  724. endif
  725. ifdef LIBDIR
  726. override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
  727. endif
  728. ifdef OBJDIR
  729. override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
  730. endif
  731. ifdef INCDIR
  732. override FPCOPT+=$(addprefix -Fi,$(INCDIR))
  733. endif
  734. # Add defines from FPCOPTDEF to FPCOPT
  735. ifdef FPCOPTDEF
  736. override FPCOPT+=$(FPCOPTDEF)
  737. endif
  738. # Error file ?
  739. ifdef ERRORFILE
  740. override FPCOPT+=-Fr$(ERRORFILE)
  741. endif
  742. # Was a config file specified ?
  743. ifdef CFGFILE
  744. override FPCOPT+=@$(CFGFILE)
  745. endif
  746. # For win32 the options are passed using the environment FPCEXTCMD
  747. ifeq ($(OS_SOURCE),win32)
  748. override FPCEXTCMD:=$(FPCOPT)
  749. override FPCOPT:=!FPCEXTCMD
  750. export FPCEXTCMD
  751. endif
  752. # Compiler commandline
  753. override COMPILER:=$(FPC) $(FPCOPT)
  754. # also call ppas if with command option -s
  755. ifeq (,$(findstring -s ,$(COMPILER)))
  756. EXECPPAS=
  757. else
  758. EXECPPAS:=@$(PPAS)
  759. endif
  760. #####################################################################
  761. # Standard rules
  762. #####################################################################
  763. all: fpc_all $(addsuffix _all,$(DIROBJECTS))
  764. debug: fpc_debug $(addsuffix _debug,$(DIROBJECTS))
  765. examples: $(addsuffix _examples,$(DIROBJECTS))
  766. test: $(addsuffix _test,$(DIROBJECTS))
  767. smart: fpc_smart $(addsuffix _smart,$(DIROBJECTS))
  768. shared: fpc_shared $(addsuffix _shared,$(DIROBJECTS))
  769. showinstall: fpc_showinstall $(addsuffix _showinstall,$(DIROBJECTS))
  770. install: fpc_install $(addsuffix _install,$(DIROBJECTS))
  771. sourceinstall: fpc_sourceinstall
  772. zipinstall: fpc_zipinstall
  773. zipsourceinstall: fpc_zipsourceinstall
  774. clean: fpc_clean $(addsuffix _clean,$(DIROBJECTS))
  775. distclean: fpc_distclean $(addsuffix _distclean,$(DIROBJECTS))
  776. cleanall: fpc_cleanall $(addsuffix _cleanall,$(DIROBJECTS))
  777. require: $(addsuffix _require,$(DIROBJECTS))
  778. info: fpc_info
  779. .PHONY: all debug examples test smart shared showinstall install sourceinstall zipinstall zipsourceinstall clean distclean cleanall require info
  780. #####################################################################
  781. # Exes
  782. #####################################################################
  783. .PHONY: fpc_exes
  784. override EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
  785. override EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
  786. override ALLTARGET+=fpc_exes
  787. override INSTALLEXEFILES+=$(EXEFILES)
  788. override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
  789. fpc_exes: $(EXEFILES)
  790. #####################################################################
  791. # General compile rules
  792. #####################################################################
  793. .PHONY: fpc_packages fpc_all fpc_debug
  794. $(FPCMADE): $(ALLTARGET)
  795. @$(ECHO) Compiled > $(FPCMADE)
  796. fpc_packages: $(COMPILEPACKAGES)
  797. fpc_all: fpc_packages $(FPCMADE)
  798. fpc_debug:
  799. $(MAKE) all DEBUG=1
  800. # General compile rules, available for both possible PASEXT
  801. .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
  802. %$(PPUEXT): %.pp
  803. $(COMPILER) $< $(REDIR)
  804. $(EXECPPAS)
  805. %$(PPUEXT): %.pas
  806. $(COMPILER) $< $(REDIR)
  807. $(EXECPPAS)
  808. %$(EXEEXT): %.pp
  809. $(COMPILER) $< $(REDIR)
  810. $(EXECPPAS)
  811. %$(EXEEXT): %.pas
  812. $(COMPILER) $< $(REDIR)
  813. $(EXECPPAS)
  814. #####################################################################
  815. # Library
  816. #####################################################################
  817. .PHONY: fpc_smart fpc_shared
  818. # Default sharedlib units are all unit objects
  819. ifndef SHAREDLIBUNITOBJECTS
  820. SHAREDLIBUNITOBJECTS:=$(UNITOBJECTS)
  821. endif
  822. fpc_smart:
  823. $(MAKE) all LINKSMART=1 CREATESMART=1
  824. fpc_shared: all
  825. ifdef inlinux
  826. ifndef LIBNAME
  827. @$(ECHO) "LIBNAME not set"
  828. else
  829. $(PPUMOVE) $(SHAREDLIBUNITOBJECTS) -o$(LIBNAME)
  830. endif
  831. else
  832. @$(ECHO) "Shared Libraries not supported"
  833. endif
  834. #####################################################################
  835. # Install rules
  836. #####################################################################
  837. .PHONY: fpc_showinstall fpc_install
  838. ifdef EXTRAINSTALLUNITS
  839. override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
  840. endif
  841. ifdef INSTALLPPUFILES
  842. ifdef PPUFILES
  843. ifdef inlinux
  844. INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
  845. INSTALLPPULIBFILES:=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
  846. else
  847. INSTALLPPULINKFILES:=$(shell $(PPUFILES) $(INSTALLPPUFILES))
  848. endif
  849. else
  850. INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)))
  851. endif
  852. endif
  853. fpc_showinstall: $(SHOWINSTALLTARGET)
  854. ifdef INSTALLEXEFILES
  855. @$(ECHO) -e $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
  856. endif
  857. ifdef INSTALLPPUFILES
  858. @$(ECHO) -e $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
  859. ifneq ($(INSTALLPPULINKFILES),)
  860. @$(ECHO) -e $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
  861. endif
  862. ifneq ($(INSTALLPPULIBFILES),)
  863. @$(ECHO) -e $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
  864. endif
  865. endif
  866. ifdef EXTRAINSTALLFILES
  867. @$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
  868. endif
  869. fpc_install: $(INSTALLTARGET)
  870. # Create UnitInstallFiles
  871. ifdef INSTALLEXEFILES
  872. $(MKDIR) $(BININSTALLDIR)
  873. # Compress the exes if upx is defined
  874. ifdef UPXPROG
  875. -$(UPXPROG) $(INSTALLEXEFILES)
  876. endif
  877. $(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
  878. endif
  879. ifdef INSTALLPPUFILES
  880. $(MKDIR) $(UNITINSTALLDIR)
  881. $(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
  882. ifneq ($(INSTALLPPULINKFILES),)
  883. $(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
  884. endif
  885. ifneq ($(INSTALLPPULIBFILES),)
  886. $(MKDIR) $(LIBINSTALLDIR)
  887. $(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
  888. endif
  889. endif
  890. ifdef EXTRAINSTALLFILES
  891. $(MKDIR) $(DATAINSTALLDIR)
  892. $(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
  893. endif
  894. #####################################################################
  895. # SourceInstall rules
  896. #####################################################################
  897. .PHONY: fpc_sourceinstall
  898. ifndef SOURCETOPDIR
  899. SOURCETOPDIR=$(BASEDIR)
  900. endif
  901. fpc_sourceinstall: clean
  902. $(MKDIR) $(SOURCEINSTALLDIR)
  903. $(COPYTREE) $(SOURCETOPDIR) $(SOURCEINSTALLDIR)
  904. #####################################################################
  905. # Zip
  906. #####################################################################
  907. .PHONY: fpc_zipinstall
  908. # Create suffix to add
  909. ifndef PACKAGESUFFIX
  910. PACKAGESUFFIX=$(OS_TARGET)
  911. ifeq ($(OS_TARGET),go32v2)
  912. PACKAGESUFFIX=go32
  913. endif
  914. ifeq ($(OS_TARGET),win32)
  915. PACKAGESUFFIX=w32
  916. endif
  917. endif
  918. # Temporary path to pack a file
  919. ifndef PACKDIR
  920. ifndef inlinux
  921. PACKDIR=$(BASEDIR)/pack_tmp
  922. else
  923. PACKDIR=/tmp/fpc-pack
  924. endif
  925. endif
  926. # Maybe create default zipname from packagename
  927. ifndef ZIPNAME
  928. ifdef PACKAGENAME
  929. ZIPNAME=$(PACKAGEPREFIX)$(PACKAGENAME)$(PACKAGESUFFIX)
  930. endif
  931. endif
  932. # Use tar by default under linux
  933. ifndef USEZIP
  934. ifdef inlinux
  935. USETAR=1
  936. endif
  937. endif
  938. fpc_zipinstall:
  939. ifndef ZIPNAME
  940. @$(ECHO) "Please specify ZIPNAME!"
  941. @exit 1
  942. else
  943. $(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)
  944. ifdef USETAR
  945. $(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT)
  946. cd $(PACKDIR) ; $(TARPROG) c$(TAROPT) --file $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT) * ; cd $(BASEDIR)
  947. else
  948. $(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT)
  949. cd $(PACKDIR) ; $(ZIPPROG) -Dr $(ZIPOPT) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT) * ; cd $(BASEDIR)
  950. endif
  951. $(DELTREE) $(PACKDIR)
  952. endif
  953. .PHONY: fpc_zipsourceinstall
  954. fpc_zipsourceinstall:
  955. $(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall PACKAGESUFFIX=src
  956. #####################################################################
  957. # Clean rules
  958. #####################################################################
  959. .PHONY: fpc_clean fpc_cleanall fpc_distclean
  960. ifdef EXTRACLEANUNITS
  961. override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
  962. endif
  963. ifdef CLEANPPUFILES
  964. ifdef PPUFILES
  965. CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
  966. else
  967. CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)))
  968. endif
  969. endif
  970. fpc_clean: $(CLEANTARGET)
  971. ifdef CLEANEXEFILES
  972. -$(DEL) $(CLEANEXEFILES)
  973. endif
  974. ifdef CLEANPPUFILES
  975. -$(DEL) $(CLEANPPUFILES)
  976. endif
  977. ifneq ($(CLEANPPULINKFILES),)
  978. -$(DEL) $(CLEANPPULINKFILES)
  979. endif
  980. ifdef CLEANRSTFILES
  981. -$(DEL) $(CLEANRSTFILES)
  982. endif
  983. ifdef EXTRACLEANFILES
  984. -$(DEL) $(EXTRACLEANFILES)
  985. endif
  986. -$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
  987. fpc_distclean: fpc_clean
  988. fpc_cleanall: $(CLEANTARGET)
  989. ifdef CLEANEXEFILES
  990. -$(DEL) $(CLEANEXEFILES)
  991. endif
  992. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  993. -$(DELTREE) *$(SMARTEXT)
  994. -$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
  995. #####################################################################
  996. # Info rules
  997. #####################################################################
  998. .PHONY: fpc_info fpc_cfginfo fpc_objectinfo fpc_toolsinfo fpc_installinfo \
  999. fpc_dirinfo
  1000. fpc_info: $(INFOTARGET)
  1001. fpc_infocfg:
  1002. @$(ECHO)
  1003. @$(ECHO) == Configuration info ==
  1004. @$(ECHO)
  1005. @$(ECHO) FPC....... $(FPC)
  1006. @$(ECHO) Version... $(FPC_VERSION)
  1007. @$(ECHO) CPU....... $(CPU_TARGET)
  1008. @$(ECHO) Source.... $(OS_SOURCE)
  1009. @$(ECHO) Target.... $(OS_TARGET)
  1010. @$(ECHO)
  1011. fpc_infoobjects:
  1012. @$(ECHO)
  1013. @$(ECHO) == Object info ==
  1014. @$(ECHO)
  1015. @$(ECHO) LoaderObjects..... $(LOADEROBJECTS)
  1016. @$(ECHO) UnitObjects....... $(UNITOBJECTS)
  1017. @$(ECHO) ExeObjects........ $(EXEOBJECTS)
  1018. @$(ECHO)
  1019. @$(ECHO) ExtraCleanUnits... $(EXTRACLEANUNITS)
  1020. @$(ECHO) ExtraCleanFiles... $(EXTRACLEANFILES)
  1021. @$(ECHO)
  1022. @$(ECHO) ExtraInstallUnits. $(EXTRAINSTALLUNITS)
  1023. @$(ECHO) ExtraInstallFiles. $(EXTRAINSTALLFILES)
  1024. @$(ECHO)
  1025. fpc_infoinstall:
  1026. @$(ECHO)
  1027. @$(ECHO) == Install info ==
  1028. @$(ECHO)
  1029. ifdef DATE
  1030. @$(ECHO) DateStr.............. $(DATESTR)
  1031. endif
  1032. ifdef PACKAGEPREFIX
  1033. @$(ECHO) PackagePrefix........ $(PACKAGEPREFIX)
  1034. endif
  1035. ifdef PACKAGENAME
  1036. @$(ECHO) PackageName.......... $(PACKAGENAME)
  1037. endif
  1038. @$(ECHO) PackageSuffix........ $(PACKAGESUFFIX)
  1039. @$(ECHO)
  1040. @$(ECHO) BaseInstallDir....... $(BASEINSTALLDIR)
  1041. @$(ECHO) BinInstallDir........ $(BININSTALLDIR)
  1042. @$(ECHO) LibInstallDir........ $(LIBINSTALLDIR)
  1043. @$(ECHO) UnitInstallDir....... $(UNITINSTALLDIR)
  1044. @$(ECHO) SourceInstallDir..... $(SOURCEINSTALLDIR)
  1045. @$(ECHO) DocInstallDir........ $(DOCINSTALLDIR)
  1046. @$(ECHO) DataInstallDir....... $(DATAINSTALLDIR)
  1047. @$(ECHO)
  1048. @$(ECHO) DestZipDir........... $(DESTZIPDIR)
  1049. @$(ECHO) ZipName.............. $(ZIPNAME)
  1050. @$(ECHO)
  1051. #####################################################################
  1052. # Directories
  1053. #####################################################################
  1054. OBJECTDIRTPLY=1
  1055. OBJECTDIRH2PAS=1
  1056. OBJECTDIRFPRCP=1
  1057. # Dir tply
  1058. ifdef OBJECTDIRTPLY
  1059. .PHONY: tply_all tply_debug tply_examples tply_test tply_smart tply_shared tply_showinstall tply_install tply_sourceinstall tply_zipinstall tply_zipsourceinstall tply_clean tply_distclean tply_cleanall tply_require tply_info
  1060. tply_all:
  1061. $(MAKE) -C tply all
  1062. tply_debug:
  1063. $(MAKE) -C tply debug
  1064. tply_examples:
  1065. $(MAKE) -C tply examples
  1066. tply_test:
  1067. $(MAKE) -C tply test
  1068. tply_smart:
  1069. $(MAKE) -C tply smart
  1070. tply_shared:
  1071. $(MAKE) -C tply shared
  1072. tply_showinstall:
  1073. $(MAKE) -C tply showinstall
  1074. tply_install:
  1075. $(MAKE) -C tply install
  1076. tply_sourceinstall:
  1077. $(MAKE) -C tply sourceinstall
  1078. tply_zipinstall:
  1079. $(MAKE) -C tply zipinstall
  1080. tply_zipsourceinstall:
  1081. $(MAKE) -C tply zipsourceinstall
  1082. tply_clean:
  1083. $(MAKE) -C tply clean
  1084. tply_distclean:
  1085. $(MAKE) -C tply distclean
  1086. tply_cleanall:
  1087. $(MAKE) -C tply cleanall
  1088. tply_require:
  1089. $(MAKE) -C tply require
  1090. tply_info:
  1091. $(MAKE) -C tply info
  1092. endif
  1093. # Dir h2pas
  1094. ifdef OBJECTDIRH2PAS
  1095. .PHONY: h2pas_all h2pas_debug h2pas_examples h2pas_test h2pas_smart h2pas_shared h2pas_showinstall h2pas_install h2pas_sourceinstall h2pas_zipinstall h2pas_zipsourceinstall h2pas_clean h2pas_distclean h2pas_cleanall h2pas_require h2pas_info
  1096. h2pas_all:
  1097. $(MAKE) -C h2pas all
  1098. h2pas_debug:
  1099. $(MAKE) -C h2pas debug
  1100. h2pas_examples:
  1101. $(MAKE) -C h2pas examples
  1102. h2pas_test:
  1103. $(MAKE) -C h2pas test
  1104. h2pas_smart:
  1105. $(MAKE) -C h2pas smart
  1106. h2pas_shared:
  1107. $(MAKE) -C h2pas shared
  1108. h2pas_showinstall:
  1109. $(MAKE) -C h2pas showinstall
  1110. h2pas_install:
  1111. $(MAKE) -C h2pas install
  1112. h2pas_sourceinstall:
  1113. $(MAKE) -C h2pas sourceinstall
  1114. h2pas_zipinstall:
  1115. $(MAKE) -C h2pas zipinstall
  1116. h2pas_zipsourceinstall:
  1117. $(MAKE) -C h2pas zipsourceinstall
  1118. h2pas_clean:
  1119. $(MAKE) -C h2pas clean
  1120. h2pas_distclean:
  1121. $(MAKE) -C h2pas distclean
  1122. h2pas_cleanall:
  1123. $(MAKE) -C h2pas cleanall
  1124. h2pas_require:
  1125. $(MAKE) -C h2pas require
  1126. h2pas_info:
  1127. $(MAKE) -C h2pas info
  1128. endif
  1129. # Dir fprcp
  1130. ifdef OBJECTDIRFPRCP
  1131. .PHONY: fprcp_all fprcp_debug fprcp_examples fprcp_test fprcp_smart fprcp_shared fprcp_showinstall fprcp_install fprcp_sourceinstall fprcp_zipinstall fprcp_zipsourceinstall fprcp_clean fprcp_distclean fprcp_cleanall fprcp_require fprcp_info
  1132. fprcp_all:
  1133. $(MAKE) -C fprcp all
  1134. fprcp_debug:
  1135. $(MAKE) -C fprcp debug
  1136. fprcp_examples:
  1137. $(MAKE) -C fprcp examples
  1138. fprcp_test:
  1139. $(MAKE) -C fprcp test
  1140. fprcp_smart:
  1141. $(MAKE) -C fprcp smart
  1142. fprcp_shared:
  1143. $(MAKE) -C fprcp shared
  1144. fprcp_showinstall:
  1145. $(MAKE) -C fprcp showinstall
  1146. fprcp_install:
  1147. $(MAKE) -C fprcp install
  1148. fprcp_sourceinstall:
  1149. $(MAKE) -C fprcp sourceinstall
  1150. fprcp_zipinstall:
  1151. $(MAKE) -C fprcp zipinstall
  1152. fprcp_zipsourceinstall:
  1153. $(MAKE) -C fprcp zipsourceinstall
  1154. fprcp_clean:
  1155. $(MAKE) -C fprcp clean
  1156. fprcp_distclean:
  1157. $(MAKE) -C fprcp distclean
  1158. fprcp_cleanall:
  1159. $(MAKE) -C fprcp cleanall
  1160. fprcp_require:
  1161. $(MAKE) -C fprcp require
  1162. fprcp_info:
  1163. $(MAKE) -C fprcp info
  1164. endif
  1165. #####################################################################
  1166. # Local Makefile
  1167. #####################################################################
  1168. ifneq ($(wildcard fpcmake.loc),)
  1169. include fpcmake.loc
  1170. endif
  1171. #####################################################################
  1172. # Users rules
  1173. #####################################################################
  1174. #
  1175. # PPU Tools
  1176. #
  1177. ppu$(PPUEXT): ppu.pas
  1178. ppudump$(EXEEXT): ppudump.pp ppu$(PPUEXT)
  1179. ppumove$(EXEEXT): ppumove.pp ppu$(PPUEXT)
  1180. #
  1181. # Pascal beautifier
  1182. #
  1183. ptop$(EXEEXT): ptop.pp ptopu$(PPUEXT)
  1184. ptopu$(PPUEXT): ptopu.pp
  1185. #
  1186. # Other
  1187. #
  1188. fpcmake.inc: fpcmake.ini
  1189. $(DATA2INC) -b -s fpcmake.ini fpcmake.inc fpcmakeini
  1190. fpcmake$(EXEEXT): fpcmake.pp fpcmake.inc
  1191. ppdep$(EXEEXT): ppdep.pp
  1192. #
  1193. # Don't export some tools, which are found in the current dir if it's in
  1194. # the path, so are not valid for the subdirs
  1195. #
  1196. unexport PPUFILES PPUMOVE DATA2INC