Makefile 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646
  1. #
  2. # Makefile generated by fpcmake v0.99.15 [2000/04/08]
  3. #
  4. defaultrule: help
  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. # Pre Settings
  100. #####################################################################
  101. OLDFPCDIR:=$(FPCDIR)
  102. checkfpcdir:
  103. ifdef OLDFPCDIR
  104. ifneq ($(OLDFPCDIR),)
  105. @echo ---------------------------------------------------------
  106. @echo
  107. @echo You must unset FPCDIR to use this the packaging rules.
  108. @echo
  109. @echo ---------------------------------------------------------
  110. @cantcontinuewithfpcdir
  111. endif
  112. endif
  113. # Check if install/ subdir is available
  114. ifneq ($(wildcard install),)
  115. CVSINSTALL=install
  116. else
  117. CVSINSTALL=.
  118. endif
  119. # All target
  120. ifdef SNAPSHOT
  121. ALLTARGET=all
  122. else
  123. ifndef ALLTARGET
  124. ifeq ($(OS_TARGET),win32)
  125. ALLTARGET=smart
  126. else
  127. ifeq ($(OS_TARGET),go32v2)
  128. ALLTARGET=smart
  129. else
  130. ALLTARGET=all
  131. endif
  132. endif
  133. endif
  134. endif
  135. # Stop with an error?
  136. ifdef SNAPSHOT
  137. NOSTOP=-
  138. else
  139. NOSTOP=
  140. endif
  141. # Prefix for units
  142. ifeq ($(OS_TARGET),linux)
  143. PKGPRE=units
  144. else
  145. PKGPRE=u
  146. endif
  147. # Test dir if none specified
  148. ifndef PREFIXINSTALLDIR
  149. ifdef inlinux
  150. PREFIXINSTALLDIR=/tmp/pptest
  151. else
  152. PREFIXINSTALLDIR=/pptest
  153. endif
  154. endif
  155. # Always compile for release
  156. override RELEASE=1
  157. export RELEASE
  158. # We want to have the resulting .zips in the current dir
  159. ifndef DESTZIPDIR
  160. export DESTZIPDIR:=$(BASEDIR)
  161. endif
  162. # Temporary path to pack a file
  163. BASEPACKDIR=$(BASEDIR)/basepack
  164. # Use new ppc386
  165. PPNEW=$(BASEDIR)/compiler/ppc386$(EXEEXT)
  166. # Don't use ppufiles for win32 becuase of commandline length problems
  167. ifneq ($(OS_TARGET),win32)
  168. PPUFILESNEW=$(BASEDIR)/utils/ppufiles$(EXEEXT)
  169. endif
  170. # Build/install options
  171. BUILDOPTS=FPC=$(PPNEW) RELEASE=1
  172. INSTALLOPTS=FPC=$(PPNEW) ZIPDESTDIR=$(BASEDIR)
  173. ifdef PPUFILESNEW
  174. override INSTALLOPT+=PPUFILES=$(PPUFILESNEW)
  175. endif
  176. # Compile also IDE (check for ide and fv dir)
  177. ifneq ($(wildcard ide),)
  178. ifneq ($(wildcard fv),)
  179. ifeq ($(OS_TARGET),go32v2)
  180. IDE=1
  181. endif
  182. ifeq ($(OS_TARGET),win32)
  183. IDE=1
  184. endif
  185. ifeq ($(OS_TARGET),linux)
  186. IDE=1
  187. endif
  188. endif
  189. endif
  190. #####################################################################
  191. # FPCDIR Setting
  192. #####################################################################
  193. # Test FPCDIR to look if the RTL dir exists
  194. ifdef FPCDIR
  195. override FPCDIR:=$(subst \,/,$(FPCDIR))
  196. ifeq ($(wildcard $(FPCDIR)/rtl),)
  197. ifeq ($(wildcard $(FPCDIR)/units),)
  198. override FPCDIR=wrong
  199. endif
  200. endif
  201. else
  202. override FPCDIR=wrong
  203. endif
  204. # Detect FPCDIR
  205. ifeq ($(FPCDIR),wrong)
  206. ifdef inlinux
  207. override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
  208. ifeq ($(wildcard $(FPCDIR)/units),)
  209. override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
  210. endif
  211. else
  212. override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
  213. override FPCDIR:=$(FPCDIR)/..
  214. ifeq ($(wildcard $(FPCDIR)/rtl),)
  215. ifeq ($(wildcard $(FPCDIR)/units),)
  216. override FPCDIR:=$(FPCDIR)/..
  217. ifeq ($(wildcard $(FPCDIR)/rtl),)
  218. ifeq ($(wildcard $(FPCDIR)/units),)
  219. override FPCDIR=c:/pp
  220. endif
  221. endif
  222. endif
  223. endif
  224. endif
  225. endif
  226. #####################################################################
  227. # User Settings
  228. #####################################################################
  229. # Targets
  230. override DIROBJECTS+=$(wildcard compiler rtl utils fcl api fv packages ide)
  231. # Clean
  232. # Install
  233. ZIPTARGET=install
  234. # Defaults
  235. # Directories
  236. # Packages
  237. # Libraries
  238. #####################################################################
  239. # Shell tools
  240. #####################################################################
  241. # echo
  242. ifndef ECHO
  243. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
  244. ifeq ($(ECHO),)
  245. ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
  246. ifeq ($(ECHO),)
  247. ECHO:=echo
  248. ECHOE:=echo
  249. else
  250. ECHO:=$(firstword $(ECHO))
  251. ECHOE=$(ECHO) -E
  252. endif
  253. else
  254. ECHO:=$(firstword $(ECHO))
  255. ECHOE=$(ECHO) -E
  256. endif
  257. endif
  258. # To copy pograms
  259. ifndef COPY
  260. COPY:=cp -fp
  261. endif
  262. # Copy a whole tree
  263. ifndef COPYTREE
  264. COPYTREE:=cp -rfp
  265. endif
  266. # To move pograms
  267. ifndef MOVE
  268. MOVE:=mv -f
  269. endif
  270. # Check delete program
  271. ifndef DEL
  272. DEL:=rm -f
  273. endif
  274. # Check deltree program
  275. ifndef DELTREE
  276. DELTREE:=rm -rf
  277. endif
  278. # To install files
  279. ifndef INSTALL
  280. ifdef inlinux
  281. INSTALL:=install -m 644
  282. else
  283. INSTALL:=$(COPY)
  284. endif
  285. endif
  286. # To install programs
  287. ifndef INSTALLEXE
  288. ifdef inlinux
  289. INSTALLEXE:=install -m 755
  290. else
  291. INSTALLEXE:=$(COPY)
  292. endif
  293. endif
  294. # To make a directory.
  295. ifndef MKDIR
  296. ifdef inlinux
  297. MKDIR:=install -m 755 -d
  298. else
  299. MKDIR:=ginstall -m 755 -d
  300. endif
  301. endif
  302. export ECHO ECHOE COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
  303. #####################################################################
  304. # Default Tools
  305. #####################################################################
  306. # assembler, redefine it if cross compiling
  307. ifndef AS
  308. AS=as
  309. endif
  310. # linker, but probably not used
  311. ifndef LD
  312. LD=ld
  313. endif
  314. # ppas.bat / ppas.sh
  315. ifdef inlinux
  316. PPAS=ppas.sh
  317. else
  318. ifdef inOS2
  319. PPAS=ppas.cmd
  320. else
  321. PPAS=ppas.bat
  322. endif
  323. endif
  324. # ldconfig to rebuild .so cache
  325. ifdef inlinux
  326. LDCONFIG=ldconfig
  327. else
  328. LDCONFIG=
  329. endif
  330. # ppufiles
  331. ifndef PPUFILES
  332. PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
  333. ifeq ($(PPUFILES),)
  334. PPUFILES=
  335. else
  336. PPUFILES:=$(firstword $(PPUFILES))
  337. endif
  338. endif
  339. export PPUFILES
  340. # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
  341. # upx uses that one itself (PFV)
  342. ifndef UPXPROG
  343. ifeq ($(OS_TARGET),go32v2)
  344. UPXPROG:=1
  345. endif
  346. ifeq ($(OS_TARGET),win32)
  347. UPXPROG:=1
  348. endif
  349. ifdef UPXPROG
  350. UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
  351. ifeq ($(UPXPROG),)
  352. UPXPROG=
  353. else
  354. UPXPROG:=$(firstword $(UPXPROG))
  355. endif
  356. else
  357. UPXPROG=
  358. endif
  359. endif
  360. export UPXPROG
  361. # gdate/date
  362. ifndef DATE
  363. DATE:=$(strip $(wildcard $(addsuffix /date$(EXEEXT),$(SEARCHPATH))))
  364. ifeq ($(DATE),)
  365. DATE:=$(strip $(wildcard $(addsuffix /gdate$(EXEEXT),$(SEACHPATH))))
  366. ifeq ($(DATE),)
  367. DATE=
  368. else
  369. DATE:=$(firstword $(DATE))
  370. endif
  371. else
  372. DATE:=$(firstword $(DATE))
  373. endif
  374. endif
  375. export DATE
  376. ifdef DATE
  377. DATESTR:=$(shell $(DATE) +%Y%m%d)
  378. else
  379. DATESTR=
  380. endif
  381. # ZipProg, you can't use Zip as the var name (PFV)
  382. ifndef ZIPPROG
  383. ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
  384. ifeq ($(ZIPPROG),)
  385. ZIPPROG=
  386. else
  387. ZIPPROG:=$(firstword $(ZIPPROG))
  388. endif
  389. endif
  390. export ZIPPROG
  391. ZIPOPT=-9
  392. ZIPEXT=.zip
  393. # Tar
  394. ifndef TARPROG
  395. TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
  396. ifeq ($(TARPROG),)
  397. TARPROG=
  398. else
  399. TARPROG:=$(firstword $(TARPROG))
  400. endif
  401. endif
  402. export TARPROG
  403. ifeq ($(USETAR),bz2)
  404. TAROPT=vI
  405. TAREXT=.tar.bz2
  406. else
  407. TAROPT=vz
  408. TAREXT=.tar.gz
  409. endif
  410. #####################################################################
  411. # Default extensions
  412. #####################################################################
  413. # Default needed extensions (Go32v2,Linux)
  414. LOADEREXT=.as
  415. PPLEXT=.ppl
  416. PPUEXT=.ppu
  417. OEXT=.o
  418. ASMEXT=.s
  419. SMARTEXT=.sl
  420. STATICLIBEXT=.a
  421. SHAREDLIBEXT=.so
  422. RSTEXT=.rst
  423. FPCMADE=fpcmade
  424. # Go32v1
  425. ifeq ($(OS_TARGET),go32v1)
  426. PPUEXT=.pp1
  427. OEXT=.o1
  428. ASMEXT=.s1
  429. SMARTEXT=.sl1
  430. STATICLIBEXT=.a1
  431. SHAREDLIBEXT=.so1
  432. FPCMADE=fpcmade.v1
  433. endif
  434. # Go32v2
  435. ifeq ($(OS_TARGET),go32v2)
  436. FPCMADE=fpcmade.dos
  437. endif
  438. # Linux
  439. ifeq ($(OS_TARGET),linux)
  440. FPCMADE=fpcmade.lnx
  441. endif
  442. # Win32
  443. ifeq ($(OS_TARGET),win32)
  444. PPUEXT=.ppw
  445. OEXT=.ow
  446. ASMEXT=.sw
  447. SMARTEXT=.slw
  448. STATICLIBEXT=.aw
  449. SHAREDLIBEXT=.dll
  450. FPCMADE=fpcmade.w32
  451. endif
  452. # OS/2
  453. ifeq ($(OS_TARGET),os2)
  454. PPUEXT=.ppo
  455. ASMEXT=.so2
  456. OEXT=.oo2
  457. SMARTEXT=.so
  458. STATICLIBEXT=.ao2
  459. SHAREDLIBEXT=.dll
  460. FPCMADE=fpcmade.os2
  461. endif
  462. # library prefix
  463. LIBPREFIX=lib
  464. ifeq ($(OS_TARGET),go32v2)
  465. LIBPREFIX=
  466. endif
  467. ifeq ($(OS_TARGET),go32v1)
  468. LIBPREFIX=
  469. endif
  470. # determine which .pas extension is used
  471. ifndef PASEXT
  472. ifdef EXEOBJECTS
  473. override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(EXEOBJECTS)))))
  474. else
  475. override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(UNITOBJECTS)))))
  476. endif
  477. ifeq ($(TESTPAS),)
  478. PASEXT=.pp
  479. else
  480. PASEXT=.pas
  481. endif
  482. endif
  483. #####################################################################
  484. # Default Directories
  485. #####################################################################
  486. # set the prefix directory where to install everything
  487. ifndef PREFIXINSTALLDIR
  488. ifdef inlinux
  489. PREFIXINSTALLDIR=/usr
  490. else
  491. PREFIXINSTALLDIR=/pp
  492. endif
  493. endif
  494. export PREFIXINSTALLDIR
  495. # Where to place the resulting zip files
  496. ifndef DESTZIPDIR
  497. DESTZIPDIR:=$(BASEDIR)
  498. endif
  499. export DESTZIPDIR
  500. #####################################################################
  501. # Install Directories
  502. #####################################################################
  503. # set the base directory where to install everything
  504. ifndef BASEINSTALLDIR
  505. ifdef inlinux
  506. BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
  507. else
  508. BASEINSTALLDIR=$(PREFIXINSTALLDIR)
  509. endif
  510. endif
  511. # set the directory where to install the binaries
  512. ifndef BININSTALLDIR
  513. ifdef inlinux
  514. BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
  515. else
  516. BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
  517. endif
  518. endif
  519. # set the directory where to install the units.
  520. ifndef UNITINSTALLDIR
  521. UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
  522. ifdef UNITSUBDIR
  523. UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
  524. endif
  525. endif
  526. # Where to install shared libraries
  527. ifndef LIBINSTALLDIR
  528. ifdef inlinux
  529. LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
  530. else
  531. LIBINSTALLDIR=$(UNITINSTALLDIR)
  532. endif
  533. endif
  534. # Where the source files will be stored
  535. ifndef SOURCEINSTALLDIR
  536. ifdef inlinux
  537. SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
  538. else
  539. SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
  540. endif
  541. ifdef SOURCESUBDIR
  542. SOURCEINSTALLDIR:=$(SOURCEINSTALLDIR)/$(SOURCESUBDIR)
  543. endif
  544. endif
  545. # Where the example files will be stored
  546. ifndef EXAMPLEINSTALLDIR
  547. EXAMPLEINSTALLDIR=$(SOURCEINSTALLDIR)
  548. endif
  549. # Where the doc files will be stored
  550. ifndef DOCINSTALLDIR
  551. ifdef inlinux
  552. DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
  553. else
  554. DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
  555. endif
  556. endif
  557. # Where the some extra (data)files will be stored
  558. ifndef DATAINSTALLDIR
  559. DATAINSTALLDIR=$(BASEINSTALLDIR)
  560. endif
  561. #####################################################################
  562. # Redirection
  563. #####################################################################
  564. ifndef REDIRFILE
  565. REDIRFILE=log
  566. endif
  567. ifdef REDIR
  568. ifndef inlinux
  569. override FPC=redir -eo $(FPC)
  570. endif
  571. # set the verbosity to max
  572. override FPCOPT+=-va
  573. override REDIR:= >> $(REDIRFILE)
  574. endif
  575. #####################################################################
  576. # Standard rules
  577. #####################################################################
  578. debug: $(addsuffix _debug,$(DIROBJECTS))
  579. examples: $(addsuffix _examples,$(DIROBJECTS))
  580. test: $(addsuffix _test,$(DIROBJECTS))
  581. smart: $(addsuffix _smart,$(DIROBJECTS))
  582. shared: $(addsuffix _shared,$(DIROBJECTS))
  583. showinstall: $(addsuffix _showinstall,$(DIROBJECTS))
  584. sourceinstall: $(addsuffix _sourceinstall,$(DIROBJECTS))
  585. exampleinstall: $(addsuffix _exampleinstall,$(DIROBJECTS))
  586. zipsourceinstall: fpc_zipsourceinstall
  587. cleanall: fpc_cleanall $(addsuffix _cleanall,$(DIROBJECTS))
  588. require: $(addsuffix _require,$(DIROBJECTS))
  589. .PHONY: debug examples test smart shared showinstall sourceinstall exampleinstall zipsourceinstall cleanall require
  590. #####################################################################
  591. # Zip
  592. #####################################################################
  593. .PHONY: fpc_zipinstall
  594. # Create suffix to add
  595. ifndef PACKAGESUFFIX
  596. PACKAGESUFFIX=$(OS_TARGET)
  597. ifeq ($(OS_TARGET),go32v2)
  598. PACKAGESUFFIX=go32
  599. endif
  600. ifeq ($(OS_TARGET),win32)
  601. PACKAGESUFFIX=w32
  602. endif
  603. endif
  604. # Temporary path to pack a file
  605. ifndef PACKDIR
  606. ifndef inlinux
  607. PACKDIR=$(BASEDIR)/pack_tmp
  608. else
  609. PACKDIR=/tmp/fpc-pack
  610. endif
  611. endif
  612. # Maybe create default zipname from packagename
  613. ifndef ZIPNAME
  614. ifdef PACKAGENAME
  615. ZIPNAME=$(PACKAGEPREFIX)$(PACKAGENAME)$(PACKAGESUFFIX)
  616. endif
  617. endif
  618. # Use tar by default under linux
  619. ifndef USEZIP
  620. ifdef inlinux
  621. USETAR=1
  622. endif
  623. endif
  624. fpc_zipinstall:
  625. ifndef ZIPNAME
  626. @$(ECHO) "Please specify ZIPNAME!"
  627. @exit 1
  628. else
  629. $(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)
  630. ifdef USETAR
  631. $(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT)
  632. cd $(PACKDIR) ; $(TARPROG) c$(TAROPT) --file $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT) * ; cd $(BASEDIR)
  633. else
  634. $(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT)
  635. cd $(PACKDIR) ; $(ZIPPROG) -Dr $(ZIPOPT) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT) * ; cd $(BASEDIR)
  636. endif
  637. $(DELTREE) $(PACKDIR)
  638. endif
  639. #####################################################################
  640. # Clean rules
  641. #####################################################################
  642. .PHONY: fpc_clean fpc_cleanall fpc_distclean
  643. ifdef EXTRACLEANUNITS
  644. override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
  645. endif
  646. ifdef CLEANPPUFILES
  647. ifdef PPUFILES
  648. CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
  649. else
  650. CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)))
  651. endif
  652. endif
  653. fpc_clean: $(CLEANTARGET)
  654. ifdef CLEANEXEFILES
  655. -$(DEL) $(CLEANEXEFILES)
  656. endif
  657. ifdef CLEANPPUFILES
  658. -$(DEL) $(CLEANPPUFILES)
  659. endif
  660. ifneq ($(CLEANPPULINKFILES),)
  661. -$(DEL) $(CLEANPPULINKFILES)
  662. endif
  663. ifdef CLEANRSTFILES
  664. -$(DEL) $(CLEANRSTFILES)
  665. endif
  666. ifdef EXTRACLEANFILES
  667. -$(DEL) $(EXTRACLEANFILES)
  668. endif
  669. -$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
  670. fpc_distclean: fpc_clean
  671. fpc_cleanall: $(CLEANTARGET)
  672. ifdef CLEANEXEFILES
  673. -$(DEL) $(CLEANEXEFILES)
  674. endif
  675. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  676. -$(DELTREE) *$(SMARTEXT)
  677. -$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
  678. #####################################################################
  679. # Directories
  680. #####################################################################
  681. OBJECTDIRCOMPILER=1
  682. OBJECTDIRRTL=1
  683. OBJECTDIRUTILS=1
  684. OBJECTDIRFCL=1
  685. OBJECTDIRAPI=1
  686. OBJECTDIRFV=1
  687. OBJECTDIRPACKAGES=1
  688. OBJECTDIRIDE=1
  689. # Dir compiler
  690. ifdef OBJECTDIRCOMPILER
  691. .PHONY: compiler_all compiler_debug compiler_examples compiler_test compiler_smart compiler_shared compiler_showinstall compiler_install compiler_sourceinstall compiler_exampleinstall compiler_zipinstall compiler_zipsourceinstall compiler_clean compiler_distclean compiler_cleanall compiler_require compiler_info
  692. compiler_all:
  693. $(MAKE) -C compiler all
  694. compiler_debug:
  695. $(MAKE) -C compiler debug
  696. compiler_examples:
  697. $(MAKE) -C compiler examples
  698. compiler_test:
  699. $(MAKE) -C compiler test
  700. compiler_smart:
  701. $(MAKE) -C compiler smart
  702. compiler_shared:
  703. $(MAKE) -C compiler shared
  704. compiler_showinstall:
  705. $(MAKE) -C compiler showinstall
  706. compiler_install:
  707. $(MAKE) -C compiler install
  708. compiler_sourceinstall:
  709. $(MAKE) -C compiler sourceinstall
  710. compiler_exampleinstall:
  711. $(MAKE) -C compiler exampleinstall
  712. compiler_zipinstall:
  713. $(MAKE) -C compiler zipinstall
  714. compiler_zipsourceinstall:
  715. $(MAKE) -C compiler zipsourceinstall
  716. compiler_clean:
  717. $(MAKE) -C compiler clean
  718. compiler_distclean:
  719. $(MAKE) -C compiler distclean
  720. compiler_cleanall:
  721. $(MAKE) -C compiler cleanall
  722. compiler_require:
  723. $(MAKE) -C compiler require
  724. compiler_info:
  725. $(MAKE) -C compiler info
  726. endif
  727. # Dir rtl
  728. ifdef OBJECTDIRRTL
  729. .PHONY: rtl_all rtl_debug rtl_examples rtl_test rtl_smart rtl_shared rtl_showinstall rtl_install rtl_sourceinstall rtl_exampleinstall rtl_zipinstall rtl_zipsourceinstall rtl_clean rtl_distclean rtl_cleanall rtl_require rtl_info
  730. rtl_all:
  731. $(MAKE) -C rtl all
  732. rtl_debug:
  733. $(MAKE) -C rtl debug
  734. rtl_examples:
  735. $(MAKE) -C rtl examples
  736. rtl_test:
  737. $(MAKE) -C rtl test
  738. rtl_smart:
  739. $(MAKE) -C rtl smart
  740. rtl_shared:
  741. $(MAKE) -C rtl shared
  742. rtl_showinstall:
  743. $(MAKE) -C rtl showinstall
  744. rtl_install:
  745. $(MAKE) -C rtl install
  746. rtl_sourceinstall:
  747. $(MAKE) -C rtl sourceinstall
  748. rtl_exampleinstall:
  749. $(MAKE) -C rtl exampleinstall
  750. rtl_zipinstall:
  751. $(MAKE) -C rtl zipinstall
  752. rtl_zipsourceinstall:
  753. $(MAKE) -C rtl zipsourceinstall
  754. rtl_clean:
  755. $(MAKE) -C rtl clean
  756. rtl_distclean:
  757. $(MAKE) -C rtl distclean
  758. rtl_cleanall:
  759. $(MAKE) -C rtl cleanall
  760. rtl_require:
  761. $(MAKE) -C rtl require
  762. rtl_info:
  763. $(MAKE) -C rtl info
  764. endif
  765. # Dir utils
  766. ifdef OBJECTDIRUTILS
  767. .PHONY: utils_all utils_debug utils_examples utils_test utils_smart utils_shared utils_showinstall utils_install utils_sourceinstall utils_exampleinstall utils_zipinstall utils_zipsourceinstall utils_clean utils_distclean utils_cleanall utils_require utils_info
  768. utils_all:
  769. $(MAKE) -C utils all
  770. utils_debug:
  771. $(MAKE) -C utils debug
  772. utils_examples:
  773. $(MAKE) -C utils examples
  774. utils_test:
  775. $(MAKE) -C utils test
  776. utils_smart:
  777. $(MAKE) -C utils smart
  778. utils_shared:
  779. $(MAKE) -C utils shared
  780. utils_showinstall:
  781. $(MAKE) -C utils showinstall
  782. utils_install:
  783. $(MAKE) -C utils install
  784. utils_sourceinstall:
  785. $(MAKE) -C utils sourceinstall
  786. utils_exampleinstall:
  787. $(MAKE) -C utils exampleinstall
  788. utils_zipinstall:
  789. $(MAKE) -C utils zipinstall
  790. utils_zipsourceinstall:
  791. $(MAKE) -C utils zipsourceinstall
  792. utils_clean:
  793. $(MAKE) -C utils clean
  794. utils_distclean:
  795. $(MAKE) -C utils distclean
  796. utils_cleanall:
  797. $(MAKE) -C utils cleanall
  798. utils_require:
  799. $(MAKE) -C utils require
  800. utils_info:
  801. $(MAKE) -C utils info
  802. endif
  803. # Dir fcl
  804. ifdef OBJECTDIRFCL
  805. .PHONY: fcl_all fcl_debug fcl_examples fcl_test fcl_smart fcl_shared fcl_showinstall fcl_install fcl_sourceinstall fcl_exampleinstall fcl_zipinstall fcl_zipsourceinstall fcl_clean fcl_distclean fcl_cleanall fcl_require fcl_info
  806. fcl_all:
  807. $(MAKE) -C fcl all
  808. fcl_debug:
  809. $(MAKE) -C fcl debug
  810. fcl_examples:
  811. $(MAKE) -C fcl examples
  812. fcl_test:
  813. $(MAKE) -C fcl test
  814. fcl_smart:
  815. $(MAKE) -C fcl smart
  816. fcl_shared:
  817. $(MAKE) -C fcl shared
  818. fcl_showinstall:
  819. $(MAKE) -C fcl showinstall
  820. fcl_install:
  821. $(MAKE) -C fcl install
  822. fcl_sourceinstall:
  823. $(MAKE) -C fcl sourceinstall
  824. fcl_exampleinstall:
  825. $(MAKE) -C fcl exampleinstall
  826. fcl_zipinstall:
  827. $(MAKE) -C fcl zipinstall
  828. fcl_zipsourceinstall:
  829. $(MAKE) -C fcl zipsourceinstall
  830. fcl_clean:
  831. $(MAKE) -C fcl clean
  832. fcl_distclean:
  833. $(MAKE) -C fcl distclean
  834. fcl_cleanall:
  835. $(MAKE) -C fcl cleanall
  836. fcl_require:
  837. $(MAKE) -C fcl require
  838. fcl_info:
  839. $(MAKE) -C fcl info
  840. endif
  841. # Dir api
  842. ifdef OBJECTDIRAPI
  843. .PHONY: api_all api_debug api_examples api_test api_smart api_shared api_showinstall api_install api_sourceinstall api_exampleinstall api_zipinstall api_zipsourceinstall api_clean api_distclean api_cleanall api_require api_info
  844. api_all:
  845. $(MAKE) -C api all
  846. api_debug:
  847. $(MAKE) -C api debug
  848. api_examples:
  849. $(MAKE) -C api examples
  850. api_test:
  851. $(MAKE) -C api test
  852. api_smart:
  853. $(MAKE) -C api smart
  854. api_shared:
  855. $(MAKE) -C api shared
  856. api_showinstall:
  857. $(MAKE) -C api showinstall
  858. api_install:
  859. $(MAKE) -C api install
  860. api_sourceinstall:
  861. $(MAKE) -C api sourceinstall
  862. api_exampleinstall:
  863. $(MAKE) -C api exampleinstall
  864. api_zipinstall:
  865. $(MAKE) -C api zipinstall
  866. api_zipsourceinstall:
  867. $(MAKE) -C api zipsourceinstall
  868. api_clean:
  869. $(MAKE) -C api clean
  870. api_distclean:
  871. $(MAKE) -C api distclean
  872. api_cleanall:
  873. $(MAKE) -C api cleanall
  874. api_require:
  875. $(MAKE) -C api require
  876. api_info:
  877. $(MAKE) -C api info
  878. endif
  879. # Dir fv
  880. ifdef OBJECTDIRFV
  881. .PHONY: fv_all fv_debug fv_examples fv_test fv_smart fv_shared fv_showinstall fv_install fv_sourceinstall fv_exampleinstall fv_zipinstall fv_zipsourceinstall fv_clean fv_distclean fv_cleanall fv_require fv_info
  882. fv_all:
  883. $(MAKE) -C fv all
  884. fv_debug:
  885. $(MAKE) -C fv debug
  886. fv_examples:
  887. $(MAKE) -C fv examples
  888. fv_test:
  889. $(MAKE) -C fv test
  890. fv_smart:
  891. $(MAKE) -C fv smart
  892. fv_shared:
  893. $(MAKE) -C fv shared
  894. fv_showinstall:
  895. $(MAKE) -C fv showinstall
  896. fv_install:
  897. $(MAKE) -C fv install
  898. fv_sourceinstall:
  899. $(MAKE) -C fv sourceinstall
  900. fv_exampleinstall:
  901. $(MAKE) -C fv exampleinstall
  902. fv_zipinstall:
  903. $(MAKE) -C fv zipinstall
  904. fv_zipsourceinstall:
  905. $(MAKE) -C fv zipsourceinstall
  906. fv_clean:
  907. $(MAKE) -C fv clean
  908. fv_distclean:
  909. $(MAKE) -C fv distclean
  910. fv_cleanall:
  911. $(MAKE) -C fv cleanall
  912. fv_require:
  913. $(MAKE) -C fv require
  914. fv_info:
  915. $(MAKE) -C fv info
  916. endif
  917. # Dir packages
  918. ifdef OBJECTDIRPACKAGES
  919. .PHONY: packages_all packages_debug packages_examples packages_test packages_smart packages_shared packages_showinstall packages_install packages_sourceinstall packages_exampleinstall packages_zipinstall packages_zipsourceinstall packages_clean packages_distclean packages_cleanall packages_require packages_info
  920. packages_all:
  921. $(MAKE) -C packages all
  922. packages_debug:
  923. $(MAKE) -C packages debug
  924. packages_examples:
  925. $(MAKE) -C packages examples
  926. packages_test:
  927. $(MAKE) -C packages test
  928. packages_smart:
  929. $(MAKE) -C packages smart
  930. packages_shared:
  931. $(MAKE) -C packages shared
  932. packages_showinstall:
  933. $(MAKE) -C packages showinstall
  934. packages_install:
  935. $(MAKE) -C packages install
  936. packages_sourceinstall:
  937. $(MAKE) -C packages sourceinstall
  938. packages_exampleinstall:
  939. $(MAKE) -C packages exampleinstall
  940. packages_zipinstall:
  941. $(MAKE) -C packages zipinstall
  942. packages_zipsourceinstall:
  943. $(MAKE) -C packages zipsourceinstall
  944. packages_clean:
  945. $(MAKE) -C packages clean
  946. packages_distclean:
  947. $(MAKE) -C packages distclean
  948. packages_cleanall:
  949. $(MAKE) -C packages cleanall
  950. packages_require:
  951. $(MAKE) -C packages require
  952. packages_info:
  953. $(MAKE) -C packages info
  954. endif
  955. # Dir ide
  956. ifdef OBJECTDIRIDE
  957. .PHONY: ide_all ide_debug ide_examples ide_test ide_smart ide_shared ide_showinstall ide_install ide_sourceinstall ide_exampleinstall ide_zipinstall ide_zipsourceinstall ide_clean ide_distclean ide_cleanall ide_require ide_info
  958. ide_all:
  959. $(MAKE) -C ide all
  960. ide_debug:
  961. $(MAKE) -C ide debug
  962. ide_examples:
  963. $(MAKE) -C ide examples
  964. ide_test:
  965. $(MAKE) -C ide test
  966. ide_smart:
  967. $(MAKE) -C ide smart
  968. ide_shared:
  969. $(MAKE) -C ide shared
  970. ide_showinstall:
  971. $(MAKE) -C ide showinstall
  972. ide_install:
  973. $(MAKE) -C ide install
  974. ide_sourceinstall:
  975. $(MAKE) -C ide sourceinstall
  976. ide_exampleinstall:
  977. $(MAKE) -C ide exampleinstall
  978. ide_zipinstall:
  979. $(MAKE) -C ide zipinstall
  980. ide_zipsourceinstall:
  981. $(MAKE) -C ide zipsourceinstall
  982. ide_clean:
  983. $(MAKE) -C ide clean
  984. ide_distclean:
  985. $(MAKE) -C ide distclean
  986. ide_cleanall:
  987. $(MAKE) -C ide cleanall
  988. ide_require:
  989. $(MAKE) -C ide require
  990. ide_info:
  991. $(MAKE) -C ide info
  992. endif
  993. #####################################################################
  994. # Local Makefile
  995. #####################################################################
  996. ifneq ($(wildcard fpcmake.loc),)
  997. include fpcmake.loc
  998. endif
  999. #####################################################################
  1000. # Users rules
  1001. #####################################################################
  1002. # These values can change
  1003. unexport FPC_VERSION OS_SOURCE
  1004. #####################################################################
  1005. # Main targets
  1006. #####################################################################
  1007. .PHONY: help checkfpcdir
  1008. help:
  1009. @echo
  1010. @echo Directory targets:
  1011. @echo
  1012. @echo $(DIROBJECTS)
  1013. @echo
  1014. @echo Packing targets are:
  1015. @echo
  1016. @echo go32v2zip,win32zip,linuxzip,sourcezip
  1017. @echo
  1018. @exit
  1019. #####################################################################
  1020. # Dependencies
  1021. #####################################################################
  1022. #######################################
  1023. # Compiler
  1024. #######################################
  1025. .PHONY: compiler_cycle
  1026. compiler_cycle:
  1027. $(MAKE) -C compiler cycle
  1028. #######################################
  1029. # IDE
  1030. #######################################
  1031. .PHONY: ide_comp ide_full
  1032. ide_comp:
  1033. $(MAKE) -C compiler ppuclean
  1034. $(MAKE) -C ide full
  1035. # Look if libgdb.a is available then use fullgdb
  1036. ifneq ($(wildcard packages/gdbint/libgdb/$(OS_TARGET)/libgdb.a),)
  1037. ide_full:
  1038. $(MAKE) -C compiler ppuclean
  1039. $(MAKE) -C ide fullgdb
  1040. else
  1041. ide_full:
  1042. $(MAKE) -C compiler ppuclean
  1043. $(MAKE) -C ide full
  1044. endif
  1045. #######################################
  1046. # Install targets
  1047. #######################################
  1048. demo_install:
  1049. $(MAKE) -C $(CVSINSTALL)/demo installexamples
  1050. man_install:
  1051. $(MAKE) -C $(CVSINSTALL)/man installman
  1052. doc_install:
  1053. $(MAKE) -C $(CVSINSTALL)/doc installdoc
  1054. #######################################
  1055. # Packaging targets
  1056. #######################################
  1057. idezips: ide_fullzip ide_fullgdbzip optcompinstall optcompzip
  1058. ide_compzip:
  1059. $(MAKE) compiler_clean
  1060. $(MAKE) ide_clean
  1061. $(MAKE) ide_full
  1062. $(MAKE) -C ide/text zipinstall ZIPNAME=ide-comp-$(PACKAGESUFFIX)
  1063. ide_fullgdbzip:
  1064. $(MAKE) ide_clean
  1065. $(MAKE) ide_fullgdb
  1066. $(MAKE) -C ide/text zipinstall ZIPNAME=ide-full-$(PACKAGESUFFIX)
  1067. optcompinstall:
  1068. $(MAKE) compiler_cycle OPT=-dNEWOPTIMIZATIONS
  1069. $(MAKE) compiler_install
  1070. $(MAKE) rtl_install
  1071. optcompzip:
  1072. $(MAKE) fpc_zipinstall PACKAGENAME=optcomp ZIPTARGET=optcompinstall
  1073. ##########################################################################
  1074. # Install
  1075. ##########################################################################
  1076. .PHONY: installer
  1077. INSTALLERBUILDDIR=fpinst
  1078. installer:
  1079. $(COPYTREE) $(CVSINSTALL)/fpinst $(INSTALLERBUILDDIR)
  1080. $(MAKE) -C $(INSTALLERBUILDDIR) all RELEASE=1
  1081. $(MOVE) $(INSTALLERBUILDDIR)/install.exe .
  1082. ifdef UPXPROG
  1083. -$(UPXPROG) install.exe
  1084. endif
  1085. $(DELTREE) $(INSTALLERBUILDDIR)
  1086. installersrc:
  1087. $(COPYTREE) $(CVSINSTALL)/fpinst $(INSTALLERBUILDDIR)
  1088. $(MAKE) -C $(INSTALLERBUILDDIR) zipsourceinstall
  1089. $(DELTREE) $(INSTALLERBUILDDIR)
  1090. ##########################################################################
  1091. # Packaging
  1092. ##########################################################################
  1093. .PHONY: all clean distclean build installbase zipinstall zipinstallbase zipinstallfcl \
  1094. zipinstallpackages
  1095. export RELEASE DESTZIPDIR
  1096. all: build
  1097. clean: $(addsuffix _distclean,$(DIROBJECTS))
  1098. $(DEL) build-stamp
  1099. distclean: clean
  1100. build: build-stamp
  1101. build-stamp:
  1102. # create new compiler
  1103. ifeq ($(OS_TARGET),win32)
  1104. -$(MAKE) compiler_cycle
  1105. else
  1106. $(MAKE) compiler_cycle
  1107. endif
  1108. # clean
  1109. $(MAKE) rtl_clean
  1110. $(MAKE) api_clean
  1111. $(MAKE) fcl_clean
  1112. $(MAKE) packages_clean
  1113. $(MAKE) utils_clean
  1114. ifdef IDE
  1115. $(MAKE) fv_clean
  1116. $(MAKE) ide_clean
  1117. endif
  1118. # build everything
  1119. $(MAKE) rtl_$(ALLTARGET) $(BUILDOPTS)
  1120. $(MAKE) api_$(ALLTARGET) $(BUILDOPTS)
  1121. $(MAKE) fcl_$(ALLTARGET) $(BUILDOPTS)
  1122. $(MAKE) packages_$(ALLTARGET) $(BUILDOPTS)
  1123. $(MAKE) utils_all $(BUILDOPTS)
  1124. ifdef IDE
  1125. -$(MAKE) ide_full $(BUILDOPTS)
  1126. endif
  1127. $(ECHO) Build > build-stamp
  1128. installbase: build-stamp
  1129. # create dirs
  1130. $(MKDIR) $(BASEINSTALLDIR)
  1131. $(MKDIR) $(DOCINSTALLDIR)
  1132. $(MKDIR) $(BININSTALLDIR)
  1133. ifndef SNAPSHOT
  1134. # readme & whatsnew and docs
  1135. $(COPY) $(CVSINSTALL)/doc/*.txt $(CVSINSTALL)/doc/copying* $(CVSINSTALL)/doc/faq.* $(DOCINSTALLDIR)
  1136. # bingo32 (cwsdpmi,wmemu387.dxe)
  1137. ifeq ($(OS_TARGET),go32v2)
  1138. $(COPY) $(CVSINSTALL)/bingo32/* $(BININSTALLDIR)
  1139. endif
  1140. # binw32 (cygwin1.dll)
  1141. ifeq ($(OS_TARGET),win32)
  1142. $(COPY) $(CVSINSTALL)/binw32/* $(BININSTALLDIR)
  1143. endif
  1144. # manpages for linux
  1145. ifeq ($(OS_TARGET),linux)
  1146. $(MAKE) -C $(CVSINSTALL)/man installman
  1147. endif
  1148. endif
  1149. # install generated things
  1150. $(MAKE) compiler_install $(INSTALLOPTS)
  1151. $(MAKE) rtl_install $(INSTALLOPTS)
  1152. install: build-stamp
  1153. $(MAKE) installbase $(INSTALLOPTS)
  1154. $(MAKE) utils_install $(INSTALLOPTS)
  1155. $(MAKE) api_install $(INSTALLOPTS)
  1156. $(MAKE) fcl_install $(INSTALLOPTS)
  1157. $(MAKE) packages_install $(INSTALLOPTS)
  1158. ifdef IDE
  1159. $(NOSTOP)$(MAKE) ide_install $(BUILDOPTS)
  1160. endif
  1161. zipinstall: build-stamp
  1162. $(MAKE) fpc_zipinstall ZIPTARGET=installbase PACKAGENAME=base $(INSTALLOPTS)
  1163. $(MAKE) utils_zipinstall $(INSTALLOPTS)
  1164. $(MAKE) api_zipinstall $(INSTALLOPTS) PACKAGEPREFIX=$(PKGPRE)
  1165. $(MAKE) fcl_zipinstall $(INSTALLOPTS) PACKAGEPREFIX=$(PKGPRE)
  1166. $(MAKE) packages_zipinstall $(INSTALLOPTS) PACKAGEPREFIX=$(PKGPRE)
  1167. ifdef IDE
  1168. $(NOSTOP)$(MAKE) ide_zipinstall $(INSTALLOPTS)
  1169. endif
  1170. ##########################################################################
  1171. # Docs
  1172. ##########################################################################
  1173. .PHONY: docspdf docs docsrcinstall docsrc
  1174. docspdf:
  1175. $(MAKE) -C docs pdfinstall
  1176. docs:
  1177. $(MAKE) fpc_zipinstall ZIPTARGET=docspdf ZIPNAME=docs
  1178. docsrcinstall:
  1179. $(MAKE) -C docs clean
  1180. $(MKDIR) $(SOURCEINSTALLDIR)
  1181. $(COPYTREE) docs $(SOURCEINSTALLDIR)
  1182. docsrc:
  1183. $(MAKE) fpc_zipinstall ZIPTARGET=docsrcinstall ZIPNAME=docsrc
  1184. ##########################################################################
  1185. # Demos
  1186. ##########################################################################
  1187. .PHONY: demozip
  1188. demozip:
  1189. $(MAKE) -C $(CVSINSTALL)/demo zipsourceinstall ZIPNAME=demo
  1190. ##########################################################################
  1191. # Source targets
  1192. ##########################################################################
  1193. sourcebase:
  1194. # base Makefiles needed for sources
  1195. $(MKDIR) $(SOURCEINSTALLDIR)
  1196. $(MKDIR) $(SOURCEINSTALLDIR)/rtl
  1197. $(MKDIR) $(SOURCEINSTALLDIR)/packages
  1198. $(COPY) Makefile* $(SOURCEINSTALLDIR)
  1199. $(COPY) rtl/Makefile* $(SOURCEINSTALLDIR)/rtl
  1200. $(COPY) packages/Makefile* $(SOURCEINSTALLDIR)/packages
  1201. sourcezip:
  1202. $(MAKE) fpc_zipinstall ZIPTARGET=sourcebase ZIPNAME=basesrc
  1203. $(MAKE) compiler_zipsourceinstall
  1204. $(MAKE) rtl_zipsourceinstall
  1205. $(MAKE) api_zipsourceinstall
  1206. $(MAKE) fcl_zipsourceinstall
  1207. $(MAKE) packages_zipsourceinstall
  1208. $(MAKE) utils_zipsourceinstall
  1209. # $(MAKE) installersrc
  1210. # $(MAKE) docsrc
  1211. ##########################################################################
  1212. # OS targets
  1213. ##########################################################################
  1214. .PHONY: go32v2 win32 linux go32v2zip win32zip linuxzip
  1215. go32v2: checkfpcdir
  1216. $(MAKE) install OS_TARGET=go32v2
  1217. win32: checkfpcdir
  1218. $(MAKE) install OS_TARGET=win32
  1219. linux: checkfpcdir
  1220. $(MAKE) install OS_TARGET=linux
  1221. go32v2zip: checkfpcdir
  1222. $(MAKE) zipinstall OS_TARGET=go32v2
  1223. win32zip: checkfpcdir
  1224. $(MAKE) zipinstall OS_TARGET=win32
  1225. linuxzip: checkfpcdir
  1226. $(MAKE) zipinstall OS_TARGET=linux
  1227. ##########################################################################
  1228. # Debian / RPM
  1229. ##########################################################################
  1230. .PHONY: debcopy deb rpmcopy rpm
  1231. DEBSRCDIR:=/usr/src/fpc-$(FPC_VERSION)
  1232. debcopy: distclean
  1233. rm -rf $(DEBSRCDIR)
  1234. install -d $(DEBSRCDIR)
  1235. $(COPYTREE) compiler $(DEBSRCDIR)
  1236. $(COPYTREE) rtl $(DEBSRCDIR)
  1237. $(COPYTREE) fcl $(DEBSRCDIR)
  1238. $(COPYTREE) api $(DEBSRCDIR)
  1239. $(COPYTREE) packages $(DEBSRCDIR)
  1240. $(COPYTREE) utils $(DEBSRCDIR)
  1241. $(COPYTREE) logs $(DEBSRCDIR)
  1242. $(COPYTREE) docs $(DEBSRCDIR)
  1243. $(COPYTREE) base/Makefile* $(DEBSRCDIR)
  1244. $(COPYTREE) $(CVSINSTALL)/debian $(DEBSRCDIR)
  1245. $(COPYTREE) $(CVSINSTALL)/man $(DEBSRCDIR)
  1246. $(COPYTREE) $(CVSINSTALL)/doc $(DEBSRCDIR)
  1247. $(COPYTREE) $(CVSINSTALL)/demo $(DEBSRCDIR)
  1248. find $(DEBSRCDIR) -name 'CVS*' | xargs -n1 rm -rf
  1249. chmod 755 $(DEBSRCDIR)/debian/rules
  1250. deb: checkfpcdir debcopy
  1251. cd $(DEBSRCDIR) ; debian/rules binary
  1252. REDHATDIR=/usr/src/redhat
  1253. RPMSOURCESDIR:=$(REDHATDIR)/SOURCES
  1254. RPMSPECDIR:=$(REDHATDIR)/SPECS
  1255. RPMSRCDIR:=$(RPMSOURCESDIR)/fpc
  1256. DOCSRCDIR:=$(RPMSOURCESDIR)/fpcdoc
  1257. rpmcopy: distclean
  1258. install -d $(REDHATDIR)
  1259. install -d $(RPMSPECDIR)
  1260. install -d $(RPMSOURCESDIR)
  1261. # fpc.rpm
  1262. rm -rf $(RPMSRCDIR)
  1263. cp $(CVSINSTALL)/fpc-$(FPC_VERSION).spec $(RPMSPECDIR)
  1264. install -d $(RPMSRCDIR)
  1265. $(COPYTREE) compiler $(RPMSRCDIR)
  1266. $(COPYTREE) rtl $(RPMSRCDIR)
  1267. $(COPYTREE) fcl $(RPMSRCDIR)
  1268. $(COPYTREE) api $(RPMSRCDIR)
  1269. $(COPYTREE) packages $(RPMSRCDIR)
  1270. $(COPYTREE) utils $(RPMSRCDIR)
  1271. $(COPYTREE) logs $(RPMSRCDIR)
  1272. $(COPYTREE) base/Makefile* $(RPMSRCDIR)
  1273. $(COPYTREE) $(CVSINSTALL)/man $(RPMSRCDIR)
  1274. $(COPYTREE) $(CVSINSTALL)/doc $(RPMSRCDIR)
  1275. $(COPYTREE) $(CVSINSTALL)/demo $(RPMSRCDIR)
  1276. find $(RPMSRCDIR) -name 'CVS*' | xargs -n1 rm -rf
  1277. cd $(RPMSRCDIR) ; tar cvz * > $(RPMSOURCESDIR)/fpc-$(FPC_VERSION)-src.tar.gz
  1278. # fpc-docs.rpm
  1279. rm -rf $(DOCSRCDIR)
  1280. cp $(CVSINSTALL)/fpc-docs-$(FPC_VERSION).spec $(RPMSPECDIR)
  1281. install -d $(DOCSRCDIR)
  1282. $(COPYTREE) docs $(DOCSRCDIR)
  1283. find $(DOCSRCDIR) -name 'CVS*' | xargs -n1 rm -rf
  1284. cd $(DOCSRCDIR) ; tar cvz * > $(RPMSOURCESDIR)/fpc-docs-$(FPC_VERSION)-src.tar.gz
  1285. rpm: checkfpcdir rpmcopy
  1286. cd $(RPMSPECDIR) ; rpm -ba fpc-$(FPC_VERSION).spec
  1287. cd $(RPMSPECDIR) ; rpm -ba fpc-docs-$(FPC_VERSION).spec