Makefile 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508
  1. #
  2. # Don't edit, this file is generated by FPCMake Version 1.1 [2002/08/01]
  3. #
  4. default: all
  5. MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx
  6. override PATH:=$(subst \,/,$(PATH))
  7. ifeq ($(findstring ;,$(PATH)),)
  8. inUnix=1
  9. SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
  10. else
  11. SEARCHPATH:=$(subst ;, ,$(PATH))
  12. endif
  13. PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
  14. ifeq ($(PWD),)
  15. PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
  16. ifeq ($(PWD),)
  17. $(error You need the GNU utils package to use this Makefile)
  18. else
  19. PWD:=$(firstword $(PWD))
  20. SRCEXEEXT=
  21. endif
  22. else
  23. PWD:=$(firstword $(PWD))
  24. SRCEXEEXT=.exe
  25. endif
  26. ifndef inUnix
  27. ifeq ($(OS),Windows_NT)
  28. inWinNT=1
  29. else
  30. ifdef OS2_SHELL
  31. inOS2=1
  32. endif
  33. endif
  34. else
  35. ifneq ($(findstring cygwin,$(MACHTYPE)),)
  36. inCygWin=1
  37. endif
  38. endif
  39. ifeq ($(OS_TARGET),freebsd)
  40. BSDhier=1
  41. endif
  42. ifeq ($(OS_TARGET),netbsd)
  43. BSDhier=1
  44. endif
  45. ifeq ($(OS_TARGET),openbsd)
  46. BSDhier=1
  47. endif
  48. ifdef inUnix
  49. BATCHEXT=.sh
  50. else
  51. ifdef inOS2
  52. BATCHEXT=.cmd
  53. else
  54. BATCHEXT=.bat
  55. endif
  56. endif
  57. ifdef inUnix
  58. PATHSEP=/
  59. else
  60. PATHSEP:=$(subst /,\,/)
  61. endif
  62. ifdef PWD
  63. BASEDIR:=$(subst \,/,$(shell $(PWD)))
  64. ifdef inCygWin
  65. ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
  66. BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
  67. BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
  68. BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
  69. endif
  70. endif
  71. else
  72. BASEDIR=.
  73. endif
  74. ifdef inOS2
  75. ifndef ECHO
  76. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  77. ifeq ($(ECHO),)
  78. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  79. ifeq ($(ECHO),)
  80. ECHO=echo
  81. else
  82. ECHO:=$(firstword $(ECHO))
  83. endif
  84. else
  85. ECHO:=$(firstword $(ECHO))
  86. endif
  87. endif
  88. export ECHO
  89. endif
  90. override DEFAULT_FPCDIR=../..
  91. ifndef FPC
  92. ifdef PP
  93. FPC=$(PP)
  94. endif
  95. endif
  96. ifndef FPC
  97. FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
  98. ifneq ($(FPCPROG),)
  99. FPCPROG:=$(firstword $(FPCPROG))
  100. FPC:=$(shell $(FPCPROG) -PB)
  101. ifneq ($(findstring Error,$(FPC)),)
  102. override FPC=ppc386
  103. endif
  104. else
  105. override FPC=ppc386
  106. endif
  107. endif
  108. override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
  109. override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
  110. ifndef FPC_VERSION
  111. FPC_VERSION:=$(shell $(FPC) -iV)
  112. endif
  113. export FPC FPC_VERSION
  114. unexport CHECKDEPEND ALLDEPENDENCIES
  115. ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
  116. COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
  117. ifndef CPU_SOURCE
  118. CPU_SOURCE:=$(word 1,$(COMPILERINFO))
  119. endif
  120. ifndef CPU_TARGET
  121. CPU_TARGET:=$(word 2,$(COMPILERINFO))
  122. endif
  123. ifndef OS_SOURCE
  124. OS_SOURCE:=$(word 3,$(COMPILERINFO))
  125. endif
  126. ifndef OS_TARGET
  127. OS_TARGET:=$(word 4,$(COMPILERINFO))
  128. endif
  129. else
  130. ifndef CPU_SOURCE
  131. CPU_SOURCE:=$(shell $(FPC) -iSP)
  132. endif
  133. ifndef CPU_TARGET
  134. CPU_TARGET:=$(shell $(FPC) -iTP)
  135. endif
  136. ifndef OS_SOURCE
  137. OS_SOURCE:=$(shell $(FPC) -iSO)
  138. endif
  139. ifndef OS_TARGET
  140. OS_TARGET:=$(shell $(FPC) -iTO)
  141. endif
  142. endif
  143. FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
  144. FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
  145. ifneq ($(FULL_TARGET),$(FULL_SOURCE))
  146. CROSSCOMPILE=1
  147. endif
  148. ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
  149. ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
  150. $(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
  151. endif
  152. endif
  153. export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
  154. ifdef FPCDIR
  155. override FPCDIR:=$(subst \,/,$(FPCDIR))
  156. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  157. override FPCDIR=wrong
  158. endif
  159. else
  160. override FPCDIR=wrong
  161. endif
  162. ifdef DEFAULT_FPCDIR
  163. ifeq ($(FPCDIR),wrong)
  164. override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
  165. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  166. override FPCDIR=wrong
  167. endif
  168. endif
  169. endif
  170. ifeq ($(FPCDIR),wrong)
  171. ifdef inUnix
  172. override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
  173. ifeq ($(wildcard $(FPCDIR)/units),)
  174. override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
  175. endif
  176. else
  177. override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
  178. override FPCDIR:=$(FPCDIR)/..
  179. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  180. override FPCDIR:=$(FPCDIR)/..
  181. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  182. override FPCDIR=c:/pp
  183. endif
  184. endif
  185. endif
  186. endif
  187. ifndef CROSSDIR
  188. CROSSDIR:=$(FPCDIR)/cross/$(FULL_TARGET)
  189. endif
  190. ifndef CROSSTARGETDIR
  191. CROSSTARGETDIR=$(CROSSDIR)/$(FULL_TARGET)
  192. endif
  193. ifdef CROSSCOMPILE
  194. UNITSDIR:=$(wildcard $(CROSSTARGETDIR)/units)
  195. ifeq ($(UNITSDIR),)
  196. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
  197. endif
  198. else
  199. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
  200. endif
  201. PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
  202. override PACKAGE_NAME=fpcompiler
  203. override PACKAGE_VERSION=1.1
  204. unexport OS_SOURCE FPC_VERSION
  205. OLDDIR=..
  206. ifdef ALPHA
  207. CPU_TARGET=alpha
  208. endif
  209. ifdef POWERPC
  210. CPU_TARGET=powerpc
  211. endif
  212. ifdef M68K
  213. CPU_TARGET=m68k
  214. endif
  215. ifdef I386
  216. CPU_TARGET=i386
  217. endif
  218. UTILSDIR=$(OLDDIR)/../utils
  219. COMPILERUTILSDIR=$(OLDDIR)/utils
  220. ifndef FPCLANG
  221. FPCLANG=e
  222. endif
  223. ifndef LOCALDEF
  224. LOCALDEF=
  225. endif
  226. ifndef LOCALOPT
  227. LOCALOPT=$(OPT)
  228. endif
  229. ifndef RTLOPTS
  230. RTLOPTS=$(OPT)
  231. endif
  232. MSGFILES=$(wildcard $(OLDDIR)/error*.msg)
  233. ifeq ($(CPU_TARGET),i386)
  234. CPUSUF=386
  235. endif
  236. ifeq ($(CPU_TARGET),alpha)
  237. CPUSUF=axp
  238. endif
  239. ifeq ($(CPU_TARGET),m68k)
  240. CPUSUF=68k
  241. endif
  242. ifeq ($(CPU_TARGET),powerpc)
  243. CPUSUF=ppc
  244. endif
  245. ifeq ($(OS_TARGET),linux)
  246. ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
  247. override LOCALDEF+=-dUNIX
  248. endif
  249. endif
  250. ifeq ($(OS_TARGET),freebsd)
  251. ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
  252. override LOCALDEF+=-dUNIX
  253. endif
  254. endif
  255. MSGFILE=$(OLDDIR)/error$(FPCLANG).msg
  256. override LOCALDEF+=-dGDB -dBROWSERLOG -dNEWCG
  257. ifeq ($(CPU_TARGET),i386)
  258. override LOCALDEF+=-dSUPPORT_MMX
  259. endif
  260. override LOCALOPT+=$(LOCALDEF)
  261. override FPCOPT:=$(LOCALOPT)
  262. override COMPILER_INCLUDEDIR+=$(OLDDIR)/$(CPU_TARGET) $(OLDDIR)
  263. override COMPILER_UNITDIR+=$(OLDDIR)/$(CPU_TARGET)
  264. override COMPILER_TARGETDIR+=.
  265. ifdef REQUIRE_UNITSDIR
  266. override UNITSDIR+=$(REQUIRE_UNITSDIR)
  267. endif
  268. ifdef REQUIRE_PACKAGESDIR
  269. override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
  270. endif
  271. ifdef ZIPINSTALL
  272. ifeq ($(OS_TARGET),linux)
  273. UNIXINSTALLDIR=1
  274. endif
  275. ifeq ($(OS_TARGET),freebsd)
  276. UNIXINSTALLDIR=1
  277. endif
  278. ifeq ($(OS_TARGET),netbsd)
  279. UNIXINSTALLDIR=1
  280. endif
  281. ifeq ($(OS_TARGET),openbsd)
  282. UNIXINSTALLDIR=1
  283. endif
  284. ifeq ($(OS_TARGET),sunos)
  285. UNIXINSTALLDIR=1
  286. endif
  287. ifeq ($(OS_TARGET),qnx)
  288. UNIXINSTALLDIR=1
  289. endif
  290. else
  291. ifeq ($(OS_SOURCE),linux)
  292. UNIXINSTALLDIR=1
  293. endif
  294. ifeq ($(OS_SOURCE),freebsd)
  295. UNIXINSTALLDIR=1
  296. endif
  297. ifeq ($(OS_SOURCE),netbsd)
  298. UNIXINSTALLDIR=1
  299. endif
  300. ifeq ($(OS_SOURCE),openbsd)
  301. UNIXINSTALLDIR=1
  302. endif
  303. ifeq ($(OS_TARGET),sunos)
  304. UNIXINSTALLDIR=1
  305. endif
  306. ifeq ($(OS_TARGET),qnx)
  307. UNIXINSTALLDIR=1
  308. endif
  309. endif
  310. ifndef INSTALL_PREFIX
  311. ifdef PREFIX
  312. INSTALL_PREFIX=$(PREFIX)
  313. endif
  314. endif
  315. ifndef INSTALL_PREFIX
  316. ifdef UNIXINSTALLDIR
  317. INSTALL_PREFIX=/usr/local
  318. else
  319. ifdef INSTALL_FPCPACKAGE
  320. INSTALL_BASEDIR:=/pp
  321. else
  322. INSTALL_BASEDIR:=/$(PACKAGE_NAME)
  323. endif
  324. endif
  325. endif
  326. export INSTALL_PREFIX
  327. ifdef INSTALL_FPCSUBDIR
  328. export INSTALL_FPCSUBDIR
  329. endif
  330. ifndef DIST_DESTDIR
  331. DIST_DESTDIR:=$(BASEDIR)
  332. endif
  333. export DIST_DESTDIR
  334. ifndef INSTALL_BASEDIR
  335. ifdef UNIXINSTALLDIR
  336. ifdef INSTALL_FPCPACKAGE
  337. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
  338. else
  339. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
  340. endif
  341. else
  342. INSTALL_BASEDIR:=$(INSTALL_PREFIX)
  343. endif
  344. endif
  345. ifndef INSTALL_BINDIR
  346. ifdef UNIXINSTALLDIR
  347. INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
  348. else
  349. INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
  350. ifdef INSTALL_FPCPACKAGE
  351. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)
  352. endif
  353. endif
  354. endif
  355. ifndef INSTALL_UNITDIR
  356. ifdef CROSSCOMPILE
  357. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/units
  358. else
  359. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(OS_TARGET)
  360. endif
  361. ifdef INSTALL_FPCPACKAGE
  362. ifdef PACKAGE_NAME
  363. INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
  364. endif
  365. endif
  366. endif
  367. ifndef INSTALL_LIBDIR
  368. ifdef UNIXINSTALLDIR
  369. INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
  370. else
  371. INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
  372. endif
  373. endif
  374. ifndef INSTALL_SOURCEDIR
  375. ifdef UNIXINSTALLDIR
  376. ifdef BSDhier
  377. SRCPREFIXDIR=share/src
  378. else
  379. SRCPREFIXDIR=src
  380. endif
  381. ifdef INSTALL_FPCPACKAGE
  382. ifdef INSTALL_FPCSUBDIR
  383. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  384. else
  385. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  386. endif
  387. else
  388. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  389. endif
  390. else
  391. ifdef INSTALL_FPCPACKAGE
  392. ifdef INSTALL_FPCSUBDIR
  393. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  394. else
  395. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
  396. endif
  397. else
  398. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
  399. endif
  400. endif
  401. endif
  402. ifndef INSTALL_DOCDIR
  403. ifdef UNIXINSTALLDIR
  404. ifdef BSDhier
  405. DOCPREFIXDIR=share/doc
  406. else
  407. DOCPREFIXDIR=doc
  408. endif
  409. ifdef INSTALL_FPCPACKAGE
  410. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  411. else
  412. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  413. endif
  414. else
  415. ifdef INSTALL_FPCPACKAGE
  416. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
  417. else
  418. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
  419. endif
  420. endif
  421. endif
  422. ifndef INSTALL_EXAMPLEDIR
  423. ifdef UNIXINSTALLDIR
  424. ifdef INSTALL_FPCPACKAGE
  425. ifdef BSDhier
  426. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  427. else
  428. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
  429. endif
  430. else
  431. ifdef BSDhier
  432. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  433. else
  434. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  435. endif
  436. endif
  437. else
  438. ifdef INSTALL_FPCPACKAGE
  439. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
  440. else
  441. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
  442. endif
  443. endif
  444. endif
  445. ifndef INSTALL_DATADIR
  446. INSTALL_DATADIR=$(INSTALL_BASEDIR)
  447. endif
  448. ifdef CROSSCOMPILE
  449. ifndef CROSSBINDIR
  450. CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(FULL_SOURCE))
  451. ifeq ($(CROSSBINDIR),)
  452. CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/bin/$(FULL_SOURCE))
  453. endif
  454. endif
  455. else
  456. CROSSBINDIR=
  457. endif
  458. LOADEREXT=.as
  459. EXEEXT=.exe
  460. PPLEXT=.ppl
  461. PPUEXT=.ppu
  462. OEXT=.o
  463. ASMEXT=.s
  464. SMARTEXT=.sl
  465. STATICLIBEXT=.a
  466. SHAREDLIBEXT=.so
  467. STATICLIBPREFIX=libp
  468. RSTEXT=.rst
  469. FPCMADE=fpcmade
  470. ifeq ($(OS_TARGET),go32v1)
  471. PPUEXT=.pp1
  472. OEXT=.o1
  473. ASMEXT=.s1
  474. SMARTEXT=.sl1
  475. STATICLIBEXT=.a1
  476. SHAREDLIBEXT=.so1
  477. STATICLIBPREFIX=
  478. FPCMADE=fpcmade.v1
  479. PACKAGESUFFIX=v1
  480. endif
  481. ifeq ($(OS_TARGET),go32v2)
  482. STATICLIBPREFIX=
  483. FPCMADE=fpcmade.dos
  484. ZIPSUFFIX=go32
  485. endif
  486. ifeq ($(OS_TARGET),linux)
  487. EXEEXT=
  488. HASSHAREDLIB=1
  489. FPCMADE=fpcmade.lnx
  490. ZIPSUFFIX=linux
  491. endif
  492. ifeq ($(OS_TARGET),freebsd)
  493. EXEEXT=
  494. HASSHAREDLIB=1
  495. FPCMADE=fpcmade.freebsd
  496. ZIPSUFFIX=freebsd
  497. endif
  498. ifeq ($(OS_TARGET),netbsd)
  499. EXEEXT=
  500. HASSHAREDLIB=1
  501. FPCMADE=fpcmade.netbsd
  502. ZIPSUFFIX=netbsd
  503. endif
  504. ifeq ($(OS_TARGET),openbsd)
  505. EXEEXT=
  506. HASSHAREDLIB=1
  507. FPCMADE=fpcmade.openbsd
  508. ZIPSUFFIX=openbsd
  509. endif
  510. ifeq ($(OS_TARGET),win32)
  511. PPUEXT=.ppw
  512. OEXT=.ow
  513. ASMEXT=.sw
  514. SMARTEXT=.slw
  515. STATICLIBEXT=.aw
  516. SHAREDLIBEXT=.dll
  517. FPCMADE=fpcmade.w32
  518. ZIPSUFFIX=w32
  519. endif
  520. ifeq ($(OS_TARGET),os2)
  521. PPUEXT=.ppo
  522. ASMEXT=.so2
  523. OEXT=.oo2
  524. AOUTEXT=.out
  525. SMARTEXT=.sl2
  526. STATICLIBPREFIX=
  527. STATICLIBEXT=.ao2
  528. SHAREDLIBEXT=.dll
  529. FPCMADE=fpcmade.os2
  530. ZIPSUFFIX=emx
  531. ECHO=echo
  532. endif
  533. ifeq ($(OS_TARGET),amiga)
  534. EXEEXT=
  535. PPUEXT=.ppu
  536. ASMEXT=.asm
  537. OEXT=.o
  538. SMARTEXT=.sl
  539. STATICLIBEXT=.a
  540. SHAREDLIBEXT=.library
  541. FPCMADE=fpcmade.amg
  542. endif
  543. ifeq ($(OS_TARGET),atari)
  544. PPUEXT=.ppu
  545. ASMEXT=.s
  546. OEXT=.o
  547. SMARTEXT=.sl
  548. STATICLIBEXT=.a
  549. EXEEXT=.ttp
  550. FPCMADE=fpcmade.ata
  551. endif
  552. ifeq ($(OS_TARGET),beos)
  553. PPUEXT=.ppu
  554. ASMEXT=.s
  555. OEXT=.o
  556. SMARTEXT=.sl
  557. STATICLIBEXT=.a
  558. EXEEXT=
  559. FPCMADE=fpcmade.be
  560. ZIPSUFFIX=be
  561. endif
  562. ifeq ($(OS_TARGET),sunos)
  563. PPUEXT=.ppu
  564. ASMEXT=.s
  565. OEXT=.o
  566. SMARTEXT=.sl
  567. STATICLIBEXT=.a
  568. EXEEXT=
  569. FPCMADE=fpcmade.sun
  570. ZIPSUFFIX=sun
  571. endif
  572. ifeq ($(OS_TARGET),qnx)
  573. PPUEXT=.ppu
  574. ASMEXT=.s
  575. OEXT=.o
  576. SMARTEXT=.sl
  577. STATICLIBEXT=.a
  578. EXEEXT=
  579. FPCMADE=fpcmade.qnx
  580. ZIPSUFFIX=qnx
  581. endif
  582. ifeq ($(OS_TARGET),netware)
  583. STATICLIBPREFIX=
  584. PPUEXT=.ppn
  585. OEXT=.on
  586. ASMEXT=.s
  587. SMARTEXT=.sl
  588. STATICLIBEXT=.a
  589. SHAREDLIBEXT=.nlm
  590. FPCMADE=fpcmade.nw
  591. ZIPSUFFIX=nw
  592. EXEEXT=.nlm
  593. endif
  594. ifndef ECHO
  595. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  596. ifeq ($(ECHO),)
  597. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  598. ifeq ($(ECHO),)
  599. ECHO=
  600. else
  601. ECHO:=$(firstword $(ECHO))
  602. endif
  603. else
  604. ECHO:=$(firstword $(ECHO))
  605. endif
  606. endif
  607. export ECHO
  608. ifndef DATE
  609. DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
  610. ifeq ($(DATE),)
  611. DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
  612. ifeq ($(DATE),)
  613. DATE=
  614. else
  615. DATE:=$(firstword $(DATE))
  616. endif
  617. else
  618. DATE:=$(firstword $(DATE))
  619. endif
  620. endif
  621. export DATE
  622. ifndef GINSTALL
  623. GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
  624. ifeq ($(GINSTALL),)
  625. GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
  626. ifeq ($(GINSTALL),)
  627. GINSTALL=
  628. else
  629. GINSTALL:=$(firstword $(GINSTALL))
  630. endif
  631. else
  632. GINSTALL:=$(firstword $(GINSTALL))
  633. endif
  634. endif
  635. export GINSTALL
  636. ifndef CPPROG
  637. CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
  638. ifeq ($(CPPROG),)
  639. CPPROG=
  640. else
  641. CPPROG:=$(firstword $(CPPROG))
  642. endif
  643. endif
  644. export CPPROG
  645. ifndef RMPROG
  646. RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
  647. ifeq ($(RMPROG),)
  648. RMPROG=
  649. else
  650. RMPROG:=$(firstword $(RMPROG))
  651. endif
  652. endif
  653. export RMPROG
  654. ifndef MVPROG
  655. MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
  656. ifeq ($(MVPROG),)
  657. MVPROG=
  658. else
  659. MVPROG:=$(firstword $(MVPROG))
  660. endif
  661. endif
  662. export MVPROG
  663. ifndef ECHOREDIR
  664. ECHOREDIR:=$(subst /,$(PATHSEP),$(ECHO))
  665. endif
  666. ifndef COPY
  667. COPY:=$(CPPROG) -fp
  668. endif
  669. ifndef COPYTREE
  670. COPYTREE:=$(CPPROG) -rfp
  671. endif
  672. ifndef MOVE
  673. MOVE:=$(MVPROG) -f
  674. endif
  675. ifndef DEL
  676. DEL:=$(RMPROG) -f
  677. endif
  678. ifndef DELTREE
  679. DELTREE:=$(RMPROG) -rf
  680. endif
  681. ifndef INSTALL
  682. ifdef inUnix
  683. INSTALL:=$(GINSTALL) -c -m 644
  684. else
  685. INSTALL:=$(COPY)
  686. endif
  687. endif
  688. ifndef INSTALLEXE
  689. ifdef inUnix
  690. INSTALLEXE:=$(GINSTALL) -c -m 755
  691. else
  692. INSTALLEXE:=$(COPY)
  693. endif
  694. endif
  695. ifndef MKDIR
  696. MKDIR:=$(GINSTALL) -m 755 -d
  697. endif
  698. export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
  699. ifndef PPUMOVE
  700. PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
  701. ifeq ($(PPUMOVE),)
  702. PPUMOVE=
  703. else
  704. PPUMOVE:=$(firstword $(PPUMOVE))
  705. endif
  706. endif
  707. export PPUMOVE
  708. ifndef FPCMAKE
  709. FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
  710. ifeq ($(FPCMAKE),)
  711. FPCMAKE=
  712. else
  713. FPCMAKE:=$(firstword $(FPCMAKE))
  714. endif
  715. endif
  716. export FPCMAKE
  717. ifndef ZIPPROG
  718. ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
  719. ifeq ($(ZIPPROG),)
  720. ZIPPROG=
  721. else
  722. ZIPPROG:=$(firstword $(ZIPPROG))
  723. endif
  724. endif
  725. export ZIPPROG
  726. ifndef TARPROG
  727. TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
  728. ifeq ($(TARPROG),)
  729. TARPROG=
  730. else
  731. TARPROG:=$(firstword $(TARPROG))
  732. endif
  733. endif
  734. export TARPROG
  735. ASNAME=as
  736. LDNAME=ld
  737. ARNAME=ar
  738. RCNAME=rc
  739. ifeq ($(OS_TARGET),win32)
  740. ASNAME=asw
  741. LDNAME=ldw
  742. ARNAME=arw
  743. endif
  744. ifndef ASPROG
  745. ifdef CROSSBINDIR
  746. ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
  747. else
  748. ASPROG=$(ASNAME)
  749. endif
  750. endif
  751. ifndef LDPROG
  752. ifdef CROSSBINDIR
  753. LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
  754. else
  755. LDPROG=$(LDNAME)
  756. endif
  757. endif
  758. ifndef RCPROG
  759. ifdef CROSSBINDIR
  760. RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
  761. else
  762. RCPROG=$(RCNAME)
  763. endif
  764. endif
  765. ifndef ARPROG
  766. ifdef CROSSBINDIR
  767. ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
  768. else
  769. ARPROG=$(ARNAME)
  770. endif
  771. endif
  772. AS=$(ASPROG)
  773. LD=$(LDPROG)
  774. RC=$(RCPROG)
  775. AR=$(ARPROG)
  776. PPAS=ppas$(BATCHEXT)
  777. ifdef inUnix
  778. LDCONFIG=ldconfig
  779. else
  780. LDCONFIG=
  781. endif
  782. ifdef DATE
  783. DATESTR:=$(shell $(DATE) +%Y%m%d)
  784. else
  785. DATESTR=
  786. endif
  787. ifndef UPXPROG
  788. ifeq ($(OS_TARGET),go32v2)
  789. UPXPROG:=1
  790. endif
  791. ifeq ($(OS_TARGET),win32)
  792. UPXPROG:=1
  793. endif
  794. ifdef UPXPROG
  795. UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
  796. ifeq ($(UPXPROG),)
  797. UPXPROG=
  798. else
  799. UPXPROG:=$(firstword $(UPXPROG))
  800. endif
  801. else
  802. UPXPROG=
  803. endif
  804. endif
  805. export UPXPROG
  806. ZIPOPT=-9
  807. ZIPEXT=.zip
  808. ifeq ($(USETAR),bz2)
  809. TAROPT=vI
  810. TAREXT=.tar.bz2
  811. else
  812. TAROPT=vz
  813. TAREXT=.tar.gz
  814. endif
  815. override REQUIRE_PACKAGES=rtl
  816. ifeq ($(OS_TARGET),linux)
  817. REQUIRE_PACKAGES_RTL=1
  818. endif
  819. ifeq ($(OS_TARGET),go32v2)
  820. REQUIRE_PACKAGES_RTL=1
  821. endif
  822. ifeq ($(OS_TARGET),win32)
  823. REQUIRE_PACKAGES_RTL=1
  824. endif
  825. ifeq ($(OS_TARGET),os2)
  826. REQUIRE_PACKAGES_RTL=1
  827. endif
  828. ifeq ($(OS_TARGET),freebsd)
  829. REQUIRE_PACKAGES_RTL=1
  830. endif
  831. ifeq ($(OS_TARGET),beos)
  832. REQUIRE_PACKAGES_RTL=1
  833. endif
  834. ifeq ($(OS_TARGET),netbsd)
  835. REQUIRE_PACKAGES_RTL=1
  836. endif
  837. ifeq ($(OS_TARGET),amiga)
  838. REQUIRE_PACKAGES_RTL=1
  839. endif
  840. ifeq ($(OS_TARGET),atari)
  841. REQUIRE_PACKAGES_RTL=1
  842. endif
  843. ifeq ($(OS_TARGET),sunos)
  844. REQUIRE_PACKAGES_RTL=1
  845. endif
  846. ifeq ($(OS_TARGET),qnx)
  847. REQUIRE_PACKAGES_RTL=1
  848. endif
  849. ifeq ($(OS_TARGET),netware)
  850. REQUIRE_PACKAGES_RTL=1
  851. endif
  852. ifeq ($(OS_TARGET),openbsd)
  853. REQUIRE_PACKAGES_RTL=1
  854. endif
  855. ifeq ($(OS_TARGET),wdosx)
  856. REQUIRE_PACKAGES_RTL=1
  857. endif
  858. ifdef REQUIRE_PACKAGES_RTL
  859. PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
  860. ifneq ($(PACKAGEDIR_RTL),)
  861. ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
  862. UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
  863. else
  864. UNITDIR_RTL=$(PACKAGEDIR_RTL)
  865. endif
  866. ifdef CHECKDEPEND
  867. $(PACKAGEDIR_RTL)/$(FPCMADE):
  868. $(MAKE) -C $(PACKAGEDIR_RTL) $(FPCMADE)
  869. override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
  870. endif
  871. else
  872. PACKAGEDIR_RTL=
  873. UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
  874. ifneq ($(UNITDIR_RTL),)
  875. UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
  876. else
  877. UNITDIR_RTL=
  878. endif
  879. endif
  880. ifdef UNITDIR_RTL
  881. override COMPILER_UNITDIR+=$(UNITDIR_RTL)
  882. endif
  883. endif
  884. ifndef NOCPUDEF
  885. override FPCOPTDEF=$(CPU_TARGET)
  886. endif
  887. ifneq ($(OS_TARGET),$(OS_SOURCE))
  888. override FPCOPT+=-T$(OS_TARGET)
  889. endif
  890. ifeq ($(OS_SOURCE),openbsd)
  891. override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
  892. endif
  893. ifdef UNITDIR
  894. override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
  895. endif
  896. ifdef LIBDIR
  897. override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
  898. endif
  899. ifdef OBJDIR
  900. override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
  901. endif
  902. ifdef INCDIR
  903. override FPCOPT+=$(addprefix -Fi,$(INCDIR))
  904. endif
  905. ifdef LINKSMART
  906. override FPCOPT+=-XX
  907. endif
  908. ifdef CREATESMART
  909. override FPCOPT+=-CX
  910. endif
  911. ifdef DEBUG
  912. override FPCOPT+=-gl
  913. override FPCOPTDEF+=DEBUG
  914. endif
  915. ifdef RELEASE
  916. ifeq ($(CPU_TARGET),i386)
  917. FPCCPUOPT:=-OG2p3
  918. else
  919. FPCCPUOPT:=
  920. endif
  921. override FPCOPT+=-Xs $(FPCCPUOPT) -n
  922. override FPCOPTDEF+=RELEASE
  923. endif
  924. ifdef STRIP
  925. override FPCOPT+=-Xs
  926. endif
  927. ifdef OPTIMIZE
  928. ifeq ($(CPU_TARGET),i386)
  929. override FPCOPT+=-OG2p3
  930. endif
  931. endif
  932. ifdef VERBOSE
  933. override FPCOPT+=-vwni
  934. endif
  935. ifdef COMPILER_OPTIONS
  936. override FPCOPT+=$(COMPILER_OPTIONS)
  937. endif
  938. ifdef COMPILER_UNITDIR
  939. override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
  940. endif
  941. ifdef COMPILER_LIBRARYDIR
  942. override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
  943. endif
  944. ifdef COMPILER_OBJECTDIR
  945. override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
  946. endif
  947. ifdef COMPILER_INCLUDEDIR
  948. override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
  949. endif
  950. ifdef CROSSBINDIR
  951. override FPCOPT+=-FD$(CROSSBINDIR)
  952. endif
  953. ifdef COMPILER_TARGETDIR
  954. override FPCOPT+=-FE$(COMPILER_TARGETDIR)
  955. ifeq ($(COMPILER_TARGETDIR),.)
  956. override TARGETDIRPREFIX=
  957. else
  958. override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
  959. endif
  960. endif
  961. ifdef COMPILER_UNITTARGETDIR
  962. override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
  963. ifeq ($(COMPILER_UNITTARGETDIR),.)
  964. override UNITTARGETDIRPREFIX=
  965. else
  966. override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
  967. endif
  968. else
  969. ifdef COMPILER_TARGETDIR
  970. override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
  971. override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
  972. endif
  973. endif
  974. ifdef OPT
  975. override FPCOPT+=$(OPT)
  976. endif
  977. ifdef FPCOPTDEF
  978. override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
  979. endif
  980. ifdef CFGFILE
  981. override FPCOPT+=@$(CFGFILE)
  982. endif
  983. ifdef USEENV
  984. override FPCEXTCMD:=$(FPCOPT)
  985. override FPCOPT:=!FPCEXTCMD
  986. export FPCEXTCMD
  987. endif
  988. override COMPILER:=$(FPC) $(FPCOPT)
  989. ifeq (,$(findstring -s ,$(COMPILER)))
  990. EXECPPAS=
  991. else
  992. ifeq ($(OS_SOURCE),$(OS_TARGET))
  993. EXECPPAS:=@$(PPAS)
  994. endif
  995. endif
  996. ifdef TARGET_RSTS
  997. override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
  998. override CLEANRSTFILES+=$(RSTFILES)
  999. endif
  1000. .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
  1001. ifdef INSTALL_UNITS
  1002. override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
  1003. endif
  1004. ifdef INSTALL_BUILDUNIT
  1005. override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
  1006. endif
  1007. ifdef INSTALLPPUFILES
  1008. override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
  1009. override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPUFILES))
  1010. override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPULINKFILES)))
  1011. override INSTALL_CREATEPACKAGEFPC=1
  1012. endif
  1013. ifdef INSTALLEXEFILES
  1014. override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
  1015. endif
  1016. fpc_install: all $(INSTALLTARGET)
  1017. ifdef INSTALLEXEFILES
  1018. $(MKDIR) $(INSTALL_BINDIR)
  1019. ifdef UPXPROG
  1020. -$(UPXPROG) $(INSTALLEXEFILES)
  1021. endif
  1022. $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
  1023. endif
  1024. ifdef INSTALL_CREATEPACKAGEFPC
  1025. ifdef FPCMAKE
  1026. ifdef PACKAGE_VERSION
  1027. ifneq ($(wildcard Makefile.fpc),)
  1028. $(FPCMAKE) -p -T$(OS_TARGET) Makefile.fpc
  1029. $(MKDIR) $(INSTALL_UNITDIR)
  1030. $(INSTALL) Package.fpc $(INSTALL_UNITDIR)
  1031. endif
  1032. endif
  1033. endif
  1034. endif
  1035. ifdef INSTALLPPUFILES
  1036. $(MKDIR) $(INSTALL_UNITDIR)
  1037. $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
  1038. ifneq ($(INSTALLPPULINKFILES),)
  1039. $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
  1040. endif
  1041. ifneq ($(wildcard $(LIB_FULLNAME)),)
  1042. $(MKDIR) $(INSTALL_LIBDIR)
  1043. $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
  1044. ifdef inUnix
  1045. ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
  1046. endif
  1047. endif
  1048. endif
  1049. ifdef INSTALL_FILES
  1050. $(MKDIR) $(INSTALL_DATADIR)
  1051. $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
  1052. endif
  1053. fpc_sourceinstall: distclean
  1054. $(MKDIR) $(INSTALL_SOURCEDIR)
  1055. $(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
  1056. fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
  1057. ifdef HASEXAMPLES
  1058. $(MKDIR) $(INSTALL_EXAMPLEDIR)
  1059. endif
  1060. ifdef EXAMPLESOURCEFILES
  1061. $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
  1062. endif
  1063. ifdef TARGET_EXAMPLEDIRS
  1064. $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
  1065. endif
  1066. .PHONY: fpc_distinstall
  1067. fpc_distinstall: install exampleinstall
  1068. .PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall
  1069. ifndef PACKDIR
  1070. ifndef inUnix
  1071. PACKDIR=$(BASEDIR)/../fpc-pack
  1072. else
  1073. PACKDIR=/tmp/fpc-pack
  1074. endif
  1075. endif
  1076. ifndef ZIPNAME
  1077. ifdef DIST_ZIPNAME
  1078. ZIPNAME=$(DIST_ZIPNAME)
  1079. else
  1080. ZIPNAME=$(ZIPPREFIX)$(PACKAGE_NAME)$(ZIPSUFFIX)
  1081. endif
  1082. endif
  1083. ifndef ZIPTARGET
  1084. ifdef DIST_ZIPTARGET
  1085. ZIPTARGET=DIST_ZIPTARGET
  1086. else
  1087. ZIPTARGET=install
  1088. endif
  1089. endif
  1090. ifndef USEZIP
  1091. ifdef inUnix
  1092. USETAR=1
  1093. endif
  1094. endif
  1095. ifndef inUnix
  1096. USEZIPWRAPPER=1
  1097. endif
  1098. ifdef USEZIPWRAPPER
  1099. ZIPPATHSEP=$(PATHSEP)
  1100. ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(BATCHEXT))
  1101. else
  1102. ZIPPATHSEP=/
  1103. endif
  1104. ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
  1105. ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
  1106. ifdef USETAR
  1107. ZIPDESTFILE:=$(DIST_DESTDIR)/$(ZIPNAME)$(TAREXT)
  1108. ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *
  1109. else
  1110. ZIPDESTFILE:=$(DIST_DESTDIR)/$(ZIPNAME)$(ZIPEXT)
  1111. ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
  1112. endif
  1113. fpc_zipinstall:
  1114. $(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1
  1115. $(MKDIR) $(DIST_DESTDIR)
  1116. $(DEL) $(ZIPDESTFILE)
  1117. ifdef USEZIPWRAPPER
  1118. ifneq ($(ECHOREDIR),echo)
  1119. $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER)
  1120. $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)
  1121. $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER)
  1122. else
  1123. echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)
  1124. echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)
  1125. echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)
  1126. endif
  1127. ifdef inUnix
  1128. /bin/sh $(ZIPWRAPPER)
  1129. else
  1130. $(ZIPWRAPPER)
  1131. endif
  1132. $(DEL) $(ZIPWRAPPER)
  1133. else
  1134. $(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)
  1135. endif
  1136. $(DELTREE) $(PACKDIR)
  1137. fpc_zipsourceinstall:
  1138. $(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=src
  1139. fpc_zipexampleinstall:
  1140. ifdef HASEXAMPLES
  1141. $(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=exm
  1142. endif
  1143. fpc_zipdistinstall:
  1144. $(MAKE) fpc_zipinstall ZIPTARGET=distinstall
  1145. .PHONY: fpc_clean fpc_cleanall fpc_distclean
  1146. ifdef EXEFILES
  1147. override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
  1148. endif
  1149. ifdef CLEAN_UNITS
  1150. override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
  1151. endif
  1152. ifdef CLEANPPUFILES
  1153. override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
  1154. override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
  1155. override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
  1156. endif
  1157. fpc_clean: $(CLEANTARGET)
  1158. ifdef CLEANEXEFILES
  1159. -$(DEL) $(CLEANEXEFILES)
  1160. endif
  1161. ifdef CLEANPPUFILES
  1162. -$(DEL) $(CLEANPPUFILES)
  1163. endif
  1164. ifneq ($(CLEANPPULINKFILES),)
  1165. -$(DEL) $(CLEANPPULINKFILES)
  1166. endif
  1167. ifdef CLEANRSTFILES
  1168. -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
  1169. endif
  1170. ifdef CLEAN_FILES
  1171. -$(DEL) $(CLEAN_FILES)
  1172. endif
  1173. ifdef LIB_NAME
  1174. -$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
  1175. endif
  1176. -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  1177. fpc_distclean: clean
  1178. ifdef COMPILER_UNITTARGETDIR
  1179. TARGETDIRCLEAN=fpc_clean
  1180. endif
  1181. fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
  1182. ifdef CLEANEXEFILES
  1183. -$(DEL) $(CLEANEXEFILES)
  1184. endif
  1185. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  1186. -$(DELTREE) *$(SMARTEXT)
  1187. -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  1188. ifdef AOUTEXT
  1189. -$(DEL) *$(AOUTEXT)
  1190. endif
  1191. .PHONY: fpc_baseinfo
  1192. override INFORULES+=fpc_baseinfo
  1193. fpc_baseinfo:
  1194. @$(ECHO)
  1195. @$(ECHO) == Package info ==
  1196. @$(ECHO) Package Name..... $(PACKAGE_NAME)
  1197. @$(ECHO) Package Version.. $(PACKAGE_VERSION)
  1198. @$(ECHO)
  1199. @$(ECHO) == Configuration info ==
  1200. @$(ECHO)
  1201. @$(ECHO) FPC.......... $(FPC)
  1202. @$(ECHO) FPC Version.. $(FPC_VERSION)
  1203. @$(ECHO) Source CPU... $(CPU_SOURCE)
  1204. @$(ECHO) Target CPU... $(CPU_TARGET)
  1205. @$(ECHO) Source OS.... $(OS_SOURCE)
  1206. @$(ECHO) Target OS.... $(OS_TARGET)
  1207. @$(ECHO) Full Source.. $(FULL_SOURCE)
  1208. @$(ECHO) Full Target.. $(FULL_TARGET)
  1209. @$(ECHO)
  1210. @$(ECHO) == Directory info ==
  1211. @$(ECHO)
  1212. @$(ECHO) Required pkgs... $(REQUIRE_PACKAGES)
  1213. @$(ECHO)
  1214. @$(ECHO) Basedir......... $(BASEDIR)
  1215. @$(ECHO) FPCDir.......... $(FPCDIR)
  1216. @$(ECHO) CrossBinDir..... $(CROSSBINDIR)
  1217. @$(ECHO) UnitsDir........ $(UNITSDIR)
  1218. @$(ECHO) PackagesDir..... $(PACKAGESDIR)
  1219. @$(ECHO)
  1220. @$(ECHO) GCC library..... $(GCCLIBDIR)
  1221. @$(ECHO) Other library... $(OTHERLIBDIR)
  1222. @$(ECHO)
  1223. @$(ECHO) == Tools info ==
  1224. @$(ECHO)
  1225. @$(ECHO) As........ $(AS)
  1226. @$(ECHO) Ld........ $(LD)
  1227. @$(ECHO) Ar........ $(AR)
  1228. @$(ECHO) Rc........ $(RC)
  1229. @$(ECHO)
  1230. @$(ECHO) Mv........ $(MVPROG)
  1231. @$(ECHO) Cp........ $(CPPROG)
  1232. @$(ECHO) Rm........ $(RMPROG)
  1233. @$(ECHO) GInstall.. $(GINSTALL)
  1234. @$(ECHO) Echo...... $(ECHO)
  1235. @$(ECHO) Date...... $(DATE)
  1236. @$(ECHO) FPCMake... $(FPCMAKE)
  1237. @$(ECHO) PPUMove... $(PPUMOVE)
  1238. @$(ECHO) Upx....... $(UPXPROG)
  1239. @$(ECHO) Zip....... $(ZIPPROG)
  1240. @$(ECHO)
  1241. @$(ECHO) == Object info ==
  1242. @$(ECHO)
  1243. @$(ECHO) Target Loaders........ $(TARGET_LOADERS)
  1244. @$(ECHO) Target Units.......... $(TARGET_UNITS)
  1245. @$(ECHO) Target Implicit Units. $(TARGET_IMPLICITUNITS)
  1246. @$(ECHO) Target Programs....... $(TARGET_PROGRAMS)
  1247. @$(ECHO) Target Dirs........... $(TARGET_DIRS)
  1248. @$(ECHO) Target Examples....... $(TARGET_EXAMPLES)
  1249. @$(ECHO) Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
  1250. @$(ECHO)
  1251. @$(ECHO) Clean Units......... $(CLEAN_UNITS)
  1252. @$(ECHO) Clean Files......... $(CLEAN_FILES)
  1253. @$(ECHO)
  1254. @$(ECHO) Install Units....... $(INSTALL_UNITS)
  1255. @$(ECHO) Install Files....... $(INSTALL_FILES)
  1256. @$(ECHO)
  1257. @$(ECHO) == Install info ==
  1258. @$(ECHO)
  1259. @$(ECHO) DateStr.............. $(DATESTR)
  1260. @$(ECHO) ZipPrefix............ $(ZIPPREFIX)
  1261. @$(ECHO) ZipSuffix............ $(ZIPSUFFIX)
  1262. @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE)
  1263. @$(ECHO)
  1264. @$(ECHO) Install base dir..... $(INSTALL_BASEDIR)
  1265. @$(ECHO) Install binary dir... $(INSTALL_BINDIR)
  1266. @$(ECHO) Install library dir.. $(INSTALL_LIBDIR)
  1267. @$(ECHO) Install units dir.... $(INSTALL_UNITDIR)
  1268. @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR)
  1269. @$(ECHO) Install doc dir...... $(INSTALL_DOCDIR)
  1270. @$(ECHO) Install example dir.. $(INSTALL_EXAMPLEDIR)
  1271. @$(ECHO) Install data dir..... $(INSTALL_DATADIR)
  1272. @$(ECHO)
  1273. @$(ECHO) Dist destination dir. $(DIST_DESTDIR)
  1274. @$(ECHO) Dist zip name........ $(DIST_ZIPNAME)
  1275. @$(ECHO)
  1276. .PHONY: fpc_info
  1277. fpc_info: $(INFORULES)
  1278. .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
  1279. fpc_makefile_dirs
  1280. fpc_makefile:
  1281. $(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
  1282. fpc_makefile_sub1:
  1283. ifdef TARGET_DIRS
  1284. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
  1285. endif
  1286. ifdef TARGET_EXAMPLEDIRS
  1287. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
  1288. endif
  1289. fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
  1290. fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
  1291. fpc_makefiles: fpc_makefile fpc_makefile_dirs
  1292. ifndef DIFF
  1293. DIFF:=$(strip $(wildcard $(addsuffix /diff$(SRCEXEEXT),$(SEARCHPATH))))
  1294. ifeq ($(DIFF),)
  1295. DIFF=
  1296. else
  1297. DIFF:=$(firstword $(DIFF))
  1298. endif
  1299. endif
  1300. export DIFF
  1301. ifndef CMP
  1302. CMP:=$(strip $(wildcard $(addsuffix /cmp$(SRCEXEEXT),$(SEARCHPATH))))
  1303. ifeq ($(CMP),)
  1304. CMP=
  1305. else
  1306. CMP:=$(firstword $(CMP))
  1307. endif
  1308. endif
  1309. export CMP
  1310. debug:
  1311. smart:
  1312. release:
  1313. examples:
  1314. shared:
  1315. sourceinstall: fpc_sourceinstall
  1316. exampleinstall: fpc_exampleinstall
  1317. distinstall: fpc_distinstall
  1318. zipinstall: fpc_zipinstall
  1319. zipsourceinstall: fpc_zipsourceinstall
  1320. zipexampleinstall: fpc_zipexampleinstall
  1321. zipdistinstall: fpc_zipdistinstall
  1322. cleanall:
  1323. info: fpc_info
  1324. makefiles: fpc_makefiles
  1325. .PHONY: debug smart release examples shared sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall cleanall info makefiles
  1326. ifneq ($(wildcard fpcmake.loc),)
  1327. include fpcmake.loc
  1328. endif
  1329. ifeq ($(OS_TARGET),win32)
  1330. ifdef CMP
  1331. override DIFF:=$(CMP) -i138
  1332. endif
  1333. override COMPILER+=-XX
  1334. endif
  1335. ifdef DIFF
  1336. ifdef OLDFPC
  1337. DIFFRESULT:=$(shell $(DIFF) $(OLDFPC) $(FPC))
  1338. else
  1339. DIFFRESULT=Not equal
  1340. endif
  1341. else
  1342. DIFFRESULT=No diff program
  1343. endif
  1344. FPCEXE=fpc$(EXEEXT)
  1345. PPEXENAME=pp$(EXEEXT)
  1346. EXENAME=ppc$(CPUSUF)$(EXEEXT)
  1347. TEMPNAME=ppc$(EXEEXT)
  1348. TEMPNAME1=ppc1$(EXEEXT)
  1349. TEMPNAME2=ppc2$(EXEEXT)
  1350. TEMPNAME3=ppc3$(EXEEXT)
  1351. MAKEDEP=ppdep$(EXEEXT)
  1352. MSG2INC=msg2inc$(EXEEXT)
  1353. alpha:
  1354. $(MAKE) ALPHA=1 all
  1355. i386:
  1356. $(MAKE) I386=1 all
  1357. m68k:
  1358. $(MAKE) M68K=1 all
  1359. powerpc:
  1360. $(MAKE) POWERPC=1 all
  1361. all: $(EXENAME)
  1362. fpcexe: $(FPCEXE)
  1363. ifeq ($(MAKELEVEL),0)
  1364. ifndef STARTTIME
  1365. ifdef DATE
  1366. STARTTIME:=$(shell $(DATE) +%T)
  1367. else
  1368. STARTTIME:=unknown
  1369. endif
  1370. endif
  1371. endif
  1372. export STARTTIME
  1373. ifdef DATE
  1374. ENDTIME=$(shell $(DATE) +%T)
  1375. else
  1376. ENDTIME:=unknown
  1377. endif
  1378. echotime:
  1379. @echo Start $(STARTTIME) now $(ENDTIME)
  1380. ifndef DIFFRESULT
  1381. next :
  1382. @echo $(OLDFPC) and $(FPC) are equal
  1383. $(COPY) $(FPC) $(EXENAME)
  1384. else
  1385. next :
  1386. $(MAKE) execlean
  1387. $(MAKE) -C $(UNITDIR_RTL) clean
  1388. $(MAKE) -C $(UNITDIR_RTL) 'FPC=$(FPC)' 'OPT=$(RTLOPTS)'
  1389. $(MAKE) clean
  1390. $(MAKE) $(EXENAME)
  1391. $(MAKE) echotime
  1392. endif
  1393. clean : execlean fpc_cleanall
  1394. ppuclean:
  1395. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  1396. execlean :
  1397. -$(DEL) fpc$(EXEEXT) ppc386$(EXEEXT) ppcaxp$(EXEEXT) ppc68k$(EXEEXT) ppcppc$(EXEEXT)
  1398. distclean: clean
  1399. -$(DEL) $(TEMPNAME) $(TEMPNAME1) $(TEMPNAME2) $(TEMPNAME3) $(MSG2INC)
  1400. $(MAKEDEP): $(UTILSDIR)/ppdep.pp
  1401. $(COMPILER) $(UTILSDIR)/ppdep.pp
  1402. $(COPY) $(UTILSDIR)/$(MAKEDEP) $(MAKEDEP)
  1403. dependencies : $(MAKEDEP)
  1404. $(MAKEDEP) pp.pas $(FPCOPTDEF) $(LOCALDEF) '-F$$(COMPILER) $$(LOCALOPT)' > depend
  1405. ifdef USEDEPEND
  1406. include depend
  1407. endif
  1408. $(MSG2INC): $(COMPILERUTILSDIR)/msg2inc.pp
  1409. $(COMPILER) -FE. $(COMPILERUTILSDIR)/msg2inc.pp
  1410. msgtxt.inc: $(MSGFILE)
  1411. $(MAKE) $(MSG2INC)
  1412. $(MSG2INC) $(MSGFILE) msg msg
  1413. msg: msgtxt.inc
  1414. ifndef COMPLETE
  1415. $(EXENAME) : $(wildcard *.pas) $(wildcard *.inc) msg
  1416. $(COMPILER) pp.pas
  1417. $(EXECPPAS)
  1418. $(MOVE) $(PPEXENAME) $(EXENAME)
  1419. else
  1420. $(EXENAME) : $(wildcard *.pas) $(wildcard *.inc) msg
  1421. $(COMPILER) pp.pas
  1422. $(EXECPPAS)
  1423. $(COMPILER) pp.pas
  1424. $(EXECPPAS)
  1425. $(COMPILER) pp.pas
  1426. $(EXECPPAS)
  1427. $(MOVE) $(PPEXENAME) $(EXENAME)
  1428. endif
  1429. tokens.dat : $(wildcard *.pas) $(wildcard *.inc)
  1430. $(COMPILER) tokendat.pas
  1431. ./tokendat
  1432. remake: $(EXENAME)
  1433. $(MOVE) $(EXENAME) $(TEMPNAME)
  1434. $(MAKE) execlean
  1435. $(MAKE) -C $(UNITDIR_RTL) clean
  1436. $(MAKE) clean
  1437. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' all
  1438. remake3: $(TEMPNAME3)
  1439. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3)' 'OLDFPC=$(BASEDIR)/$(TEMPNAME2)' next
  1440. $(DIFF) $(TEMPNAME3) $(EXENAME)
  1441. $(TEMPNAME1) : $(EXENAME)
  1442. -$(DEL) $(TEMPNAME1)
  1443. $(MOVE) $(EXENAME) $(TEMPNAME1)
  1444. $(TEMPNAME2) : $(TEMPNAME1)
  1445. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME1)' 'OLDFPC=' next
  1446. -$(DEL) $(TEMPNAME2)
  1447. $(MOVE) $(EXENAME) $(TEMPNAME2)
  1448. $(TEMPNAME3) : $(TEMPNAME2)
  1449. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME2)' 'OLDFPC=$(BASEDIR)/$(TEMPNAME1)' next
  1450. -$(DEL) $(TEMPNAME3)
  1451. $(MOVE) $(EXENAME) $(TEMPNAME3)
  1452. cycle:
  1453. $(MAKE) clean
  1454. $(MAKE) -C $(UNITDIR_RTL) clean
  1455. $(MAKE) -C $(UNITDIR_RTL) 'OPT=$(RTLOPTS)' all
  1456. $(MAKE) remake3
  1457. $(MAKE) echotime
  1458. cycledep:
  1459. $(MAKE) cycle USEDEPEND=1
  1460. cvstest:
  1461. $(MAKE) cycle 'LOCALOPT=-n -Se' 'RTLOPTS=-n -Se'
  1462. .PHONY: quickinstall install installsym
  1463. MSGINSTALLDIR=$(INSTALL_BASEDIR)/msg
  1464. override FPCEXEFILE:=$(wildcard $(FPCEXE))
  1465. override PPEXEFILE:=$(wildcard $(EXENAME))
  1466. quickinstall:
  1467. ifneq ($(FPCEXEFILE),)
  1468. ifdef UPXPROG
  1469. -$(UPXPROG) $(FPCEXEFILE)
  1470. endif
  1471. $(MKDIR) $(INSTALL_BINDIR)
  1472. $(INSTALLEXE) $(FPCEXEFILE) $(INSTALL_BINDIR)
  1473. endif
  1474. ifneq ($(PPEXEFILE),)
  1475. ifdef UPXPROG
  1476. -$(UPXPROG) $(EXENAME)
  1477. endif
  1478. ifdef UNIXINSTALLDIR
  1479. $(MKDIR) $(INSTALL_BASEDIR)
  1480. $(INSTALLEXE) $(EXENAME) $(INSTALL_BASEDIR)
  1481. else
  1482. $(MKDIR) $(INSTALL_BINDIR)
  1483. $(INSTALLEXE) $(EXENAME) $(INSTALL_BINDIR)
  1484. endif
  1485. endif
  1486. install: quickinstall
  1487. ifdef UNIXINSTALLDIR
  1488. $(MKDIR) $(INSTALL_BASEDIR)
  1489. $(INSTALLEXE) $(COMPILERUTILSDIR)/samplecfg $(INSTALL_BASEDIR)/samplecfg
  1490. endif
  1491. $(MKDIR) $(MSGINSTALLDIR)
  1492. $(INSTALL) $(MSGFILES) $(MSGINSTALLDIR)
  1493. installsymlink: install
  1494. ifdef UNIXINSTALLDIR
  1495. $(MKDIR) $(INSTALL_BINDIR)
  1496. ln -sf $(INSTALL_BASEDIR)/ppc386 $(INSTALL_BINDIR)/ppc386
  1497. endif
  1498. .PHONY: rtl rtlclean rtlinstall
  1499. rtl:
  1500. $(MAKE) -C $(UNITDIR_RTL) all
  1501. rtlclean:
  1502. $(MAKE) -C $(UNITDIR_RTL) clean
  1503. rtlinstall:
  1504. $(MAKE) -C $(UNITDIR_RTL) install
  1505. localmake:=$(strip $(wildcard makefile.loc))
  1506. ifdef localmake
  1507. include ./$(localmake)
  1508. endif