Makefile 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615
  1. #
  2. # Makefile generated by fpcmake v0.99.13 [2000/02/24]
  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 doc files will be stored
  546. ifndef DOCINSTALLDIR
  547. ifdef inlinux
  548. DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
  549. else
  550. DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
  551. endif
  552. endif
  553. # Where the some extra (data)files will be stored
  554. ifndef DATAINSTALLDIR
  555. DATAINSTALLDIR=$(BASEINSTALLDIR)
  556. endif
  557. #####################################################################
  558. # Redirection
  559. #####################################################################
  560. ifndef REDIRFILE
  561. REDIRFILE=log
  562. endif
  563. ifdef REDIR
  564. ifndef inlinux
  565. override FPC=redir -eo $(FPC)
  566. endif
  567. # set the verbosity to max
  568. override FPCOPT+=-va
  569. override REDIR:= >> $(REDIRFILE)
  570. endif
  571. #####################################################################
  572. # Standard rules
  573. #####################################################################
  574. debug: $(addsuffix _debug,$(DIROBJECTS))
  575. examples: $(addsuffix _examples,$(DIROBJECTS))
  576. test: $(addsuffix _test,$(DIROBJECTS))
  577. smart: $(addsuffix _smart,$(DIROBJECTS))
  578. shared: $(addsuffix _shared,$(DIROBJECTS))
  579. showinstall: $(addsuffix _showinstall,$(DIROBJECTS))
  580. sourceinstall: $(addsuffix _sourceinstall,$(DIROBJECTS))
  581. zipsourceinstall: fpc_zipsourceinstall
  582. cleanall: fpc_cleanall $(addsuffix _cleanall,$(DIROBJECTS))
  583. require: $(addsuffix _require,$(DIROBJECTS))
  584. .PHONY: debug examples test smart shared showinstall sourceinstall zipsourceinstall cleanall require
  585. #####################################################################
  586. # Zip
  587. #####################################################################
  588. .PHONY: fpc_zipinstall
  589. # Create suffix to add
  590. ifndef PACKAGESUFFIX
  591. PACKAGESUFFIX=$(OS_TARGET)
  592. ifeq ($(OS_TARGET),go32v2)
  593. PACKAGESUFFIX=go32
  594. endif
  595. ifeq ($(OS_TARGET),win32)
  596. PACKAGESUFFIX=w32
  597. endif
  598. endif
  599. # Temporary path to pack a file
  600. ifndef PACKDIR
  601. ifndef inlinux
  602. PACKDIR=$(BASEDIR)/pack_tmp
  603. else
  604. PACKDIR=/tmp/fpc-pack
  605. endif
  606. endif
  607. # Maybe create default zipname from packagename
  608. ifndef ZIPNAME
  609. ifdef PACKAGENAME
  610. ZIPNAME=$(PACKAGEPREFIX)$(PACKAGENAME)$(PACKAGESUFFIX)
  611. endif
  612. endif
  613. # Use tar by default under linux
  614. ifndef USEZIP
  615. ifdef inlinux
  616. USETAR=1
  617. endif
  618. endif
  619. fpc_zipinstall:
  620. ifndef ZIPNAME
  621. @$(ECHO) "Please specify ZIPNAME!"
  622. @exit 1
  623. else
  624. $(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)
  625. ifdef USETAR
  626. $(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT)
  627. cd $(PACKDIR) ; $(TARPROG) c$(TAROPT) --file $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT) * ; cd $(BASEDIR)
  628. else
  629. $(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT)
  630. cd $(PACKDIR) ; $(ZIPPROG) -Dr $(ZIPOPT) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT) * ; cd $(BASEDIR)
  631. endif
  632. $(DELTREE) $(PACKDIR)
  633. endif
  634. #####################################################################
  635. # Clean rules
  636. #####################################################################
  637. .PHONY: fpc_clean fpc_cleanall fpc_distclean
  638. ifdef EXTRACLEANUNITS
  639. override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
  640. endif
  641. ifdef CLEANPPUFILES
  642. ifdef PPUFILES
  643. CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
  644. else
  645. CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)))
  646. endif
  647. endif
  648. fpc_clean: $(CLEANTARGET)
  649. ifdef CLEANEXEFILES
  650. -$(DEL) $(CLEANEXEFILES)
  651. endif
  652. ifdef CLEANPPUFILES
  653. -$(DEL) $(CLEANPPUFILES)
  654. endif
  655. ifneq ($(CLEANPPULINKFILES),)
  656. -$(DEL) $(CLEANPPULINKFILES)
  657. endif
  658. ifdef CLEANRSTFILES
  659. -$(DEL) $(CLEANRSTFILES)
  660. endif
  661. ifdef EXTRACLEANFILES
  662. -$(DEL) $(EXTRACLEANFILES)
  663. endif
  664. -$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
  665. fpc_distclean: fpc_clean
  666. fpc_cleanall: $(CLEANTARGET)
  667. ifdef CLEANEXEFILES
  668. -$(DEL) $(CLEANEXEFILES)
  669. endif
  670. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  671. -$(DELTREE) *$(SMARTEXT)
  672. -$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
  673. #####################################################################
  674. # Directories
  675. #####################################################################
  676. OBJECTDIRCOMPILER=1
  677. OBJECTDIRRTL=1
  678. OBJECTDIRUTILS=1
  679. OBJECTDIRFCL=1
  680. OBJECTDIRAPI=1
  681. OBJECTDIRFV=1
  682. OBJECTDIRPACKAGES=1
  683. OBJECTDIRIDE=1
  684. # Dir compiler
  685. ifdef OBJECTDIRCOMPILER
  686. .PHONY: compiler_all compiler_debug compiler_examples compiler_test compiler_smart compiler_shared compiler_showinstall compiler_install compiler_sourceinstall compiler_zipinstall compiler_zipsourceinstall compiler_clean compiler_distclean compiler_cleanall compiler_require compiler_info
  687. compiler_all:
  688. $(MAKE) -C compiler all
  689. compiler_debug:
  690. $(MAKE) -C compiler debug
  691. compiler_examples:
  692. $(MAKE) -C compiler examples
  693. compiler_test:
  694. $(MAKE) -C compiler test
  695. compiler_smart:
  696. $(MAKE) -C compiler smart
  697. compiler_shared:
  698. $(MAKE) -C compiler shared
  699. compiler_showinstall:
  700. $(MAKE) -C compiler showinstall
  701. compiler_install:
  702. $(MAKE) -C compiler install
  703. compiler_sourceinstall:
  704. $(MAKE) -C compiler sourceinstall
  705. compiler_zipinstall:
  706. $(MAKE) -C compiler zipinstall
  707. compiler_zipsourceinstall:
  708. $(MAKE) -C compiler zipsourceinstall
  709. compiler_clean:
  710. $(MAKE) -C compiler clean
  711. compiler_distclean:
  712. $(MAKE) -C compiler distclean
  713. compiler_cleanall:
  714. $(MAKE) -C compiler cleanall
  715. compiler_require:
  716. $(MAKE) -C compiler require
  717. compiler_info:
  718. $(MAKE) -C compiler info
  719. endif
  720. # Dir rtl
  721. ifdef OBJECTDIRRTL
  722. .PHONY: rtl_all rtl_debug rtl_examples rtl_test rtl_smart rtl_shared rtl_showinstall rtl_install rtl_sourceinstall rtl_zipinstall rtl_zipsourceinstall rtl_clean rtl_distclean rtl_cleanall rtl_require rtl_info
  723. rtl_all:
  724. $(MAKE) -C rtl all
  725. rtl_debug:
  726. $(MAKE) -C rtl debug
  727. rtl_examples:
  728. $(MAKE) -C rtl examples
  729. rtl_test:
  730. $(MAKE) -C rtl test
  731. rtl_smart:
  732. $(MAKE) -C rtl smart
  733. rtl_shared:
  734. $(MAKE) -C rtl shared
  735. rtl_showinstall:
  736. $(MAKE) -C rtl showinstall
  737. rtl_install:
  738. $(MAKE) -C rtl install
  739. rtl_sourceinstall:
  740. $(MAKE) -C rtl sourceinstall
  741. rtl_zipinstall:
  742. $(MAKE) -C rtl zipinstall
  743. rtl_zipsourceinstall:
  744. $(MAKE) -C rtl zipsourceinstall
  745. rtl_clean:
  746. $(MAKE) -C rtl clean
  747. rtl_distclean:
  748. $(MAKE) -C rtl distclean
  749. rtl_cleanall:
  750. $(MAKE) -C rtl cleanall
  751. rtl_require:
  752. $(MAKE) -C rtl require
  753. rtl_info:
  754. $(MAKE) -C rtl info
  755. endif
  756. # Dir utils
  757. ifdef OBJECTDIRUTILS
  758. .PHONY: utils_all utils_debug utils_examples utils_test utils_smart utils_shared utils_showinstall utils_install utils_sourceinstall utils_zipinstall utils_zipsourceinstall utils_clean utils_distclean utils_cleanall utils_require utils_info
  759. utils_all:
  760. $(MAKE) -C utils all
  761. utils_debug:
  762. $(MAKE) -C utils debug
  763. utils_examples:
  764. $(MAKE) -C utils examples
  765. utils_test:
  766. $(MAKE) -C utils test
  767. utils_smart:
  768. $(MAKE) -C utils smart
  769. utils_shared:
  770. $(MAKE) -C utils shared
  771. utils_showinstall:
  772. $(MAKE) -C utils showinstall
  773. utils_install:
  774. $(MAKE) -C utils install
  775. utils_sourceinstall:
  776. $(MAKE) -C utils sourceinstall
  777. utils_zipinstall:
  778. $(MAKE) -C utils zipinstall
  779. utils_zipsourceinstall:
  780. $(MAKE) -C utils zipsourceinstall
  781. utils_clean:
  782. $(MAKE) -C utils clean
  783. utils_distclean:
  784. $(MAKE) -C utils distclean
  785. utils_cleanall:
  786. $(MAKE) -C utils cleanall
  787. utils_require:
  788. $(MAKE) -C utils require
  789. utils_info:
  790. $(MAKE) -C utils info
  791. endif
  792. # Dir fcl
  793. ifdef OBJECTDIRFCL
  794. .PHONY: fcl_all fcl_debug fcl_examples fcl_test fcl_smart fcl_shared fcl_showinstall fcl_install fcl_sourceinstall fcl_zipinstall fcl_zipsourceinstall fcl_clean fcl_distclean fcl_cleanall fcl_require fcl_info
  795. fcl_all:
  796. $(MAKE) -C fcl all
  797. fcl_debug:
  798. $(MAKE) -C fcl debug
  799. fcl_examples:
  800. $(MAKE) -C fcl examples
  801. fcl_test:
  802. $(MAKE) -C fcl test
  803. fcl_smart:
  804. $(MAKE) -C fcl smart
  805. fcl_shared:
  806. $(MAKE) -C fcl shared
  807. fcl_showinstall:
  808. $(MAKE) -C fcl showinstall
  809. fcl_install:
  810. $(MAKE) -C fcl install
  811. fcl_sourceinstall:
  812. $(MAKE) -C fcl sourceinstall
  813. fcl_zipinstall:
  814. $(MAKE) -C fcl zipinstall
  815. fcl_zipsourceinstall:
  816. $(MAKE) -C fcl zipsourceinstall
  817. fcl_clean:
  818. $(MAKE) -C fcl clean
  819. fcl_distclean:
  820. $(MAKE) -C fcl distclean
  821. fcl_cleanall:
  822. $(MAKE) -C fcl cleanall
  823. fcl_require:
  824. $(MAKE) -C fcl require
  825. fcl_info:
  826. $(MAKE) -C fcl info
  827. endif
  828. # Dir api
  829. ifdef OBJECTDIRAPI
  830. .PHONY: api_all api_debug api_examples api_test api_smart api_shared api_showinstall api_install api_sourceinstall api_zipinstall api_zipsourceinstall api_clean api_distclean api_cleanall api_require api_info
  831. api_all:
  832. $(MAKE) -C api all
  833. api_debug:
  834. $(MAKE) -C api debug
  835. api_examples:
  836. $(MAKE) -C api examples
  837. api_test:
  838. $(MAKE) -C api test
  839. api_smart:
  840. $(MAKE) -C api smart
  841. api_shared:
  842. $(MAKE) -C api shared
  843. api_showinstall:
  844. $(MAKE) -C api showinstall
  845. api_install:
  846. $(MAKE) -C api install
  847. api_sourceinstall:
  848. $(MAKE) -C api sourceinstall
  849. api_zipinstall:
  850. $(MAKE) -C api zipinstall
  851. api_zipsourceinstall:
  852. $(MAKE) -C api zipsourceinstall
  853. api_clean:
  854. $(MAKE) -C api clean
  855. api_distclean:
  856. $(MAKE) -C api distclean
  857. api_cleanall:
  858. $(MAKE) -C api cleanall
  859. api_require:
  860. $(MAKE) -C api require
  861. api_info:
  862. $(MAKE) -C api info
  863. endif
  864. # Dir fv
  865. ifdef OBJECTDIRFV
  866. .PHONY: fv_all fv_debug fv_examples fv_test fv_smart fv_shared fv_showinstall fv_install fv_sourceinstall fv_zipinstall fv_zipsourceinstall fv_clean fv_distclean fv_cleanall fv_require fv_info
  867. fv_all:
  868. $(MAKE) -C fv all
  869. fv_debug:
  870. $(MAKE) -C fv debug
  871. fv_examples:
  872. $(MAKE) -C fv examples
  873. fv_test:
  874. $(MAKE) -C fv test
  875. fv_smart:
  876. $(MAKE) -C fv smart
  877. fv_shared:
  878. $(MAKE) -C fv shared
  879. fv_showinstall:
  880. $(MAKE) -C fv showinstall
  881. fv_install:
  882. $(MAKE) -C fv install
  883. fv_sourceinstall:
  884. $(MAKE) -C fv sourceinstall
  885. fv_zipinstall:
  886. $(MAKE) -C fv zipinstall
  887. fv_zipsourceinstall:
  888. $(MAKE) -C fv zipsourceinstall
  889. fv_clean:
  890. $(MAKE) -C fv clean
  891. fv_distclean:
  892. $(MAKE) -C fv distclean
  893. fv_cleanall:
  894. $(MAKE) -C fv cleanall
  895. fv_require:
  896. $(MAKE) -C fv require
  897. fv_info:
  898. $(MAKE) -C fv info
  899. endif
  900. # Dir packages
  901. ifdef OBJECTDIRPACKAGES
  902. .PHONY: packages_all packages_debug packages_examples packages_test packages_smart packages_shared packages_showinstall packages_install packages_sourceinstall packages_zipinstall packages_zipsourceinstall packages_clean packages_distclean packages_cleanall packages_require packages_info
  903. packages_all:
  904. $(MAKE) -C packages all
  905. packages_debug:
  906. $(MAKE) -C packages debug
  907. packages_examples:
  908. $(MAKE) -C packages examples
  909. packages_test:
  910. $(MAKE) -C packages test
  911. packages_smart:
  912. $(MAKE) -C packages smart
  913. packages_shared:
  914. $(MAKE) -C packages shared
  915. packages_showinstall:
  916. $(MAKE) -C packages showinstall
  917. packages_install:
  918. $(MAKE) -C packages install
  919. packages_sourceinstall:
  920. $(MAKE) -C packages sourceinstall
  921. packages_zipinstall:
  922. $(MAKE) -C packages zipinstall
  923. packages_zipsourceinstall:
  924. $(MAKE) -C packages zipsourceinstall
  925. packages_clean:
  926. $(MAKE) -C packages clean
  927. packages_distclean:
  928. $(MAKE) -C packages distclean
  929. packages_cleanall:
  930. $(MAKE) -C packages cleanall
  931. packages_require:
  932. $(MAKE) -C packages require
  933. packages_info:
  934. $(MAKE) -C packages info
  935. endif
  936. # Dir ide
  937. ifdef OBJECTDIRIDE
  938. .PHONY: ide_all ide_debug ide_examples ide_test ide_smart ide_shared ide_showinstall ide_install ide_sourceinstall ide_zipinstall ide_zipsourceinstall ide_clean ide_distclean ide_cleanall ide_require ide_info
  939. ide_all:
  940. $(MAKE) -C ide all
  941. ide_debug:
  942. $(MAKE) -C ide debug
  943. ide_examples:
  944. $(MAKE) -C ide examples
  945. ide_test:
  946. $(MAKE) -C ide test
  947. ide_smart:
  948. $(MAKE) -C ide smart
  949. ide_shared:
  950. $(MAKE) -C ide shared
  951. ide_showinstall:
  952. $(MAKE) -C ide showinstall
  953. ide_install:
  954. $(MAKE) -C ide install
  955. ide_sourceinstall:
  956. $(MAKE) -C ide sourceinstall
  957. ide_zipinstall:
  958. $(MAKE) -C ide zipinstall
  959. ide_zipsourceinstall:
  960. $(MAKE) -C ide zipsourceinstall
  961. ide_clean:
  962. $(MAKE) -C ide clean
  963. ide_distclean:
  964. $(MAKE) -C ide distclean
  965. ide_cleanall:
  966. $(MAKE) -C ide cleanall
  967. ide_require:
  968. $(MAKE) -C ide require
  969. ide_info:
  970. $(MAKE) -C ide info
  971. endif
  972. #####################################################################
  973. # Local Makefile
  974. #####################################################################
  975. ifneq ($(wildcard fpcmake.loc),)
  976. include fpcmake.loc
  977. endif
  978. #####################################################################
  979. # Users rules
  980. #####################################################################
  981. # These values can change
  982. unexport FPC_VERSION OS_SOURCE
  983. #####################################################################
  984. # Main targets
  985. #####################################################################
  986. .PHONY: help checkfpcdir
  987. help:
  988. @echo
  989. @echo Directory targets:
  990. @echo
  991. @echo $(DIROBJECTS)
  992. @echo
  993. @echo Packing targets are:
  994. @echo
  995. @echo go32v2zip,win32zip,linuxzip,sourcezip
  996. @echo
  997. @exit
  998. #####################################################################
  999. # Dependencies
  1000. #####################################################################
  1001. #######################################
  1002. # Compiler
  1003. #######################################
  1004. .PHONY: compiler_cycle
  1005. compiler_cycle:
  1006. $(MAKE) -C compiler cycle
  1007. #######################################
  1008. # IDE
  1009. #######################################
  1010. .PHONY: ide_comp ide_full
  1011. ide_comp:
  1012. $(MAKE) -C compiler ppuclean
  1013. $(MAKE) -C ide full
  1014. # Look if libgdb.a is available then use fullgdb
  1015. ifneq ($(wildcard packages/gdbint/libgdb/$(OS_TARGET)/libgdb.a),)
  1016. ide_full:
  1017. $(MAKE) -C compiler ppuclean
  1018. $(MAKE) -C ide fullgdb
  1019. else
  1020. ide_full:
  1021. $(MAKE) -C compiler ppuclean
  1022. $(MAKE) -C ide full
  1023. endif
  1024. #######################################
  1025. # Install targets
  1026. #######################################
  1027. demo_install:
  1028. $(MAKE) -C $(CVSINSTALL)/demo installexamples
  1029. man_install:
  1030. $(MAKE) -C $(CVSINSTALL)/man installman
  1031. doc_install:
  1032. $(MAKE) -C $(CVSINSTALL)/doc installdoc
  1033. #######################################
  1034. # Packaging targets
  1035. #######################################
  1036. idezips: ide_fullzip ide_fullgdbzip optcompinstall optcompzip
  1037. ide_compzip:
  1038. $(MAKE) compiler_clean
  1039. $(MAKE) ide_clean
  1040. $(MAKE) ide_full
  1041. $(MAKE) -C ide/text zipinstall ZIPNAME=ide-comp-$(PACKAGESUFFIX)
  1042. ide_fullgdbzip:
  1043. $(MAKE) ide_clean
  1044. $(MAKE) ide_fullgdb
  1045. $(MAKE) -C ide/text zipinstall ZIPNAME=ide-full-$(PACKAGESUFFIX)
  1046. optcompinstall:
  1047. $(MAKE) compiler_cycle OPT=-dNEWOPTIMIZATIONS
  1048. $(MAKE) compiler_install
  1049. $(MAKE) rtl_install
  1050. optcompzip:
  1051. $(MAKE) fpc_zipinstall PACKAGENAME=optcomp ZIPTARGET=optcompinstall
  1052. ##########################################################################
  1053. # Install
  1054. ##########################################################################
  1055. .PHONY: installer
  1056. INSTALLERBUILDDIR=fpinst
  1057. installer:
  1058. $(COPYTREE) $(CVSINSTALL)/fpinst $(INSTALLERBUILDDIR)
  1059. $(MAKE) -C $(INSTALLERBUILDDIR) all RELEASE=1
  1060. $(MOVE) $(INSTALLERBUILDDIR)/install.exe .
  1061. ifdef UPXPROG
  1062. -$(UPXPROG) install.exe
  1063. endif
  1064. $(DELTREE) $(INSTALLERBUILDDIR)
  1065. installersrc:
  1066. $(COPYTREE) $(CVSINSTALL)/fpinst $(INSTALLERBUILDDIR)
  1067. $(MAKE) -C $(INSTALLERBUILDDIR) zipsourceinstall
  1068. $(DELTREE) $(INSTALLERBUILDDIR)
  1069. ##########################################################################
  1070. # Packaging
  1071. ##########################################################################
  1072. .PHONY: all clean distclean build installbase zipinstall zipinstallbase zipinstallfcl \
  1073. zipinstallpackages
  1074. export RELEASE DESTZIPDIR
  1075. all: build
  1076. clean: $(addsuffix _distclean,$(DIROBJECTS))
  1077. $(DEL) build-stamp
  1078. distclean: clean
  1079. build: build-stamp
  1080. build-stamp:
  1081. # create new compiler
  1082. ifeq ($(OS_TARGET),win32)
  1083. -$(MAKE) compiler_cycle
  1084. else
  1085. $(MAKE) compiler_cycle
  1086. endif
  1087. # clean
  1088. $(MAKE) rtl_clean
  1089. $(MAKE) api_clean
  1090. $(MAKE) fcl_clean
  1091. $(MAKE) packages_clean
  1092. $(MAKE) utils_clean
  1093. ifdef IDE
  1094. $(MAKE) fv_clean
  1095. $(MAKE) ide_clean
  1096. endif
  1097. # build everything
  1098. $(MAKE) rtl_$(ALLTARGET) $(BUILDOPTS)
  1099. $(MAKE) api_$(ALLTARGET) $(BUILDOPTS)
  1100. $(MAKE) fcl_$(ALLTARGET) $(BUILDOPTS)
  1101. $(MAKE) packages_$(ALLTARGET) $(BUILDOPTS)
  1102. $(MAKE) utils_all $(BUILDOPTS)
  1103. ifdef IDE
  1104. -$(MAKE) ide_full $(BUILDOPTS)
  1105. endif
  1106. $(ECHO) Build > build-stamp
  1107. installbase: build-stamp
  1108. # create dirs
  1109. $(MKDIR) $(BASEINSTALLDIR)
  1110. $(MKDIR) $(DOCINSTALLDIR)
  1111. $(MKDIR) $(BININSTALLDIR)
  1112. ifndef SNAPSHOT
  1113. # readme & whatsnew and docs
  1114. $(COPY) $(CVSINSTALL)/doc/*.txt $(CVSINSTALL)/doc/copying* $(CVSINSTALL)/doc/faq.* $(DOCINSTALLDIR)
  1115. # bingo32 (cwsdpmi,wmemu387.dxe)
  1116. ifeq ($(OS_TARGET),go32v2)
  1117. $(COPY) $(CVSINSTALL)/bingo32/* $(BININSTALLDIR)
  1118. endif
  1119. # binw32 (cygwin1.dll)
  1120. ifeq ($(OS_TARGET),win32)
  1121. $(COPY) $(CVSINSTALL)/binw32/* $(BININSTALLDIR)
  1122. endif
  1123. # manpages for linux
  1124. ifeq ($(OS_TARGET),linux)
  1125. $(MAKE) -C $(CVSINSTALL)/man installman
  1126. endif
  1127. endif
  1128. # install generated things
  1129. $(MAKE) compiler_install $(INSTALLOPTS)
  1130. $(MAKE) rtl_install $(INSTALLOPTS)
  1131. install: build-stamp
  1132. $(MAKE) installbase $(INSTALLOPTS)
  1133. $(MAKE) utils_install $(INSTALLOPTS)
  1134. $(MAKE) api_install $(INSTALLOPTS)
  1135. $(MAKE) fcl_install $(INSTALLOPTS)
  1136. $(MAKE) packages_install $(INSTALLOPTS)
  1137. ifdef IDE
  1138. $(NOSTOP)$(MAKE) ide_install $(BUILDOPTS)
  1139. endif
  1140. zipinstall: build-stamp
  1141. $(MAKE) fpc_zipinstall ZIPTARGET=installbase PACKAGENAME=base $(INSTALLOPTS)
  1142. $(MAKE) utils_zipinstall $(INSTALLOPTS)
  1143. $(MAKE) api_zipinstall $(INSTALLOPTS) PACKAGEPREFIX=$(PKGPRE)
  1144. $(MAKE) fcl_zipinstall $(INSTALLOPTS) PACKAGEPREFIX=$(PKGPRE)
  1145. $(MAKE) packages_zipinstall $(INSTALLOPTS) PACKAGEPREFIX=$(PKGPRE)
  1146. ifdef IDE
  1147. $(NOSTOP)$(MAKE) ide_zipinstall $(INSTALLOPTS)
  1148. endif
  1149. ##########################################################################
  1150. # Docs
  1151. ##########################################################################
  1152. .PHONY: docspdf docs docsrcinstall docsrc
  1153. docspdf:
  1154. $(MAKE) -C docs pdfinstall
  1155. docs:
  1156. $(MAKE) fpc_zipinstall ZIPTARGET=docspdf ZIPNAME=docs
  1157. docsrcinstall:
  1158. $(MAKE) -C docs clean
  1159. $(MKDIR) $(SOURCEINSTALLDIR)
  1160. $(COPYTREE) docs $(SOURCEINSTALLDIR)
  1161. docsrc:
  1162. $(MAKE) fpc_zipinstall ZIPTARGET=docsrcinstall ZIPNAME=docsrc
  1163. ##########################################################################
  1164. # Demos
  1165. ##########################################################################
  1166. .PHONY: demozip
  1167. demozip:
  1168. $(MAKE) -C $(CVSINSTALL)/demo zipsourceinstall ZIPNAME=demo
  1169. ##########################################################################
  1170. # Source targets
  1171. ##########################################################################
  1172. sourcebase:
  1173. # base Makefiles needed for sources
  1174. $(MKDIR) $(SOURCEINSTALLDIR)
  1175. $(MKDIR) $(SOURCEINSTALLDIR)/rtl
  1176. $(MKDIR) $(SOURCEINSTALLDIR)/packages
  1177. $(COPY) Makefile* $(SOURCEINSTALLDIR)
  1178. $(COPY) rtl/Makefile* $(SOURCEINSTALLDIR)/rtl
  1179. $(COPY) packages/Makefile* $(SOURCEINSTALLDIR)/packages
  1180. sourcezip:
  1181. $(MAKE) fpc_zipinstall ZIPTARGET=sourcebase ZIPNAME=basesrc
  1182. $(MAKE) compiler_zipsourceinstall
  1183. $(MAKE) rtl_zipsourceinstall
  1184. $(MAKE) api_zipsourceinstall
  1185. $(MAKE) fcl_zipsourceinstall
  1186. $(MAKE) packages_zipsourceinstall
  1187. $(MAKE) utils_zipsourceinstall
  1188. # $(MAKE) installersrc
  1189. # $(MAKE) docsrc
  1190. ##########################################################################
  1191. # OS targets
  1192. ##########################################################################
  1193. .PHONY: go32v2 win32 linux go32v2zip win32zip linuxzip
  1194. go32v2: checkfpcdir
  1195. $(MAKE) install OS_TARGET=go32v2
  1196. win32: checkfpcdir
  1197. $(MAKE) install OS_TARGET=win32
  1198. linux: checkfpcdir
  1199. $(MAKE) install OS_TARGET=linux
  1200. go32v2zip: checkfpcdir
  1201. $(MAKE) zipinstall OS_TARGET=go32v2
  1202. win32zip: checkfpcdir
  1203. $(MAKE) zipinstall OS_TARGET=win32
  1204. linuxzip: checkfpcdir
  1205. $(MAKE) zipinstall OS_TARGET=linux
  1206. ##########################################################################
  1207. # Debian / RPM
  1208. ##########################################################################
  1209. .PHONY: debcopy deb rpmcopy rpm
  1210. DEBSRCDIR:=/usr/src/fpc-$(FPC_VERSION)
  1211. debcopy: distclean
  1212. rm -rf $(DEBSRCDIR)
  1213. install -d $(DEBSRCDIR)
  1214. $(COPYTREE) compiler $(DEBSRCDIR)
  1215. $(COPYTREE) rtl $(DEBSRCDIR)
  1216. $(COPYTREE) fcl $(DEBSRCDIR)
  1217. $(COPYTREE) api $(DEBSRCDIR)
  1218. $(COPYTREE) packages $(DEBSRCDIR)
  1219. $(COPYTREE) utils $(DEBSRCDIR)
  1220. $(COPYTREE) logs $(DEBSRCDIR)
  1221. $(COPYTREE) docs $(DEBSRCDIR)
  1222. $(COPYTREE) base/Makefile* $(DEBSRCDIR)
  1223. $(COPYTREE) $(CVSINSTALL)/debian $(DEBSRCDIR)
  1224. $(COPYTREE) $(CVSINSTALL)/man $(DEBSRCDIR)
  1225. $(COPYTREE) $(CVSINSTALL)/doc $(DEBSRCDIR)
  1226. $(COPYTREE) $(CVSINSTALL)/demo $(DEBSRCDIR)
  1227. find $(DEBSRCDIR) -name 'CVS*' | xargs -n1 rm -rf
  1228. chmod 755 $(DEBSRCDIR)/debian/rules
  1229. deb: checkfpcdir debcopy
  1230. cd $(DEBSRCDIR) ; debian/rules binary
  1231. REDHATDIR=/usr/src/redhat
  1232. RPMSOURCESDIR:=$(REDHATDIR)/SOURCES
  1233. RPMSPECDIR:=$(REDHATDIR)/SPECS
  1234. RPMSRCDIR:=$(RPMSOURCESDIR)/fpc
  1235. DOCSRCDIR:=$(RPMSOURCESDIR)/fpcdoc
  1236. rpmcopy: distclean
  1237. install -d $(REDHATDIR)
  1238. install -d $(RPMSPECDIR)
  1239. install -d $(RPMSOURCESDIR)
  1240. # fpc.rpm
  1241. rm -rf $(RPMSRCDIR)
  1242. cp $(CVSINSTALL)/fpc-$(FPC_VERSION).spec $(RPMSPECDIR)
  1243. install -d $(RPMSRCDIR)
  1244. $(COPYTREE) compiler $(RPMSRCDIR)
  1245. $(COPYTREE) rtl $(RPMSRCDIR)
  1246. $(COPYTREE) fcl $(RPMSRCDIR)
  1247. $(COPYTREE) api $(RPMSRCDIR)
  1248. $(COPYTREE) packages $(RPMSRCDIR)
  1249. $(COPYTREE) utils $(RPMSRCDIR)
  1250. $(COPYTREE) logs $(RPMSRCDIR)
  1251. $(COPYTREE) base/Makefile* $(RPMSRCDIR)
  1252. $(COPYTREE) $(CVSINSTALL)/man $(RPMSRCDIR)
  1253. $(COPYTREE) $(CVSINSTALL)/doc $(RPMSRCDIR)
  1254. $(COPYTREE) $(CVSINSTALL)/demo $(RPMSRCDIR)
  1255. find $(RPMSRCDIR) -name 'CVS*' | xargs -n1 rm -rf
  1256. cd $(RPMSRCDIR) ; tar cvz * > $(RPMSOURCESDIR)/fpc-$(FPC_VERSION)-src.tar.gz
  1257. # fpc-docs.rpm
  1258. rm -rf $(DOCSRCDIR)
  1259. cp $(CVSINSTALL)/fpc-docs-$(FPC_VERSION).spec $(RPMSPECDIR)
  1260. install -d $(DOCSRCDIR)
  1261. $(COPYTREE) docs $(DOCSRCDIR)
  1262. find $(DOCSRCDIR) -name 'CVS*' | xargs -n1 rm -rf
  1263. cd $(DOCSRCDIR) ; tar cvz * > $(RPMSOURCESDIR)/fpc-docs-$(FPC_VERSION)-src.tar.gz
  1264. rpm: checkfpcdir rpmcopy
  1265. cd $(RPMSPECDIR) ; rpm -ba fpc-$(FPC_VERSION).spec
  1266. cd $(RPMSPECDIR) ; rpm -ba fpc-docs-$(FPC_VERSION).spec