Makefile.fpc 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. #
  2. # Makefile.fpc for Free Pascal Compiler
  3. #
  4. [package]
  5. name=compiler
  6. version=2.4.5
  7. [target]
  8. programs=pp
  9. dirs=utils
  10. [compiler]
  11. targetdir=.
  12. unittargetdir=$(CPU_UNITDIR)/units/$(FULL_TARGET)
  13. unitdir=$(COMPILERSOURCEDIR)
  14. includedir=$(CPC_TARGET)
  15. [require]
  16. packages=rtl
  17. tools=diff cmp
  18. [install]
  19. fpcpackage=y
  20. [default]
  21. fpcdir=..
  22. [prerules]
  23. # Don't export version it can change after the first compile
  24. unexport FPC_VERSION FPC_COMPILERINFO
  25. # Which platforms are ready for inclusion in the cycle
  26. CYCLETARGETS=i386 powerpc sparc arm x86_64 powerpc64 m68k armeb # mipsel mips
  27. # All supported targets used for clean
  28. ALLTARGETS=$(CYCLETARGETS)
  29. # Allow ALPHA, POWERPC, POWERPC64, M68K, I386 defines for target cpu
  30. ifdef ALPHA
  31. PPC_TARGET=alpha
  32. endif
  33. ifdef POWERPC
  34. PPC_TARGET=powerpc
  35. endif
  36. ifdef POWERPC64
  37. PPC_TARGET=powerpc64
  38. endif
  39. ifdef SPARC
  40. PPC_TARGET=sparc
  41. endif
  42. ifdef M68K
  43. PPC_TARGET=m68k
  44. endif
  45. ifdef I386
  46. PPC_TARGET=i386
  47. endif
  48. ifdef X86_64
  49. PPC_TARGET=x86_64
  50. endif
  51. ifdef ARM
  52. PPC_TARGET=arm
  53. endif
  54. ifdef ARMEB
  55. PPC_TARGET=armeb
  56. endif
  57. ifdef MIPS
  58. PPC_TARGET=mips
  59. endif
  60. ifdef MIPSEL
  61. PPC_TARGET=mipsel
  62. endif
  63. # Default is to generate a compiler for the same
  64. # platform as CPU_TARGET (a native compiler)
  65. ifndef PPC_TARGET
  66. PPC_TARGET=$(CPU_TARGET)
  67. endif
  68. ifeq ($(PPC_TARGET),armeb)
  69. CPC_TARGET=arm
  70. else
  71. CPC_TARGET=$(PPC_TARGET)
  72. endif
  73. # Default is to generate a compiler for the same
  74. # target as OS_TARGET (a native compiler)
  75. ifndef PPC_OS
  76. PPC_OS=$(OS_TARGET)
  77. endif
  78. # Where to place the unit files.
  79. CPU_UNITDIR=$(CPC_TARGET)
  80. # RTL
  81. UTILSDIR=../utils
  82. # Directories containing compiler sources
  83. COMPILERSOURCEDIR=$(CPC_TARGET) systems
  84. # Utils used by compiler development/installation
  85. COMPILERUTILSDIR=utils
  86. # Default language for the compiler
  87. ifndef FPCLANG
  88. FPCLANG=e
  89. endif
  90. # Local options for the compiler only
  91. ifndef LOCALOPT
  92. LOCALOPT:=$(OPT)
  93. endif
  94. # Options for the RTL only when cycling
  95. ifndef RTLOPT
  96. RTLOPT:=$(OPT)
  97. endif
  98. # Make OPT empty. It is copied to LOCALOPT and RTLOPT
  99. override OPT=
  100. # Message files
  101. MSGFILES=$(wildcard msg/error*.msg)
  102. # ppcSUFFIX
  103. ifeq ($(CPC_TARGET),i386)
  104. CPUSUF=386
  105. endif
  106. ifeq ($(CPC_TARGET),alpha)
  107. CPUSUF=axp
  108. endif
  109. ifeq ($(CPC_TARGET),m68k)
  110. CPUSUF=68k
  111. endif
  112. ifeq ($(CPC_TARGET),powerpc)
  113. CPUSUF=ppc
  114. endif
  115. ifeq ($(CPC_TARGET),powerpc64)
  116. CPUSUF=ppc64
  117. endif
  118. ifeq ($(CPC_TARGET),sparc)
  119. CPUSUF=sparc
  120. endif
  121. ifeq ($(CPC_TARGET),x86_64)
  122. CPUSUF=x64
  123. endif
  124. ifeq ($(CPC_TARGET),arm)
  125. CPUSUF=arm
  126. endif
  127. # Do not define the default -d$(CPU_TARGET) because that
  128. # will conflict with our -d$(CPC_TARGET)
  129. NOCPUDEF=1
  130. # Default message file
  131. MSGFILE=msg/error$(FPCLANG).msg
  132. SVNVERSION:=$(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH)))
  133. # Check if revision.inc is present
  134. REVINC:=$(wildcard revision.inc)
  135. ifneq ($(REVINC),)
  136. # File revision.inc is present
  137. #Use it to compile version.pas unit
  138. override LOCALOPT+=-dREVINC
  139. # Automatically update revision.inc if
  140. # svnversion executable is available
  141. ifeq ($(REVSTR),)
  142. ifneq ($(SVNVERSION),)
  143. REVSTR:=$(shell $(SVNVERSION) -c .)
  144. export REVSTR
  145. else
  146. ifeq ($(REVINC),force)
  147. REVSTR:=exported
  148. export REVSTR
  149. endif
  150. endif
  151. endif
  152. endif
  153. # set correct defines (-d$(CPU_TARGET) is automatically added in makefile.fpc)
  154. override LOCALOPT+=-d$(CPC_TARGET) -dGDB -dBROWSERLOG
  155. # i386 specific
  156. ifeq ($(PPC_TARGET),i386)
  157. override LOCALOPT+=-Fux86
  158. endif
  159. # x86_64 specific
  160. ifeq ($(PPC_TARGET),x86_64)
  161. override LOCALOPT+=-Fux86
  162. endif
  163. # PowerPC specific
  164. ifeq ($(PPC_TARGET),powerpc)
  165. override LOCALOPT+=-Fuppcgen
  166. endif
  167. # PowerPC64 specific
  168. ifeq ($(PPC_TARGET),powerpc64)
  169. override LOCALOPT+=-Fuppcgen
  170. endif
  171. # m68k specific
  172. ifeq ($(PPC_TARGET),m68k)
  173. override LOCALOPT+=-dNOOPT
  174. endif
  175. # Sparc specific
  176. ifeq ($(PPC_TARGET),sparc)
  177. override LOCALOPT+=
  178. endif
  179. # m68k specific with low stack
  180. ifeq ($(PPC_TARGET),m68k)
  181. ifeq ($(OS_TARGET),amiga)
  182. override LOCALOPT+=-Ct
  183. endif
  184. endif
  185. # ARM specific
  186. ifeq ($(PPC_TARGET),arm)
  187. override LOCALOPT+=
  188. endif
  189. [rules]
  190. #####################################################################
  191. # Setup Targets
  192. #####################################################################
  193. ifeq ($(OS_TARGET),win32)
  194. ifdef CMP
  195. override DIFF:=$(CMP) -i218
  196. endif
  197. endif
  198. # Add Local options
  199. override COMPILER+=$(LOCALOPT)
  200. #####################################################################
  201. # PASDoc
  202. #####################################################################
  203. PASDOC:=$(strip $(wildcard $(addsuffix /pasdoc.exe,$(SEARCHPATH))))
  204. ifeq ($(PASDOC),)
  205. PASDOC:=$(strip $(wildcard $(addsuffix /pasdoc,$(SEARCHPATH))))
  206. endif
  207. ifeq ($(PASDOC),)
  208. PASDOC:=../projects/pasdoc/bin/pasdoc
  209. else
  210. PASDOC:=$(firstword $(PASDOC))
  211. endif
  212. #####################################################################
  213. # Setup os-independent filenames
  214. #####################################################################
  215. ifndef EXENAME
  216. EXENAME=ppc$(CPUSUF)$(EXEEXT)
  217. endif
  218. PPEXENAME=pp$(EXEEXT)
  219. TEMPNAME=ppc$(SRCEXEEXT)
  220. PPCROSSNAME=ppcross$(CPUSUF)$(SRCEXEEXT)
  221. TEMPNAME1=ppc1$(EXEEXT)
  222. TEMPNAME2=ppc2$(EXEEXT)
  223. TEMPNAME3=ppc3$(EXEEXT)
  224. MAKEDEP=ppdep$(EXEEXT)
  225. MSG2INC=./msg2inc$(EXEEXT)
  226. ifdef CROSSINSTALL
  227. INSTALLEXEFILE=$(PPCROSSNAME)
  228. else
  229. INSTALLEXEFILE=$(EXENAME)
  230. endif
  231. #####################################################################
  232. # CPU targets
  233. #####################################################################
  234. PPC_TARGETS=i386 m68k powerpc sparc arm armeb x86_64 powerpc64 alpha vis ia64 mips mipsel
  235. .PHONY: $(PPC_TARGETS)
  236. $(PPC_TARGETS):
  237. $(MAKE) PPC_TARGET=$@ CPU_UNITDIR=$@ all
  238. alltargets: $(ALLTARGETS)
  239. #####################################################################
  240. # Default makefile
  241. #####################################################################
  242. .NOTPARALLEL:
  243. .PHONY: all compiler echotime ppuclean execlean clean distclean
  244. all: compiler $(addsuffix _all,$(TARGET_DIRS))
  245. compiler: $(COMPILER_UNITTARGETDIR) $(COMPILER_TARGETDIR) $(EXENAME)
  246. ifeq ($(MAKELEVEL),0)
  247. ifndef STARTTIME
  248. ifdef DATE
  249. STARTTIME:=$(shell $(DATE) +%T)
  250. else
  251. STARTTIME:=unknown
  252. endif
  253. endif
  254. endif
  255. export STARTTIME
  256. ifdef DATE
  257. ENDTIME=$(shell $(DATE) +%T)
  258. else
  259. ENDTIME:=unknown
  260. endif
  261. echotime:
  262. @echo Start $(STARTTIME) now $(ENDTIME)
  263. ppuclean:
  264. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  265. -$(DEL) $(addsuffix /*$(PPUEXT),$(COMPILERSOURCEDIR))
  266. tempclean:
  267. -$(DEL) $(PPCROSSNAME) $(TEMPNAME) $(TEMPNAME1) $(TEMPNAME2) $(TEMPNAME3) $(MSG2INC)
  268. execlean :
  269. -$(DEL) ppc386$(EXEEXT) ppcaxp$(EXEEXT) ppc68k$(EXEEXT) ppcx64$(EXEEXT) ppcppc$(EXEEXT) ppcsparc$(EXEEXT) $(EXENAME)
  270. $(addsuffix _clean,$(ALLTARGETS)):
  271. -$(DELTREE) $(addprefix $(subst _clean,,$@),/units)
  272. -$(DEL) $(addprefix $(subst _clean,,$@)/,*$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT))
  273. -$(DEL) $(addprefix $(subst _clean,,$@)/,ppc386$(EXEEXT) ppcaxp$(EXEEXT) ppc68k$(EXEEXT) ppcx64$(EXEEXT) ppcppc$(EXEEXT) ppcppc$(EXEEXT) $(EXENAME))
  274. cycleclean: cleanall $(addsuffix _clean,$(CPC_TARGET))
  275. -$(DEL) $(EXENAME)
  276. clean: tempclean execlean cleanall $(addsuffix _clean,$(CPC_TARGET)) $(addsuffix _clean,$(TARGET_DIRS))
  277. distclean: tempclean execlean cleanall $(addsuffix _clean,$(ALLTARGETS)) $(addsuffix _distclean,$(TARGET_DIRS))
  278. #####################################################################
  279. # Make targets
  280. #####################################################################
  281. $(MSG2INC): $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(COMPILERUTILSDIR)/msg2inc.pp
  282. $(COMPILER) -FE. $(COMPILERUTILSDIR)/msg2inc.pp
  283. # The msgtxt.inc only depends on the error?.msg file, not on msg2inc,
  284. # because that one will be new almost everytime
  285. msgtxt.inc: $(MSGFILE)
  286. $(MAKE) $(MSG2INC)
  287. $(MSG2INC) $(MSGFILE) msg msg
  288. msg: msgtxt.inc
  289. insdatx86 : $(COMPILER_UNITTARGETDIR) x86/x86ins.dat
  290. $(COMPILER) -FE$(COMPILERUTILSDIR) $(COMPILERUTILSDIR)/mkx86ins.pp
  291. cd x86 && ../utils/mkx86ins$(SRCEXEEXT) && mv -f *.inc ../i386
  292. cd x86 && ../utils/mkx86ins$(SRCEXEEXT) x86_64 && mv -f *.inc ../x86_64
  293. insdatarm : arm/armins.dat
  294. $(COMPILER) -FE$(COMPILERUTILSDIR) $(COMPILERUTILSDIR)/mkarmins.pp
  295. cd arm && ../utils/mkarmins$(SRCEXEEXT)
  296. insdat: insdatx86 insdatarm
  297. regdatarm : arm/armreg.dat
  298. $(COMPILER) -FE$(COMPILERUTILSDIR) $(COMPILERUTILSDIR)/mkarmreg.pp
  299. cd arm && ../utils/mkarmreg$(SRCEXEEXT)
  300. # revision.inc rule
  301. revision.inc :
  302. ifneq ($(REVSTR),)
  303. ifdef USEZIPWRAPPER
  304. ifneq ($(ECHOREDIR),echo)
  305. $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
  306. else
  307. $(ECHOREDIR) '$(REVSTR)' > revision.inc
  308. endif
  309. else
  310. $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
  311. endif
  312. else
  313. $(MAKE) revision.inc REVINC=force
  314. endif
  315. .PHONY : revision
  316. revision :
  317. $(DEL) revision.inc
  318. $(MAKE) revision.inc
  319. # Make only the compiler
  320. # ECHOREDIR sometimes does not remove double quotes
  321. $(EXENAME) : $(wildcard *.pas) $(wildcard *.inc) msg \
  322. $(wildcard systems/*.pas) $(wilcard systems/*.inc) \
  323. $(wildcard $(CPC_TARGET)/*.pas) $(wildcard $(CPC_TARGET)/*.inc)
  324. ifneq ($(REVSTR),)
  325. ifdef USEZIPWRAPPER
  326. ifneq ($(ECHOREDIR),echo)
  327. $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
  328. else
  329. $(ECHOREDIR) '$(REVSTR)' > revision.inc
  330. endif
  331. else
  332. $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
  333. endif
  334. $(COMPILER) version.pas
  335. endif
  336. $(COMPILER) pp.pas
  337. $(EXECPPAS)
  338. $(MOVE) $(COMPILER_TARGETDIR)/$(PPEXENAME) $(EXENAME)
  339. #####################################################################
  340. # Cycle targets
  341. #
  342. # 1. Source CPU = Target CPU and Source OS = Target OS
  343. # Normal cycle
  344. #
  345. # 2. Source CPU = Target CPU and Source OS <> Target OS
  346. # First source native compiler
  347. # Second target native compiler (skipped for cross installation)
  348. #
  349. # 3. Source CPU <> Target CPU
  350. # First source native compiler
  351. # Second cross compiler
  352. # Third target native compiler (skipped for cross installation)
  353. #
  354. #####################################################################
  355. ifeq ($(CPU_SOURCE),$(PPC_TARGET))
  356. ifeq ($(OS_SOURCE),$(OS_TARGET))
  357. ##########################
  358. # Normal cycle
  359. #
  360. # Used to avoid unnecessary steps
  361. ifdef DIFF
  362. ifdef OLDFPC
  363. ifneq ($(OS_TARGET),darwin)
  364. DIFFRESULT:=$(shell $(DIFF) $(OLDFPC) $(FPC))
  365. else
  366. DIFFRESULT:=$(shell cp $(OLDFPC) $(OLDFPC).tmp; cp $(FPC) $(FPC).tmp; strip -no_uuid $(OLDFPC).tmp; strip -no_uuid $(FPC).tmp; $(DIFF) $(OLDFPC).tmp $(FPC).tmp; rm $(OLDFPC).tmp $(FPC).tmp)
  367. endif
  368. else
  369. DIFFRESULT=Not equal
  370. endif
  371. else
  372. DIFFRESULT=No diff program
  373. endif
  374. ifndef DIFFRESULT
  375. next :
  376. @echo $(OLDFPC) and $(FPC) are equal
  377. $(COPY) $(FPC) $(EXENAME)
  378. else
  379. next :
  380. $(MAKE) rtlclean rtl
  381. $(MAKE) cycleclean compiler
  382. $(MAKE) echotime
  383. endif
  384. $(TEMPNAME1) :
  385. $(MAKE) 'OLDFPC=' next
  386. -$(DEL) $(TEMPNAME1)
  387. $(MOVE) $(EXENAME) $(TEMPNAME1)
  388. $(TEMPNAME2) : $(TEMPNAME1)
  389. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME1)' 'OLDFPC=' next
  390. -$(DEL) $(TEMPNAME2)
  391. $(MOVE) $(EXENAME) $(TEMPNAME2)
  392. $(TEMPNAME3) : $(TEMPNAME2)
  393. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME2)' 'OLDFPC=$(BASEDIR)/$(TEMPNAME1)' next
  394. -$(DEL) $(TEMPNAME3)
  395. $(MOVE) $(EXENAME) $(TEMPNAME3)
  396. cycle:
  397. $(MAKE) tempclean $(TEMPNAME3)
  398. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3)' 'OLDFPC=$(BASEDIR)/$(TEMPNAME2)' next
  399. $(DIFF) $(TEMPNAME3) $(EXENAME)
  400. $(MAKE) $(addsuffix _all,$(TARGET_DIRS)) 'FPC=$(BASEDIR)/$(EXENAME)'
  401. $(MAKE) echotime
  402. else
  403. ##########################
  404. # Cross Target cycle
  405. #
  406. cycle:
  407. # ppc (source native)
  408. $(MAKE) OS_TARGET=$(OS_SOURCE) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 rtlclean rtl
  409. $(MAKE) OS_TARGET=$(OS_SOURCE) EXENAME=$(TEMPNAME) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 cycleclean compiler
  410. # ppcross<ARCH> (source native)
  411. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' OS_TARGET=$(OS_SOURCE) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 rtlclean rtl
  412. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' OS_TARGET=$(OS_SOURCE) EXENAME=$(PPCROSSNAME) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 cycleclean compiler
  413. # ppc<ARCH> (target native)
  414. ifndef CROSSINSTALL
  415. $(MAKE) 'FPC=$(BASEDIR)/$(PPCROSSNAME)' rtlclean rtl
  416. $(MAKE) 'FPC=$(BASEDIR)/$(PPCROSSNAME)' cycleclean compiler
  417. endif
  418. endif
  419. else
  420. ##########################
  421. # Cross CPU cycle
  422. #
  423. # ppc1 = native
  424. # ppc2 = cross running on this platform
  425. # ppc3/ppcXXX = native (skipped for cross installation)
  426. #
  427. cycle:
  428. # ppc (source native)
  429. # Clear detected compiler binary, because it can be existing crosscompiler binary, but we need native compiler here
  430. override FPC=
  431. $(MAKE) OS_TARGET=$(OS_SOURCE) CPU_TARGET=$(CPU_SOURCE) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 rtlclean rtl
  432. $(MAKE) OS_TARGET=$(OS_SOURCE) CPU_TARGET=$(CPU_SOURCE) EXENAME=$(TEMPNAME) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 cycleclean compiler
  433. # ppcross<ARCH> (source native)
  434. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' OS_TARGET=$(OS_SOURCE) CPU_TARGET=$(CPU_SOURCE) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 rtlclean rtl
  435. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' OS_TARGET=$(OS_SOURCE) CPU_TARGET=$(CPU_SOURCE) PPC_TARGET=$(CPU_TARGET) EXENAME=$(PPCROSSNAME) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 cycleclean compiler
  436. # ppc<ARCH> (target native)
  437. ifndef CROSSINSTALL
  438. $(MAKE) 'FPC=$(BASEDIR)/$(PPCROSSNAME)' 'OPT=$(OPT) $(CROSSOPT)' rtlclean rtl
  439. $(MAKE) 'FPC=$(BASEDIR)/$(PPCROSSNAME)' 'OPT=$(OPT) $(CROSSOPT)' cycleclean compiler
  440. endif
  441. endif
  442. cycledep:
  443. $(MAKE) cycle USEDEPEND=1
  444. extcycle:
  445. $(MAKE) cycle OPT='-n -OG2p3 -glttt -CRriot -dEXTDEBUG'
  446. cvstest:
  447. $(MAKE) cycle 'LOCALOPT=-n -Se' 'RTLOPT=-n -Se'
  448. ##########################
  449. # Full cycle
  450. #
  451. # 1. build a compiler using cycle
  452. # 2. remove all .ppufiles
  453. # 3. build all supported cross compilers except the
  454. # current PPC_TARGET which was already build
  455. #
  456. full: fullcycle
  457. fullcycle:
  458. $(MAKE) cycle
  459. $(MAKE) ppuclean
  460. $(MAKE) $(filter-out $(PPC_TARGET),$(CYCLETARGETS)) 'FPC=$(BASEDIR)/$(EXENAME)'
  461. #####################################################################
  462. # Docs
  463. #####################################################################
  464. htmldocs:
  465. $(PASDOC) -p -h -o html$(PATHSEP)$(PPC_TARGET) -d fpc -d gdb -d $(PPC_TARGET) -u $(PPC_TARGET) $(PPC_TARGET)$(PATHSEP)*.pas systems$(PATHSEP)*.pas *.pas
  466. #####################################################################
  467. # Installation
  468. #####################################################################
  469. .PHONY: quickinstall install installsym
  470. MSGINSTALLDIR=$(INSTALL_BASEDIR)/msg
  471. override PPEXEFILE:=$(wildcard $(EXENAME))
  472. ifdef UNIXHier
  473. PPCCPULOCATION=$(INSTALL_BASEDIR)
  474. else
  475. PPCCPULOCATION=$(INSTALL_BINDIR)
  476. endif
  477. # This will only install the ppcXXX executable, not the message files etc.
  478. quickinstall: $(addsuffix _install,$(TARGET_DIRS))
  479. # Install ppcXXX executable, for a cross installation we install
  480. # the ppcrossXXX as ppcXXX. The target native build ppcXXX is not used
  481. # for this installation type
  482. ifneq ($(INSTALLEXEFILE),)
  483. ifdef UPXPROG
  484. -$(UPXPROG) $(INSTALLEXEFILE)
  485. endif
  486. $(MKDIR) $(PPCCPULOCATION)
  487. $(INSTALLEXE) $(INSTALLEXEFILE) $(PPCCPULOCATION)/$(INSTALLEXEFILE)
  488. endif
  489. install: quickinstall
  490. ifndef CROSSINSTALL
  491. ifdef UNIXHier
  492. $(MKDIR) $(INSTALL_BASEDIR)
  493. $(INSTALLEXE) $(COMPILERUTILSDIR)/samplecfg $(INSTALL_BASEDIR)/samplecfg
  494. endif
  495. $(MKDIR) $(MSGINSTALLDIR)
  496. $(INSTALL) $(MSGFILES) $(MSGINSTALLDIR)
  497. endif
  498. # This also installs a link from bin to the actual executable.
  499. # The .deb does that later.
  500. installsymlink: install
  501. ifneq ($(PPCCPULOCATION),$(INSTALL_BINDIR))
  502. $(MKDIR) $(INSTALL_BINDIR)
  503. ln -sf $(INSTALL_BASEDIR)/$(EXENAME) $(INSTALL_BINDIR)/$(EXENAME)
  504. endif
  505. #####################################################################
  506. # RTL
  507. #####################################################################
  508. .PHONY: rtl rtlclean rtlinstall
  509. rtl:
  510. $(MAKE) -C $(PACKAGEDIR_RTL) 'OPT=$(RTLOPT)' all
  511. rtlclean:
  512. $(MAKE) -C $(PACKAGEDIR_RTL) clean
  513. rtlinstall:
  514. $(MAKE) -C $(PACKAGEDIR_RTL) install
  515. #####################################################################
  516. # local user configurable file
  517. # in makefile.loc you can add any desired target
  518. #####################################################################
  519. localmake:=$(strip $(wildcard makefile.loc))
  520. ifdef localmake
  521. include ./$(localmake)
  522. endif