Makefile 32 KB

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