Makefile 32 KB

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