Makefile 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001
  1. #
  2. # Don't edit, this file is generated by FPCMake Version 1.1 [2004/09/04]
  3. #
  4. default: all
  5. MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx palmos macos darwin emx watcom morphos netwlibc
  6. BSDs = freebsd netbsd openbsd darwin
  7. UNIXs = linux $(BSDs) sunos qnx
  8. FORCE:
  9. .PHONY: FORCE
  10. override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
  11. ifneq ($(findstring darwin,$(OSTYPE)),)
  12. inUnix=1 #darwin
  13. SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
  14. else
  15. ifeq ($(findstring ;,$(PATH)),)
  16. inUnix=1
  17. SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
  18. else
  19. SEARCHPATH:=$(subst ;, ,$(PATH))
  20. endif
  21. endif
  22. SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
  23. PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
  24. ifeq ($(PWD),)
  25. PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
  26. ifeq ($(PWD),)
  27. $(error You need the GNU utils package to use this Makefile)
  28. else
  29. PWD:=$(firstword $(PWD))
  30. SRCEXEEXT=
  31. endif
  32. else
  33. PWD:=$(firstword $(PWD))
  34. SRCEXEEXT=.exe
  35. endif
  36. ifndef inUnix
  37. ifeq ($(OS),Windows_NT)
  38. inWinNT=1
  39. else
  40. ifdef OS2_SHELL
  41. inOS2=1
  42. endif
  43. endif
  44. else
  45. ifneq ($(findstring cygdrive,$(PATH)),)
  46. inCygWin=1
  47. endif
  48. endif
  49. ifdef inUnix
  50. SRCBATCHEXT=.sh
  51. else
  52. ifdef inOS2
  53. SRCBATCHEXT=.cmd
  54. else
  55. SRCBATCHEXT=.bat
  56. endif
  57. endif
  58. ifdef inUnix
  59. PATHSEP=/
  60. else
  61. PATHSEP:=$(subst /,\,/)
  62. ifdef inCygWin
  63. PATHSEP=/
  64. endif
  65. endif
  66. ifdef PWD
  67. BASEDIR:=$(subst \,/,$(shell $(PWD)))
  68. ifdef inCygWin
  69. ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
  70. BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
  71. BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
  72. BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
  73. endif
  74. endif
  75. else
  76. BASEDIR=.
  77. endif
  78. ifdef inOS2
  79. ifndef ECHO
  80. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  81. ifeq ($(ECHO),)
  82. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  83. ifeq ($(ECHO),)
  84. ECHO=echo
  85. else
  86. ECHO:=$(firstword $(ECHO))
  87. endif
  88. else
  89. ECHO:=$(firstword $(ECHO))
  90. endif
  91. endif
  92. export ECHO
  93. endif
  94. override DEFAULT_FPCDIR=..
  95. ifndef FPC
  96. ifdef PP
  97. FPC=$(PP)
  98. endif
  99. endif
  100. ifndef FPC
  101. FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
  102. ifneq ($(FPCPROG),)
  103. FPCPROG:=$(firstword $(FPCPROG))
  104. FPC:=$(shell $(FPCPROG) -PB)
  105. ifneq ($(findstring Error,$(FPC)),)
  106. override FPC=ppc386
  107. endif
  108. else
  109. override FPC=ppc386
  110. endif
  111. endif
  112. override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
  113. override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
  114. ifndef FPC_VERSION
  115. FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
  116. FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
  117. endif
  118. export FPC FPC_VERSION FPC_COMPILERINFO
  119. unexport CHECKDEPEND ALLDEPENDENCIES
  120. ifndef CPU_TARGET
  121. ifdef CPU_TARGET_DEFAULT
  122. CPU_TARGET=$(CPU_TARGET_DEFAULT)
  123. endif
  124. endif
  125. ifndef OS_TARGET
  126. ifdef OS_TARGET_DEFAULT
  127. OS_TARGET=$(OS_TARGET_DEFAULT)
  128. endif
  129. endif
  130. ifneq ($(words $(FPC_COMPILERINFO)),5)
  131. FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
  132. FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
  133. FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
  134. FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
  135. endif
  136. ifndef CPU_SOURCE
  137. CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
  138. endif
  139. ifndef CPU_TARGET
  140. CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
  141. endif
  142. ifndef OS_SOURCE
  143. OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
  144. endif
  145. ifndef OS_TARGET
  146. OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
  147. endif
  148. FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
  149. FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
  150. ifneq ($(FULL_TARGET),$(FULL_SOURCE))
  151. CROSSCOMPILE=1
  152. endif
  153. ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
  154. ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
  155. $(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
  156. endif
  157. endif
  158. ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
  159. BSDhier=1
  160. endif
  161. ifeq ($(OS_TARGET),linux)
  162. linuxHier=1
  163. endif
  164. export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
  165. ifdef FPCDIR
  166. override FPCDIR:=$(subst \,/,$(FPCDIR))
  167. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  168. override FPCDIR=wrong
  169. endif
  170. else
  171. override FPCDIR=wrong
  172. endif
  173. ifdef DEFAULT_FPCDIR
  174. ifeq ($(FPCDIR),wrong)
  175. override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
  176. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  177. override FPCDIR=wrong
  178. endif
  179. endif
  180. endif
  181. ifeq ($(FPCDIR),wrong)
  182. ifdef inUnix
  183. override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
  184. ifeq ($(wildcard $(FPCDIR)/units),)
  185. override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
  186. endif
  187. else
  188. override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
  189. override FPCDIR:=$(FPCDIR)/..
  190. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  191. override FPCDIR:=$(FPCDIR)/..
  192. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  193. override FPCDIR:=$(BASEDIR)
  194. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  195. override FPCDIR=c:/pp
  196. endif
  197. endif
  198. endif
  199. endif
  200. endif
  201. ifndef CROSSDIR
  202. CROSSDIR:=$(FPCDIR)/cross/$(FULL_TARGET)
  203. endif
  204. ifndef CROSSTARGETDIR
  205. CROSSTARGETDIR=$(CROSSDIR)/$(FULL_TARGET)
  206. endif
  207. ifdef CROSSCOMPILE
  208. UNITSDIR:=$(wildcard $(CROSSTARGETDIR)/units)
  209. ifeq ($(UNITSDIR),)
  210. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
  211. endif
  212. else
  213. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
  214. endif
  215. PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
  216. override PACKAGE_NAME=compiler
  217. override PACKAGE_VERSION=1.9.4
  218. unexport FPC_VERSION FPC_COMPILERINFO
  219. CYCLETARGETS=i386 powerpc sparc arm
  220. ifdef ALPHA
  221. PPC_TARGET=alpha
  222. endif
  223. ifdef POWERPC
  224. PPC_TARGET=powerpc
  225. endif
  226. ifdef SPARC
  227. PPC_TARGET=sparc
  228. endif
  229. ifdef M68K
  230. PPC_TARGET=m68k
  231. endif
  232. ifdef I386
  233. PPC_TARGET=i386
  234. endif
  235. ifdef X86_64
  236. PPC_TARGET=x86_64
  237. endif
  238. ifdef ARM
  239. PPC_TARGET=arm
  240. endif
  241. ifndef PPC_TARGET
  242. PPC_TARGET=$(CPU_TARGET)
  243. endif
  244. ifndef PPC_OS
  245. PPC_OS=$(OS_TARGET)
  246. endif
  247. CPU_UNITDIR=.
  248. UTILSDIR=../utils
  249. COMPILERSOURCEDIR=$(PPC_TARGET) systems
  250. COMPILERUTILSDIR=utils
  251. ifndef FPCLANG
  252. FPCLANG=e
  253. endif
  254. ifndef LOCALDEF
  255. LOCALDEF=
  256. endif
  257. ifndef LOCALOPT
  258. LOCALOPT=$(OPT)
  259. endif
  260. ifndef RTLOPTS
  261. RTLOPTS=$(OPT)
  262. endif
  263. MSGFILES=$(wildcard msg/error*.msg)
  264. ifeq ($(PPC_TARGET),i386)
  265. CPUSUF=386
  266. endif
  267. ifeq ($(PPC_TARGET),alpha)
  268. CPUSUF=axp
  269. endif
  270. ifeq ($(PPC_TARGET),m68k)
  271. CPUSUF=68k
  272. endif
  273. ifeq ($(PPC_TARGET),powerpc)
  274. CPUSUF=ppc
  275. endif
  276. ifeq ($(PPC_TARGET),sparc)
  277. CPUSUF=sparc
  278. endif
  279. ifeq ($(PPC_TARGET),x86_64)
  280. CPUSUF=x64
  281. endif
  282. ifeq ($(PPC_TARGET),arm)
  283. CPUSUF=arm
  284. endif
  285. NOCPUDEF=1
  286. ifeq ($(OS_TARGET),linux)
  287. ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
  288. override LOCALDEF+=-dUNIX
  289. endif
  290. endif
  291. ifeq ($(OS_TARGET),freebsd)
  292. ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
  293. override LOCALDEF+=-dUNIX
  294. endif
  295. endif
  296. MSGFILE=msg/error$(FPCLANG).msg
  297. override LOCALDEF+=-d$(PPC_TARGET) -dGDB -dBROWSERLOG
  298. ifeq ($(PPC_TARGET),i386)
  299. override LOCALDEF+=-Fux86
  300. endif
  301. ifeq ($(PPC_TARGET),x86_64)
  302. override LOCALDEF+=-Fux86 -dNOOPT
  303. endif
  304. ifeq ($(PPC_TARGET),powerpc)
  305. override LOCALDEF+=-dNOOPT
  306. endif
  307. ifeq ($(PPC_TARGET),m68k)
  308. override LOCALDEF+=-dNOOPT
  309. endif
  310. ifeq ($(PPC_TARGET),sparc)
  311. override LOCALDEF+=-dNOOPT
  312. endif
  313. ifeq ($(PPC_TARGET),m68k)
  314. ifeq ($(OS_TARGET),amiga)
  315. override LOCALDEF+=-Ct
  316. endif
  317. endif
  318. ifeq ($(PPC_TARGET),m68k)
  319. ifeq ($(OS_TARGET),amiga)
  320. override LOCALDEF+=-Ct
  321. endif
  322. endif
  323. ifeq ($(PPC_TARGET),arm)
  324. override LOCALDEF+=-dNOOPT
  325. endif
  326. PASDOC:=$(strip $(wildcard $(addsuffix /pasdoc.exe,$(SEARCHPATH))))
  327. ifeq ($(PASDOC),)
  328. PASDOC:=$(strip $(wildcard $(addsuffix /pasdoc,$(SEARCHPATH))))
  329. endif
  330. ifeq ($(PASDOC),)
  331. PASDOC:=../projects/pasdoc/bin/pasdoc
  332. else
  333. PASDOC:=$(firstword $(PASDOC))
  334. endif
  335. override LOCALOPT+=$(LOCALDEF)
  336. override FPCOPT:=$(LOCALOPT)
  337. override TARGET_DIRS+=utils
  338. override INSTALL_FPCPACKAGE=y
  339. override COMPILER_INCLUDEDIR+=$(PPC_TARGET)
  340. override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
  341. override COMPILER_TARGETDIR+=$(CPU_UNITDIR)
  342. ifdef REQUIRE_UNITSDIR
  343. override UNITSDIR+=$(REQUIRE_UNITSDIR)
  344. endif
  345. ifdef REQUIRE_PACKAGESDIR
  346. override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
  347. endif
  348. ifdef ZIPINSTALL
  349. ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
  350. UNIXHier=1
  351. endif
  352. else
  353. ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
  354. UNIXHier=1
  355. endif
  356. endif
  357. ifndef INSTALL_PREFIX
  358. ifdef PREFIX
  359. INSTALL_PREFIX=$(PREFIX)
  360. endif
  361. endif
  362. ifndef INSTALL_PREFIX
  363. ifdef UNIXHier
  364. INSTALL_PREFIX=/usr/local
  365. else
  366. ifdef INSTALL_FPCPACKAGE
  367. INSTALL_BASEDIR:=/pp
  368. else
  369. INSTALL_BASEDIR:=/$(PACKAGE_NAME)
  370. endif
  371. endif
  372. endif
  373. export INSTALL_PREFIX
  374. ifdef INSTALL_FPCSUBDIR
  375. export INSTALL_FPCSUBDIR
  376. endif
  377. ifndef DIST_DESTDIR
  378. DIST_DESTDIR:=$(BASEDIR)
  379. endif
  380. export DIST_DESTDIR
  381. ifndef INSTALL_BASEDIR
  382. ifdef UNIXHier
  383. ifdef INSTALL_FPCPACKAGE
  384. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
  385. else
  386. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
  387. endif
  388. else
  389. INSTALL_BASEDIR:=$(INSTALL_PREFIX)
  390. endif
  391. endif
  392. ifndef INSTALL_BINDIR
  393. ifdef UNIXHier
  394. ifdef CROSSCOMPILE
  395. INSTALL_BINDIR:=$(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/bin
  396. else
  397. INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
  398. endif
  399. else
  400. ifdef CROSSCOMPILE
  401. INSTALL_BINDIR:=$(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/bin
  402. else
  403. INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
  404. endif
  405. ifdef INSTALL_FPCPACKAGE
  406. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)
  407. endif
  408. endif
  409. endif
  410. ifndef INSTALL_UNITDIR
  411. ifdef CROSSCOMPILE
  412. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/units
  413. else
  414. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(OS_TARGET)
  415. endif
  416. ifdef INSTALL_FPCPACKAGE
  417. ifdef PACKAGE_NAME
  418. INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
  419. endif
  420. endif
  421. endif
  422. ifndef INSTALL_LIBDIR
  423. ifdef UNIXHier
  424. INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
  425. else
  426. INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
  427. endif
  428. endif
  429. ifndef INSTALL_SOURCEDIR
  430. ifdef UNIXHier
  431. ifdef BSDhier
  432. SRCPREFIXDIR=share/src
  433. else
  434. ifdef linuxHier
  435. SRCPREFIXDIR=share/src
  436. else
  437. SRCPREFIXDIR=src
  438. endif
  439. endif
  440. ifdef INSTALL_FPCPACKAGE
  441. ifdef INSTALL_FPCSUBDIR
  442. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  443. else
  444. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  445. endif
  446. else
  447. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  448. endif
  449. else
  450. ifdef INSTALL_FPCPACKAGE
  451. ifdef INSTALL_FPCSUBDIR
  452. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  453. else
  454. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
  455. endif
  456. else
  457. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
  458. endif
  459. endif
  460. endif
  461. ifndef INSTALL_DOCDIR
  462. ifdef UNIXHier
  463. ifdef BSDhier
  464. DOCPREFIXDIR=share/doc
  465. else
  466. ifdef linuxHier
  467. DOCPREFIXDIR=share/doc
  468. else
  469. DOCPREFIXDIR=doc
  470. endif
  471. endif
  472. ifdef INSTALL_FPCPACKAGE
  473. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  474. else
  475. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  476. endif
  477. else
  478. ifdef INSTALL_FPCPACKAGE
  479. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
  480. else
  481. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
  482. endif
  483. endif
  484. endif
  485. ifndef INSTALL_EXAMPLEDIR
  486. ifdef UNIXHier
  487. ifdef INSTALL_FPCPACKAGE
  488. ifdef BSDhier
  489. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  490. else
  491. ifdef linuxHier
  492. INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples
  493. else
  494. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
  495. endif
  496. endif
  497. else
  498. ifdef BSDhier
  499. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  500. else
  501. ifdef linuxHier
  502. INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  503. else
  504. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  505. endif
  506. endif
  507. endif
  508. else
  509. ifdef INSTALL_FPCPACKAGE
  510. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
  511. else
  512. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
  513. endif
  514. endif
  515. endif
  516. ifndef INSTALL_DATADIR
  517. INSTALL_DATADIR=$(INSTALL_BASEDIR)
  518. endif
  519. ifdef CROSSCOMPILE
  520. ifndef CROSSBINDIR
  521. CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(FULL_SOURCE))
  522. ifeq ($(CROSSBINDIR),)
  523. CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/bin/$(FULL_SOURCE))
  524. endif
  525. endif
  526. else
  527. CROSSBINDIR=
  528. endif
  529. BATCHEXT=.bat
  530. LOADEREXT=.as
  531. EXEEXT=.exe
  532. PPLEXT=.ppl
  533. PPUEXT=.ppu
  534. OEXT=.o
  535. ASMEXT=.s
  536. SMARTEXT=.sl
  537. STATICLIBEXT=.a
  538. SHAREDLIBEXT=.so
  539. STATICLIBPREFIX=libp
  540. RSTEXT=.rst
  541. FPCMADE=fpcmade
  542. ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
  543. ifeq ($(OS_TARGET),go32v1)
  544. STATICLIBPREFIX=
  545. FPCMADE=fpcmade.v1
  546. PACKAGESUFFIX=v1
  547. endif
  548. ifeq ($(OS_TARGET),go32v2)
  549. STATICLIBPREFIX=
  550. FPCMADE=fpcmade.dos
  551. ZIPSUFFIX=go32
  552. endif
  553. ifeq ($(OS_TARGET),watcom)
  554. STATICLIBPREFIX=
  555. FPCMADE=fpcmade.wat
  556. ZIPSUFFIX=watc
  557. OEXT=.obj
  558. ASMEXT=.asm
  559. SHAREDLIBEXT=.dll
  560. endif
  561. ifeq ($(OS_TARGET),linux)
  562. BATCHEXT=.sh
  563. EXEEXT=
  564. HASSHAREDLIB=1
  565. FPCMADE=fpcmade.lnx
  566. ZIPSUFFIX=linux
  567. endif
  568. ifeq ($(OS_TARGET),freebsd)
  569. BATCHEXT=.sh
  570. EXEEXT=
  571. HASSHAREDLIB=1
  572. FPCMADE=fpcmade.freebsd
  573. ZIPSUFFIX=freebsd
  574. endif
  575. ifeq ($(OS_TARGET),netbsd)
  576. BATCHEXT=.sh
  577. EXEEXT=
  578. HASSHAREDLIB=1
  579. FPCMADE=fpcmade.netbsd
  580. ZIPSUFFIX=netbsd
  581. endif
  582. ifeq ($(OS_TARGET),openbsd)
  583. BATCHEXT=.sh
  584. EXEEXT=
  585. HASSHAREDLIB=1
  586. FPCMADE=fpcmade.openbsd
  587. ZIPSUFFIX=openbsd
  588. endif
  589. ifeq ($(OS_TARGET),win32)
  590. SHAREDLIBEXT=.dll
  591. FPCMADE=fpcmade.w32
  592. ZIPSUFFIX=w32
  593. endif
  594. ifeq ($(OS_TARGET),os2)
  595. BATCHEXT=.cmd
  596. AOUTEXT=.out
  597. STATICLIBPREFIX=
  598. SHAREDLIBEXT=.dll
  599. FPCMADE=fpcmade.os2
  600. ZIPSUFFIX=os2
  601. ECHO=echo
  602. endif
  603. ifeq ($(OS_TARGET),emx)
  604. BATCHEXT=.cmd
  605. AOUTEXT=.out
  606. STATICLIBPREFIX=
  607. SHAREDLIBEXT=.dll
  608. FPCMADE=fpcmade.emx
  609. ZIPSUFFIX=emx
  610. ECHO=echo
  611. endif
  612. ifeq ($(OS_TARGET),amiga)
  613. EXEEXT=
  614. SHAREDLIBEXT=.library
  615. FPCMADE=fpcmade.amg
  616. endif
  617. ifeq ($(OS_TARGET),morphos)
  618. EXEEXT=
  619. SHAREDLIBEXT=.library
  620. FPCMADE=fpcmade.mos
  621. endif
  622. ifeq ($(OS_TARGET),atari)
  623. EXEEXT=.ttp
  624. FPCMADE=fpcmade.ata
  625. endif
  626. ifeq ($(OS_TARGET),beos)
  627. BATCHEXT=.sh
  628. EXEEXT=
  629. FPCMADE=fpcmade.be
  630. ZIPSUFFIX=be
  631. endif
  632. ifeq ($(OS_TARGET),sunos)
  633. BATCHEXT=.sh
  634. EXEEXT=
  635. FPCMADE=fpcmade.sun
  636. ZIPSUFFIX=sun
  637. endif
  638. ifeq ($(OS_TARGET),qnx)
  639. BATCHEXT=.sh
  640. EXEEXT=
  641. FPCMADE=fpcmade.qnx
  642. ZIPSUFFIX=qnx
  643. endif
  644. ifeq ($(OS_TARGET),netware)
  645. EXEEXT=.nlm
  646. STATICLIBPREFIX=
  647. FPCMADE=fpcmade.nw
  648. ZIPSUFFIX=nw
  649. endif
  650. ifeq ($(OS_TARGET),netwlibc)
  651. EXEEXT=.nlm
  652. STATICLIBPREFIX=
  653. FPCMADE=fpcmade.nwl
  654. ZIPSUFFIX=nwl
  655. endif
  656. ifeq ($(OS_TARGET),macos)
  657. BATCHEXT=
  658. EXEEXT=
  659. FPCMADE=fpcmade.macos
  660. ZIPSUFFIX=macos
  661. DEBUGSYMEXT=.xcoff
  662. endif
  663. ifeq ($(OS_TARGET),darwin)
  664. BATCHEXT=.sh
  665. EXEEXT=
  666. HASSHAREDLIB=1
  667. FPCMADE=fpcmade.darwin
  668. ZIPSUFFIX=darwin
  669. endif
  670. else
  671. ifeq ($(OS_TARGET),go32v1)
  672. PPUEXT=.pp1
  673. OEXT=.o1
  674. ASMEXT=.s1
  675. SMARTEXT=.sl1
  676. STATICLIBEXT=.a1
  677. SHAREDLIBEXT=.so1
  678. STATICLIBPREFIX=
  679. FPCMADE=fpcmade.v1
  680. PACKAGESUFFIX=v1
  681. endif
  682. ifeq ($(OS_TARGET),go32v2)
  683. STATICLIBPREFIX=
  684. FPCMADE=fpcmade.dos
  685. ZIPSUFFIX=go32
  686. endif
  687. ifeq ($(OS_TARGET),watcom)
  688. STATICLIBPREFIX=
  689. FPCMADE=fpcmade.dos
  690. ZIPSUFFIX=watcom
  691. endif
  692. ifeq ($(OS_TARGET),linux)
  693. BATCHEXT=.sh
  694. EXEEXT=
  695. HASSHAREDLIB=1
  696. FPCMADE=fpcmade.lnx
  697. ZIPSUFFIX=linux
  698. endif
  699. ifeq ($(OS_TARGET),freebsd)
  700. BATCHEXT=.sh
  701. EXEEXT=
  702. HASSHAREDLIB=1
  703. FPCMADE=fpcmade.freebsd
  704. ZIPSUFFIX=freebsd
  705. endif
  706. ifeq ($(OS_TARGET),netbsd)
  707. BATCHEXT=.sh
  708. EXEEXT=
  709. HASSHAREDLIB=1
  710. FPCMADE=fpcmade.netbsd
  711. ZIPSUFFIX=netbsd
  712. endif
  713. ifeq ($(OS_TARGET),openbsd)
  714. BATCHEXT=.sh
  715. EXEEXT=
  716. HASSHAREDLIB=1
  717. FPCMADE=fpcmade.openbsd
  718. ZIPSUFFIX=openbsd
  719. endif
  720. ifeq ($(OS_TARGET),win32)
  721. PPUEXT=.ppw
  722. OEXT=.ow
  723. ASMEXT=.sw
  724. SMARTEXT=.slw
  725. STATICLIBEXT=.aw
  726. SHAREDLIBEXT=.dll
  727. FPCMADE=fpcmade.w32
  728. ZIPSUFFIX=w32
  729. endif
  730. ifeq ($(OS_TARGET),os2)
  731. BATCHEXT=.cmd
  732. PPUEXT=.ppo
  733. ASMEXT=.so2
  734. OEXT=.oo2
  735. AOUTEXT=.out
  736. SMARTEXT=.sl2
  737. STATICLIBPREFIX=
  738. STATICLIBEXT=.ao2
  739. SHAREDLIBEXT=.dll
  740. FPCMADE=fpcmade.os2
  741. ZIPSUFFIX=emx
  742. ECHO=echo
  743. endif
  744. ifeq ($(OS_TARGET),amiga)
  745. EXEEXT=
  746. PPUEXT=.ppu
  747. ASMEXT=.asm
  748. OEXT=.o
  749. SMARTEXT=.sl
  750. STATICLIBEXT=.a
  751. SHAREDLIBEXT=.library
  752. FPCMADE=fpcmade.amg
  753. endif
  754. ifeq ($(OS_TARGET),atari)
  755. PPUEXT=.ppu
  756. ASMEXT=.s
  757. OEXT=.o
  758. SMARTEXT=.sl
  759. STATICLIBEXT=.a
  760. EXEEXT=.ttp
  761. FPCMADE=fpcmade.ata
  762. endif
  763. ifeq ($(OS_TARGET),beos)
  764. BATCHEXT=.sh
  765. PPUEXT=.ppu
  766. ASMEXT=.s
  767. OEXT=.o
  768. SMARTEXT=.sl
  769. STATICLIBEXT=.a
  770. EXEEXT=
  771. FPCMADE=fpcmade.be
  772. ZIPSUFFIX=be
  773. endif
  774. ifeq ($(OS_TARGET),sunos)
  775. BATCHEXT=.sh
  776. PPUEXT=.ppu
  777. ASMEXT=.s
  778. OEXT=.o
  779. SMARTEXT=.sl
  780. STATICLIBEXT=.a
  781. EXEEXT=
  782. FPCMADE=fpcmade.sun
  783. ZIPSUFFIX=sun
  784. endif
  785. ifeq ($(OS_TARGET),qnx)
  786. BATCHEXT=.sh
  787. PPUEXT=.ppu
  788. ASMEXT=.s
  789. OEXT=.o
  790. SMARTEXT=.sl
  791. STATICLIBEXT=.a
  792. EXEEXT=
  793. FPCMADE=fpcmade.qnx
  794. ZIPSUFFIX=qnx
  795. endif
  796. ifeq ($(OS_TARGET),netware)
  797. STATICLIBPREFIX=
  798. PPUEXT=.ppu
  799. OEXT=.o
  800. ASMEXT=.s
  801. SMARTEXT=.sl
  802. STATICLIBEXT=.a
  803. SHAREDLIBEXT=.nlm
  804. FPCMADE=fpcmade.nw
  805. ZIPSUFFIX=nw
  806. EXEEXT=.nlm
  807. endif
  808. ifeq ($(OS_TARGET),netwlibc)
  809. STATICLIBPREFIX=
  810. PPUEXT=.ppu
  811. OEXT=.o
  812. ASMEXT=.s
  813. SMARTEXT=.sl
  814. STATICLIBEXT=.a
  815. SHAREDLIBEXT=.nlm
  816. FPCMADE=fpcmade.nwl
  817. ZIPSUFFIX=nwl
  818. EXEEXT=.nlm
  819. endif
  820. ifeq ($(OS_TARGET),macos)
  821. BATCHEXT=
  822. PPUEXT=.ppu
  823. ASMEXT=.s
  824. OEXT=.o
  825. SMARTEXT=.sl
  826. STATICLIBEXT=.a
  827. EXEEXT=
  828. DEBUGSYMEXT=.xcoff
  829. FPCMADE=fpcmade.macos
  830. endif
  831. endif
  832. ifndef ECHO
  833. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  834. ifeq ($(ECHO),)
  835. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  836. ifeq ($(ECHO),)
  837. ECHO= __missing_command__
  838. else
  839. ECHO:=$(firstword $(ECHO))
  840. endif
  841. else
  842. ECHO:=$(firstword $(ECHO))
  843. endif
  844. endif
  845. export ECHO
  846. ifndef DATE
  847. DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
  848. ifeq ($(DATE),)
  849. DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
  850. ifeq ($(DATE),)
  851. DATE= __missing_command__
  852. else
  853. DATE:=$(firstword $(DATE))
  854. endif
  855. else
  856. DATE:=$(firstword $(DATE))
  857. endif
  858. endif
  859. export DATE
  860. ifndef GINSTALL
  861. GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
  862. ifeq ($(GINSTALL),)
  863. GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
  864. ifeq ($(GINSTALL),)
  865. GINSTALL= __missing_command__
  866. else
  867. GINSTALL:=$(firstword $(GINSTALL))
  868. endif
  869. else
  870. GINSTALL:=$(firstword $(GINSTALL))
  871. endif
  872. endif
  873. export GINSTALL
  874. ifndef CPPROG
  875. CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
  876. ifeq ($(CPPROG),)
  877. CPPROG= __missing_command__
  878. else
  879. CPPROG:=$(firstword $(CPPROG))
  880. endif
  881. endif
  882. export CPPROG
  883. ifndef RMPROG
  884. RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
  885. ifeq ($(RMPROG),)
  886. RMPROG= __missing_command__
  887. else
  888. RMPROG:=$(firstword $(RMPROG))
  889. endif
  890. endif
  891. export RMPROG
  892. ifndef MVPROG
  893. MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
  894. ifeq ($(MVPROG),)
  895. MVPROG= __missing_command__
  896. else
  897. MVPROG:=$(firstword $(MVPROG))
  898. endif
  899. endif
  900. export MVPROG
  901. ifndef ECHOREDIR
  902. ifndef inUnix
  903. ECHOREDIR=echo
  904. else
  905. ECHOREDIR=$(ECHO)
  906. endif
  907. endif
  908. ifndef COPY
  909. COPY:=$(CPPROG) -fp
  910. endif
  911. ifndef COPYTREE
  912. COPYTREE:=$(CPPROG) -rfp
  913. endif
  914. ifndef MOVE
  915. MOVE:=$(MVPROG) -f
  916. endif
  917. ifndef DEL
  918. DEL:=$(RMPROG) -f
  919. endif
  920. ifndef DELTREE
  921. DELTREE:=$(RMPROG) -rf
  922. endif
  923. ifndef INSTALL
  924. ifdef inUnix
  925. INSTALL:=$(GINSTALL) -c -m 644
  926. else
  927. INSTALL:=$(COPY)
  928. endif
  929. endif
  930. ifndef INSTALLEXE
  931. ifdef inUnix
  932. INSTALLEXE:=$(GINSTALL) -c -m 755
  933. else
  934. INSTALLEXE:=$(COPY)
  935. endif
  936. endif
  937. ifndef MKDIR
  938. MKDIR:=$(GINSTALL) -m 755 -d
  939. endif
  940. export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
  941. ifndef PPUMOVE
  942. PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
  943. ifeq ($(PPUMOVE),)
  944. PPUMOVE= __missing_command__
  945. else
  946. PPUMOVE:=$(firstword $(PPUMOVE))
  947. endif
  948. endif
  949. export PPUMOVE
  950. ifndef FPCMAKE
  951. FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
  952. ifeq ($(FPCMAKE),)
  953. FPCMAKE= __missing_command__
  954. else
  955. FPCMAKE:=$(firstword $(FPCMAKE))
  956. endif
  957. endif
  958. export FPCMAKE
  959. ifndef ZIPPROG
  960. ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
  961. ifeq ($(ZIPPROG),)
  962. ZIPPROG= __missing_command__
  963. else
  964. ZIPPROG:=$(firstword $(ZIPPROG))
  965. endif
  966. endif
  967. export ZIPPROG
  968. ifndef TARPROG
  969. TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
  970. ifeq ($(TARPROG),)
  971. TARPROG= __missing_command__
  972. else
  973. TARPROG:=$(firstword $(TARPROG))
  974. endif
  975. endif
  976. export TARPROG
  977. ASNAME=$(BINUTILSPREFIX)as
  978. LDNAME=$(BINUTILSPREFIX)ld
  979. ARNAME=$(BINUTILSPREFIX)ar
  980. RCNAME=$(BINUTILSPREFIX)rc
  981. ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
  982. ifeq ($(OS_TARGET),win32)
  983. ifeq ($(CROSSBINDIR),)
  984. ASNAME=asw
  985. LDNAME=ldw
  986. ARNAME=arw
  987. endif
  988. endif
  989. endif
  990. ifndef ASPROG
  991. ifdef CROSSBINDIR
  992. ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
  993. else
  994. ASPROG=$(ASNAME)
  995. endif
  996. endif
  997. ifndef LDPROG
  998. ifdef CROSSBINDIR
  999. LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
  1000. else
  1001. LDPROG=$(LDNAME)
  1002. endif
  1003. endif
  1004. ifndef RCPROG
  1005. ifdef CROSSBINDIR
  1006. RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
  1007. else
  1008. RCPROG=$(RCNAME)
  1009. endif
  1010. endif
  1011. ifndef ARPROG
  1012. ifdef CROSSBINDIR
  1013. ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
  1014. else
  1015. ARPROG=$(ARNAME)
  1016. endif
  1017. endif
  1018. AS=$(ASPROG)
  1019. LD=$(LDPROG)
  1020. RC=$(RCPROG)
  1021. AR=$(ARPROG)
  1022. PPAS=ppas$(SRCBATCHEXT)
  1023. ifdef inUnix
  1024. LDCONFIG=ldconfig
  1025. else
  1026. LDCONFIG=
  1027. endif
  1028. ifdef DATE
  1029. DATESTR:=$(shell $(DATE) +%Y%m%d)
  1030. else
  1031. DATESTR=
  1032. endif
  1033. ifndef UPXPROG
  1034. ifeq ($(OS_TARGET),go32v2)
  1035. UPXPROG:=1
  1036. endif
  1037. ifeq ($(OS_TARGET),win32)
  1038. UPXPROG:=1
  1039. endif
  1040. ifdef UPXPROG
  1041. UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
  1042. ifeq ($(UPXPROG),)
  1043. UPXPROG=
  1044. else
  1045. UPXPROG:=$(firstword $(UPXPROG))
  1046. endif
  1047. else
  1048. UPXPROG=
  1049. endif
  1050. endif
  1051. export UPXPROG
  1052. ZIPOPT=-9
  1053. ZIPEXT=.zip
  1054. ifeq ($(USETAR),bz2)
  1055. TAROPT=vI
  1056. TAREXT=.tar.bz2
  1057. else
  1058. TAROPT=vz
  1059. TAREXT=.tar.gz
  1060. endif
  1061. override REQUIRE_PACKAGES=rtl rtl
  1062. ifeq ($(OS_TARGET),linux)
  1063. ifeq ($(CPU_TARGET),i386)
  1064. REQUIRE_PACKAGES_RTL=1
  1065. endif
  1066. endif
  1067. ifeq ($(OS_TARGET),linux)
  1068. ifeq ($(CPU_TARGET),m68k)
  1069. REQUIRE_PACKAGES_RTL=1
  1070. endif
  1071. endif
  1072. ifeq ($(OS_TARGET),linux)
  1073. ifeq ($(CPU_TARGET),powerpc)
  1074. REQUIRE_PACKAGES_RTL=1
  1075. endif
  1076. endif
  1077. ifeq ($(OS_TARGET),linux)
  1078. ifeq ($(CPU_TARGET),sparc)
  1079. REQUIRE_PACKAGES_RTL=1
  1080. endif
  1081. endif
  1082. ifeq ($(OS_TARGET),linux)
  1083. ifeq ($(CPU_TARGET),x86_64)
  1084. REQUIRE_PACKAGES_RTL=1
  1085. endif
  1086. endif
  1087. ifeq ($(OS_TARGET),linux)
  1088. ifeq ($(CPU_TARGET),arm)
  1089. REQUIRE_PACKAGES_RTL=1
  1090. endif
  1091. endif
  1092. ifeq ($(OS_TARGET),go32v2)
  1093. ifeq ($(CPU_TARGET),i386)
  1094. REQUIRE_PACKAGES_RTL=1
  1095. endif
  1096. endif
  1097. ifeq ($(OS_TARGET),win32)
  1098. ifeq ($(CPU_TARGET),i386)
  1099. REQUIRE_PACKAGES_RTL=1
  1100. endif
  1101. endif
  1102. ifeq ($(OS_TARGET),os2)
  1103. ifeq ($(CPU_TARGET),i386)
  1104. REQUIRE_PACKAGES_RTL=1
  1105. endif
  1106. endif
  1107. ifeq ($(OS_TARGET),freebsd)
  1108. ifeq ($(CPU_TARGET),i386)
  1109. REQUIRE_PACKAGES_RTL=1
  1110. endif
  1111. endif
  1112. ifeq ($(OS_TARGET),freebsd)
  1113. ifeq ($(CPU_TARGET),m68k)
  1114. REQUIRE_PACKAGES_RTL=1
  1115. endif
  1116. endif
  1117. ifeq ($(OS_TARGET),freebsd)
  1118. ifeq ($(CPU_TARGET),x86_64)
  1119. REQUIRE_PACKAGES_RTL=1
  1120. endif
  1121. endif
  1122. ifeq ($(OS_TARGET),beos)
  1123. ifeq ($(CPU_TARGET),i386)
  1124. REQUIRE_PACKAGES_RTL=1
  1125. endif
  1126. endif
  1127. ifeq ($(OS_TARGET),netbsd)
  1128. ifeq ($(CPU_TARGET),i386)
  1129. REQUIRE_PACKAGES_RTL=1
  1130. endif
  1131. endif
  1132. ifeq ($(OS_TARGET),netbsd)
  1133. ifeq ($(CPU_TARGET),m68k)
  1134. REQUIRE_PACKAGES_RTL=1
  1135. endif
  1136. endif
  1137. ifeq ($(OS_TARGET),netbsd)
  1138. ifeq ($(CPU_TARGET),powerpc)
  1139. REQUIRE_PACKAGES_RTL=1
  1140. endif
  1141. endif
  1142. ifeq ($(OS_TARGET),netbsd)
  1143. ifeq ($(CPU_TARGET),sparc)
  1144. REQUIRE_PACKAGES_RTL=1
  1145. endif
  1146. endif
  1147. ifeq ($(OS_TARGET),amiga)
  1148. ifeq ($(CPU_TARGET),m68k)
  1149. REQUIRE_PACKAGES_RTL=1
  1150. endif
  1151. endif
  1152. ifeq ($(OS_TARGET),atari)
  1153. ifeq ($(CPU_TARGET),m68k)
  1154. REQUIRE_PACKAGES_RTL=1
  1155. endif
  1156. endif
  1157. ifeq ($(OS_TARGET),sunos)
  1158. ifeq ($(CPU_TARGET),i386)
  1159. REQUIRE_PACKAGES_RTL=1
  1160. endif
  1161. endif
  1162. ifeq ($(OS_TARGET),sunos)
  1163. ifeq ($(CPU_TARGET),sparc)
  1164. REQUIRE_PACKAGES_RTL=1
  1165. endif
  1166. endif
  1167. ifeq ($(OS_TARGET),qnx)
  1168. ifeq ($(CPU_TARGET),i386)
  1169. REQUIRE_PACKAGES_RTL=1
  1170. endif
  1171. endif
  1172. ifeq ($(OS_TARGET),netware)
  1173. ifeq ($(CPU_TARGET),i386)
  1174. REQUIRE_PACKAGES_RTL=1
  1175. endif
  1176. endif
  1177. ifeq ($(OS_TARGET),openbsd)
  1178. ifeq ($(CPU_TARGET),i386)
  1179. REQUIRE_PACKAGES_RTL=1
  1180. endif
  1181. endif
  1182. ifeq ($(OS_TARGET),openbsd)
  1183. ifeq ($(CPU_TARGET),m68k)
  1184. REQUIRE_PACKAGES_RTL=1
  1185. endif
  1186. endif
  1187. ifeq ($(OS_TARGET),wdosx)
  1188. ifeq ($(CPU_TARGET),i386)
  1189. REQUIRE_PACKAGES_RTL=1
  1190. endif
  1191. endif
  1192. ifeq ($(OS_TARGET),palmos)
  1193. ifeq ($(CPU_TARGET),m68k)
  1194. REQUIRE_PACKAGES_RTL=1
  1195. endif
  1196. endif
  1197. ifeq ($(OS_TARGET),macos)
  1198. ifeq ($(CPU_TARGET),powerpc)
  1199. REQUIRE_PACKAGES_RTL=1
  1200. endif
  1201. endif
  1202. ifeq ($(OS_TARGET),darwin)
  1203. ifeq ($(CPU_TARGET),powerpc)
  1204. REQUIRE_PACKAGES_RTL=1
  1205. endif
  1206. endif
  1207. ifeq ($(OS_TARGET),emx)
  1208. ifeq ($(CPU_TARGET),i386)
  1209. REQUIRE_PACKAGES_RTL=1
  1210. endif
  1211. endif
  1212. ifeq ($(OS_TARGET),watcom)
  1213. ifeq ($(CPU_TARGET),i386)
  1214. REQUIRE_PACKAGES_RTL=1
  1215. endif
  1216. endif
  1217. ifeq ($(OS_TARGET),morphos)
  1218. ifeq ($(CPU_TARGET),powerpc)
  1219. REQUIRE_PACKAGES_RTL=1
  1220. endif
  1221. endif
  1222. ifeq ($(OS_TARGET),netwlibc)
  1223. ifeq ($(CPU_TARGET),i386)
  1224. REQUIRE_PACKAGES_RTL=1
  1225. endif
  1226. endif
  1227. ifdef REQUIRE_PACKAGES_RTL
  1228. PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
  1229. ifneq ($(PACKAGEDIR_RTL),)
  1230. ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
  1231. UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
  1232. else
  1233. UNITDIR_RTL=$(PACKAGEDIR_RTL)
  1234. endif
  1235. ifdef CHECKDEPEND
  1236. $(PACKAGEDIR_RTL)/$(FPCMADE):
  1237. $(MAKE) -C $(PACKAGEDIR_RTL) $(FPCMADE)
  1238. override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
  1239. endif
  1240. else
  1241. PACKAGEDIR_RTL=
  1242. UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
  1243. ifneq ($(UNITDIR_RTL),)
  1244. UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
  1245. else
  1246. UNITDIR_RTL=
  1247. endif
  1248. endif
  1249. ifdef UNITDIR_RTL
  1250. override COMPILER_UNITDIR+=$(UNITDIR_RTL)
  1251. endif
  1252. endif
  1253. ifndef NOCPUDEF
  1254. override FPCOPTDEF=$(CPU_TARGET)
  1255. endif
  1256. ifneq ($(OS_TARGET),$(OS_SOURCE))
  1257. override FPCOPT+=-T$(OS_TARGET)
  1258. endif
  1259. ifeq ($(OS_SOURCE),openbsd)
  1260. override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
  1261. endif
  1262. ifndef CROSSBOOTSTRAP
  1263. ifneq ($(BINUTILSPREFIX),)
  1264. override FPCOPT+=-XP$(BINUTILSPREFIX) -Xc
  1265. endif
  1266. ifneq ($(BINUTILSPREFIX),)
  1267. override FPCOPT+=-Xr$(RLINKPATH)
  1268. endif
  1269. endif
  1270. ifdef UNITDIR
  1271. override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
  1272. endif
  1273. ifdef LIBDIR
  1274. override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
  1275. endif
  1276. ifdef OBJDIR
  1277. override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
  1278. endif
  1279. ifdef INCDIR
  1280. override FPCOPT+=$(addprefix -Fi,$(INCDIR))
  1281. endif
  1282. ifdef LINKSMART
  1283. override FPCOPT+=-XX
  1284. endif
  1285. ifdef CREATESMART
  1286. override FPCOPT+=-CX
  1287. endif
  1288. ifdef DEBUG
  1289. override FPCOPT+=-gl
  1290. override FPCOPTDEF+=DEBUG
  1291. endif
  1292. ifdef RELEASE
  1293. ifeq ($(CPU_TARGET),i386)
  1294. FPCCPUOPT:=-OG2p3
  1295. else
  1296. ifeq ($(CPU_TARGET),powerpc)
  1297. FPCCPUOPT:=-O1
  1298. else
  1299. FPCCPUOPT:=
  1300. endif
  1301. endif
  1302. override FPCOPT+=-Xs $(FPCCPUOPT) -n
  1303. override FPCOPTDEF+=RELEASE
  1304. endif
  1305. ifdef STRIP
  1306. override FPCOPT+=-Xs
  1307. endif
  1308. ifdef OPTIMIZE
  1309. ifeq ($(CPU_TARGET),i386)
  1310. override FPCOPT+=-OG2p3
  1311. endif
  1312. endif
  1313. ifdef VERBOSE
  1314. override FPCOPT+=-vwni
  1315. endif
  1316. ifdef COMPILER_OPTIONS
  1317. override FPCOPT+=$(COMPILER_OPTIONS)
  1318. endif
  1319. ifdef COMPILER_UNITDIR
  1320. override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
  1321. endif
  1322. ifdef COMPILER_LIBRARYDIR
  1323. override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
  1324. endif
  1325. ifdef COMPILER_OBJECTDIR
  1326. override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
  1327. endif
  1328. ifdef COMPILER_INCLUDEDIR
  1329. override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
  1330. endif
  1331. ifdef CROSSBINDIR
  1332. override FPCOPT+=-FD$(CROSSBINDIR)
  1333. endif
  1334. ifdef COMPILER_TARGETDIR
  1335. override FPCOPT+=-FE$(COMPILER_TARGETDIR)
  1336. ifeq ($(COMPILER_TARGETDIR),.)
  1337. override TARGETDIRPREFIX=
  1338. else
  1339. override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
  1340. endif
  1341. endif
  1342. ifdef COMPILER_UNITTARGETDIR
  1343. override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
  1344. ifeq ($(COMPILER_UNITTARGETDIR),.)
  1345. override UNITTARGETDIRPREFIX=
  1346. else
  1347. override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
  1348. endif
  1349. else
  1350. ifdef COMPILER_TARGETDIR
  1351. override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
  1352. override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
  1353. endif
  1354. endif
  1355. ifeq ($(OS_TARGET),linux)
  1356. ifeq ($(FPC_VERSION),1.0.6)
  1357. override FPCOPTDEF+=HASUNIX
  1358. endif
  1359. endif
  1360. ifdef OPT
  1361. override FPCOPT+=$(OPT)
  1362. endif
  1363. ifdef FPCOPTDEF
  1364. override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
  1365. endif
  1366. ifdef CFGFILE
  1367. override FPCOPT+=@$(CFGFILE)
  1368. endif
  1369. ifdef USEENV
  1370. override FPCEXTCMD:=$(FPCOPT)
  1371. override FPCOPT:=!FPCEXTCMD
  1372. export FPCEXTCMD
  1373. endif
  1374. override COMPILER:=$(FPC) $(FPCOPT)
  1375. ifeq (,$(findstring -s ,$(COMPILER)))
  1376. EXECPPAS=
  1377. else
  1378. ifeq ($(FULL_SOURCE),$(FULL_TARGET))
  1379. EXECPPAS:=@$(PPAS)
  1380. endif
  1381. endif
  1382. ifdef TARGET_RSTS
  1383. override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
  1384. override CLEANRSTFILES+=$(RSTFILES)
  1385. endif
  1386. .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
  1387. ifdef INSTALL_UNITS
  1388. override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
  1389. endif
  1390. ifdef INSTALL_BUILDUNIT
  1391. override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
  1392. endif
  1393. ifdef INSTALLPPUFILES
  1394. override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
  1395. override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPUFILES))
  1396. override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPULINKFILES)))
  1397. override INSTALL_CREATEPACKAGEFPC=1
  1398. endif
  1399. ifdef INSTALLEXEFILES
  1400. override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
  1401. endif
  1402. fpc_install: all $(INSTALLTARGET)
  1403. ifdef INSTALLEXEFILES
  1404. $(MKDIR) $(INSTALL_BINDIR)
  1405. ifdef UPXPROG
  1406. -$(UPXPROG) $(INSTALLEXEFILES)
  1407. endif
  1408. $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
  1409. endif
  1410. ifdef INSTALL_CREATEPACKAGEFPC
  1411. ifdef FPCMAKE
  1412. ifdef PACKAGE_VERSION
  1413. ifneq ($(wildcard Makefile.fpc),)
  1414. $(FPCMAKE) -p -T$(OS_TARGET) Makefile.fpc
  1415. $(MKDIR) $(INSTALL_UNITDIR)
  1416. $(INSTALL) Package.fpc $(INSTALL_UNITDIR)
  1417. endif
  1418. endif
  1419. endif
  1420. endif
  1421. ifdef INSTALLPPUFILES
  1422. $(MKDIR) $(INSTALL_UNITDIR)
  1423. $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
  1424. ifneq ($(INSTALLPPULINKFILES),)
  1425. $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
  1426. endif
  1427. ifneq ($(wildcard $(LIB_FULLNAME)),)
  1428. $(MKDIR) $(INSTALL_LIBDIR)
  1429. $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
  1430. ifdef inUnix
  1431. ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
  1432. endif
  1433. endif
  1434. endif
  1435. ifdef INSTALL_FILES
  1436. $(MKDIR) $(INSTALL_DATADIR)
  1437. $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
  1438. endif
  1439. fpc_sourceinstall: distclean
  1440. $(MKDIR) $(INSTALL_SOURCEDIR)
  1441. $(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
  1442. fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
  1443. ifdef HASEXAMPLES
  1444. $(MKDIR) $(INSTALL_EXAMPLEDIR)
  1445. endif
  1446. ifdef EXAMPLESOURCEFILES
  1447. $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
  1448. endif
  1449. ifdef TARGET_EXAMPLEDIRS
  1450. $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
  1451. endif
  1452. .PHONY: fpc_distinstall
  1453. fpc_distinstall: install exampleinstall
  1454. .PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall
  1455. ifndef PACKDIR
  1456. ifndef inUnix
  1457. PACKDIR=$(BASEDIR)/../fpc-pack
  1458. else
  1459. PACKDIR=/tmp/fpc-pack
  1460. endif
  1461. endif
  1462. ifndef ZIPNAME
  1463. ifdef DIST_ZIPNAME
  1464. ZIPNAME=$(DIST_ZIPNAME)
  1465. else
  1466. ZIPNAME=$(ZIPPREFIX)$(PACKAGE_NAME)$(ZIPSUFFIX)
  1467. endif
  1468. endif
  1469. ifndef ZIPTARGET
  1470. ifdef DIST_ZIPTARGET
  1471. ZIPTARGET=DIST_ZIPTARGET
  1472. else
  1473. ZIPTARGET=install
  1474. endif
  1475. endif
  1476. ifndef USEZIP
  1477. ifdef inUnix
  1478. USETAR=1
  1479. endif
  1480. endif
  1481. ifndef inUnix
  1482. USEZIPWRAPPER=1
  1483. endif
  1484. ifdef USEZIPWRAPPER
  1485. ZIPPATHSEP=$(PATHSEP)
  1486. ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(SRCBATCHEXT))
  1487. else
  1488. ZIPPATHSEP=/
  1489. endif
  1490. ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
  1491. ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
  1492. ifdef USETAR
  1493. ZIPDESTFILE:=$(DIST_DESTDIR)/$(ZIPNAME)$(TAREXT)
  1494. ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *
  1495. else
  1496. ZIPDESTFILE:=$(DIST_DESTDIR)/$(ZIPNAME)$(ZIPEXT)
  1497. ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
  1498. endif
  1499. fpc_zipinstall:
  1500. $(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1
  1501. $(MKDIR) $(DIST_DESTDIR)
  1502. $(DEL) $(ZIPDESTFILE)
  1503. ifdef USEZIPWRAPPER
  1504. ifneq ($(ECHOREDIR),echo)
  1505. $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER)
  1506. $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)
  1507. $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER)
  1508. else
  1509. echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)
  1510. echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)
  1511. echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)
  1512. endif
  1513. ifdef inUnix
  1514. /bin/sh $(ZIPWRAPPER)
  1515. else
  1516. $(ZIPWRAPPER)
  1517. endif
  1518. $(DEL) $(ZIPWRAPPER)
  1519. else
  1520. $(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)
  1521. endif
  1522. $(DELTREE) $(PACKDIR)
  1523. fpc_zipsourceinstall:
  1524. $(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=src
  1525. fpc_zipexampleinstall:
  1526. ifdef HASEXAMPLES
  1527. $(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=exm
  1528. endif
  1529. fpc_zipdistinstall:
  1530. $(MAKE) fpc_zipinstall ZIPTARGET=distinstall
  1531. .PHONY: fpc_clean fpc_cleanall fpc_distclean
  1532. ifdef EXEFILES
  1533. override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
  1534. endif
  1535. ifdef CLEAN_UNITS
  1536. override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
  1537. endif
  1538. ifdef CLEANPPUFILES
  1539. override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
  1540. ifdef DEBUGSYMEXT
  1541. override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
  1542. endif
  1543. override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
  1544. override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
  1545. endif
  1546. fpc_clean: $(CLEANTARGET)
  1547. ifdef CLEANEXEFILES
  1548. -$(DEL) $(CLEANEXEFILES)
  1549. endif
  1550. ifdef CLEANPPUFILES
  1551. -$(DEL) $(CLEANPPUFILES)
  1552. endif
  1553. ifneq ($(CLEANPPULINKFILES),)
  1554. -$(DEL) $(CLEANPPULINKFILES)
  1555. endif
  1556. ifdef CLEANRSTFILES
  1557. -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
  1558. endif
  1559. ifdef CLEAN_FILES
  1560. -$(DEL) $(CLEAN_FILES)
  1561. endif
  1562. ifdef LIB_NAME
  1563. -$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
  1564. endif
  1565. -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  1566. -$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT)
  1567. fpc_distclean: clean
  1568. ifdef COMPILER_UNITTARGETDIR
  1569. TARGETDIRCLEAN=fpc_clean
  1570. endif
  1571. fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
  1572. ifdef CLEANEXEFILES
  1573. -$(DEL) $(CLEANEXEFILES)
  1574. endif
  1575. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  1576. -$(DELTREE) *$(SMARTEXT)
  1577. -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  1578. -$(DEL) *_ppas$(BATCHEXT)
  1579. ifdef AOUTEXT
  1580. -$(DEL) *$(AOUTEXT)
  1581. endif
  1582. ifdef DEBUGSYMEXT
  1583. -$(DEL) *$(DEBUGSYMEXT)
  1584. endif
  1585. .PHONY: fpc_baseinfo
  1586. override INFORULES+=fpc_baseinfo
  1587. fpc_baseinfo:
  1588. @$(ECHO)
  1589. @$(ECHO) == Package info ==
  1590. @$(ECHO) Package Name..... $(PACKAGE_NAME)
  1591. @$(ECHO) Package Version.. $(PACKAGE_VERSION)
  1592. @$(ECHO)
  1593. @$(ECHO) == Configuration info ==
  1594. @$(ECHO)
  1595. @$(ECHO) FPC.......... $(FPC)
  1596. @$(ECHO) FPC Version.. $(FPC_VERSION)
  1597. @$(ECHO) Source CPU... $(CPU_SOURCE)
  1598. @$(ECHO) Target CPU... $(CPU_TARGET)
  1599. @$(ECHO) Source OS.... $(OS_SOURCE)
  1600. @$(ECHO) Target OS.... $(OS_TARGET)
  1601. @$(ECHO) Full Source.. $(FULL_SOURCE)
  1602. @$(ECHO) Full Target.. $(FULL_TARGET)
  1603. @$(ECHO)
  1604. @$(ECHO) == Directory info ==
  1605. @$(ECHO)
  1606. @$(ECHO) Required pkgs... $(REQUIRE_PACKAGES)
  1607. @$(ECHO)
  1608. @$(ECHO) Basedir......... $(BASEDIR)
  1609. @$(ECHO) FPCDir.......... $(FPCDIR)
  1610. @$(ECHO) CrossBinDir..... $(CROSSBINDIR)
  1611. @$(ECHO) UnitsDir........ $(UNITSDIR)
  1612. @$(ECHO) PackagesDir..... $(PACKAGESDIR)
  1613. @$(ECHO)
  1614. @$(ECHO) GCC library..... $(GCCLIBDIR)
  1615. @$(ECHO) Other library... $(OTHERLIBDIR)
  1616. @$(ECHO)
  1617. @$(ECHO) == Tools info ==
  1618. @$(ECHO)
  1619. @$(ECHO) As........ $(AS)
  1620. @$(ECHO) Ld........ $(LD)
  1621. @$(ECHO) Ar........ $(AR)
  1622. @$(ECHO) Rc........ $(RC)
  1623. @$(ECHO)
  1624. @$(ECHO) Mv........ $(MVPROG)
  1625. @$(ECHO) Cp........ $(CPPROG)
  1626. @$(ECHO) Rm........ $(RMPROG)
  1627. @$(ECHO) GInstall.. $(GINSTALL)
  1628. @$(ECHO) Echo...... $(ECHO)
  1629. @$(ECHO) Shell..... $(SHELL)
  1630. @$(ECHO) Date...... $(DATE)
  1631. @$(ECHO) FPCMake... $(FPCMAKE)
  1632. @$(ECHO) PPUMove... $(PPUMOVE)
  1633. @$(ECHO) Upx....... $(UPXPROG)
  1634. @$(ECHO) Zip....... $(ZIPPROG)
  1635. @$(ECHO)
  1636. @$(ECHO) == Object info ==
  1637. @$(ECHO)
  1638. @$(ECHO) Target Loaders........ $(TARGET_LOADERS)
  1639. @$(ECHO) Target Units.......... $(TARGET_UNITS)
  1640. @$(ECHO) Target Implicit Units. $(TARGET_IMPLICITUNITS)
  1641. @$(ECHO) Target Programs....... $(TARGET_PROGRAMS)
  1642. @$(ECHO) Target Dirs........... $(TARGET_DIRS)
  1643. @$(ECHO) Target Examples....... $(TARGET_EXAMPLES)
  1644. @$(ECHO) Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
  1645. @$(ECHO)
  1646. @$(ECHO) Clean Units......... $(CLEAN_UNITS)
  1647. @$(ECHO) Clean Files......... $(CLEAN_FILES)
  1648. @$(ECHO)
  1649. @$(ECHO) Install Units....... $(INSTALL_UNITS)
  1650. @$(ECHO) Install Files....... $(INSTALL_FILES)
  1651. @$(ECHO)
  1652. @$(ECHO) == Install info ==
  1653. @$(ECHO)
  1654. @$(ECHO) DateStr.............. $(DATESTR)
  1655. @$(ECHO) ZipPrefix............ $(ZIPPREFIX)
  1656. @$(ECHO) ZipSuffix............ $(ZIPSUFFIX)
  1657. @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE)
  1658. @$(ECHO)
  1659. @$(ECHO) Install base dir..... $(INSTALL_BASEDIR)
  1660. @$(ECHO) Install binary dir... $(INSTALL_BINDIR)
  1661. @$(ECHO) Install library dir.. $(INSTALL_LIBDIR)
  1662. @$(ECHO) Install units dir.... $(INSTALL_UNITDIR)
  1663. @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR)
  1664. @$(ECHO) Install doc dir...... $(INSTALL_DOCDIR)
  1665. @$(ECHO) Install example dir.. $(INSTALL_EXAMPLEDIR)
  1666. @$(ECHO) Install data dir..... $(INSTALL_DATADIR)
  1667. @$(ECHO)
  1668. @$(ECHO) Dist destination dir. $(DIST_DESTDIR)
  1669. @$(ECHO) Dist zip name........ $(DIST_ZIPNAME)
  1670. @$(ECHO)
  1671. .PHONY: fpc_info
  1672. fpc_info: $(INFORULES)
  1673. .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
  1674. fpc_makefile_dirs
  1675. fpc_makefile:
  1676. $(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
  1677. fpc_makefile_sub1:
  1678. ifdef TARGET_DIRS
  1679. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
  1680. endif
  1681. ifdef TARGET_EXAMPLEDIRS
  1682. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
  1683. endif
  1684. fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
  1685. fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
  1686. fpc_makefiles: fpc_makefile fpc_makefile_dirs
  1687. TARGET_DIRS_UTILS=1
  1688. ifdef TARGET_DIRS_UTILS
  1689. utils_all:
  1690. $(MAKE) -C utils all
  1691. utils_debug:
  1692. $(MAKE) -C utils debug
  1693. utils_smart:
  1694. $(MAKE) -C utils smart
  1695. utils_release:
  1696. $(MAKE) -C utils release
  1697. utils_examples:
  1698. $(MAKE) -C utils examples
  1699. utils_shared:
  1700. $(MAKE) -C utils shared
  1701. utils_install:
  1702. $(MAKE) -C utils install
  1703. utils_sourceinstall:
  1704. $(MAKE) -C utils sourceinstall
  1705. utils_exampleinstall:
  1706. $(MAKE) -C utils exampleinstall
  1707. utils_distinstall:
  1708. $(MAKE) -C utils distinstall
  1709. utils_zipinstall:
  1710. $(MAKE) -C utils zipinstall
  1711. utils_zipsourceinstall:
  1712. $(MAKE) -C utils zipsourceinstall
  1713. utils_zipexampleinstall:
  1714. $(MAKE) -C utils zipexampleinstall
  1715. utils_zipdistinstall:
  1716. $(MAKE) -C utils zipdistinstall
  1717. utils_clean:
  1718. $(MAKE) -C utils clean
  1719. utils_distclean:
  1720. $(MAKE) -C utils distclean
  1721. utils_cleanall:
  1722. $(MAKE) -C utils cleanall
  1723. utils_info:
  1724. $(MAKE) -C utils info
  1725. utils_makefiles:
  1726. $(MAKE) -C utils makefiles
  1727. utils:
  1728. $(MAKE) -C utils all
  1729. .PHONY: utils_all utils_debug utils_smart utils_release utils_examples utils_shared utils_install utils_sourceinstall utils_exampleinstall utils_distinstall utils_zipinstall utils_zipsourceinstall utils_zipexampleinstall utils_zipdistinstall utils_clean utils_distclean utils_cleanall utils_info utils_makefiles utils
  1730. endif
  1731. ifndef DIFF
  1732. DIFF:=$(strip $(wildcard $(addsuffix /diff$(SRCEXEEXT),$(SEARCHPATH))))
  1733. ifeq ($(DIFF),)
  1734. DIFF= __missing_command__
  1735. else
  1736. DIFF:=$(firstword $(DIFF))
  1737. endif
  1738. endif
  1739. export DIFF
  1740. ifndef CMP
  1741. CMP:=$(strip $(wildcard $(addsuffix /cmp$(SRCEXEEXT),$(SEARCHPATH))))
  1742. ifeq ($(CMP),)
  1743. CMP= __missing_command__
  1744. else
  1745. CMP:=$(firstword $(CMP))
  1746. endif
  1747. endif
  1748. export CMP
  1749. debug: $(addsuffix _debug,$(TARGET_DIRS))
  1750. smart: $(addsuffix _smart,$(TARGET_DIRS))
  1751. release: $(addsuffix _release,$(TARGET_DIRS))
  1752. examples: $(addsuffix _examples,$(TARGET_DIRS))
  1753. shared: $(addsuffix _shared,$(TARGET_DIRS))
  1754. sourceinstall: fpc_sourceinstall
  1755. exampleinstall: fpc_exampleinstall $(addsuffix _exampleinstall,$(TARGET_DIRS))
  1756. distinstall: fpc_distinstall
  1757. zipinstall: fpc_zipinstall
  1758. zipsourceinstall: fpc_zipsourceinstall
  1759. zipexampleinstall: fpc_zipexampleinstall $(addsuffix _zipexampleinstall,$(TARGET_DIRS))
  1760. zipdistinstall: fpc_zipdistinstall
  1761. cleanall: $(addsuffix _cleanall,$(TARGET_DIRS))
  1762. info: fpc_info
  1763. makefiles: fpc_makefiles
  1764. .PHONY: debug smart release examples shared sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall cleanall info makefiles
  1765. ifneq ($(wildcard fpcmake.loc),)
  1766. include fpcmake.loc
  1767. endif
  1768. ifeq ($(OS_TARGET),win32)
  1769. ifdef CMP
  1770. override DIFF:=$(CMP) -i218
  1771. endif
  1772. override COMPILER+=-XX
  1773. endif
  1774. ifdef DIFF
  1775. ifdef OLDFPC
  1776. DIFFRESULT:=$(shell $(DIFF) $(OLDFPC) $(FPC))
  1777. else
  1778. DIFFRESULT=Not equal
  1779. endif
  1780. else
  1781. DIFFRESULT=No diff program
  1782. endif
  1783. ifndef EXENAME
  1784. EXENAME=ppc$(CPUSUF)$(EXEEXT)
  1785. endif
  1786. PPEXENAME=pp$(EXEEXT)
  1787. TEMPNAME=ppc$(SRCEXEEXT)
  1788. PPCROSSNAME=ppcross$(CPUSUF)$(SRCEXEEXT)
  1789. TEMPNAME1=ppc1$(EXEEXT)
  1790. TEMPNAME2=ppc2$(EXEEXT)
  1791. TEMPNAME3=ppc3$(EXEEXT)
  1792. MAKEDEP=ppdep$(EXEEXT)
  1793. MSG2INC=./msg2inc$(EXEEXT)
  1794. .PHONY: alpha i386 m68k powerpc sparc arm
  1795. alpha:
  1796. $(MAKE) PPC_TARGET=alpha CPU_UNITDIR=alpha all
  1797. i386:
  1798. $(MAKE) PPC_TARGET=i386 CPU_UNITDIR=i386 all
  1799. m68k:
  1800. $(MAKE) PPC_TARGET=m68k CPU_UNITDIR=m68k all
  1801. powerpc:
  1802. $(MAKE) PPC_TARGET=powerpc CPU_UNITDIR=powerpc all
  1803. sparc:
  1804. $(MAKE) PPC_TARGET=sparc CPU_UNITDIR=sparc all
  1805. arm:
  1806. $(MAKE) PPC_TARGET=arm CPU_UNITDIR=arm all
  1807. .PHONY: all compiler echotime ppuclean execlean clean distclean
  1808. all: $(EXENAME) $(addsuffix _all,$(TARGET_DIRS))
  1809. compiler: $(EXENAME)
  1810. ifeq ($(MAKELEVEL),0)
  1811. ifndef STARTTIME
  1812. ifdef DATE
  1813. STARTTIME:=$(shell $(DATE) +%T)
  1814. else
  1815. STARTTIME:=unknown
  1816. endif
  1817. endif
  1818. endif
  1819. export STARTTIME
  1820. ifdef DATE
  1821. ENDTIME=$(shell $(DATE) +%T)
  1822. else
  1823. ENDTIME:=unknown
  1824. endif
  1825. echotime:
  1826. @echo Start $(STARTTIME) now $(ENDTIME)
  1827. ppuclean:
  1828. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  1829. -$(DEL) $(addsuffix /*$(PPUEXT),$(COMPILERSOURCEDIR))
  1830. execlean :
  1831. -$(DEL) ppc386$(EXEEXT) ppcaxp$(EXEEXT) ppc68k$(EXEEXT) ppcppc$(EXEEXT) ppcsparc$(EXEEXT) $(EXENAME)
  1832. $(addsuffix _clean,$(CYCLETARGETS)):
  1833. -$(DEL) $(addprefix $(subst _clean,,$@)/,*$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT))
  1834. -$(DEL) $(addprefix $(subst _clean,,$@)/,ppc386$(EXEEXT) ppcaxp$(EXEEXT) ppc68k$(EXEEXT) ppcppc$(EXEEXT) ppcppc$(EXEEXT) $(EXENAME))
  1835. clean : execlean fpc_cleanall $(addsuffix _clean,$(TARGET_DIRS)) $(addsuffix _clean,$(CYCLETARGETS))
  1836. distclean: execlean fpc_cleanall $(addsuffix _distclean,$(TARGET_DIRS))
  1837. -$(DEL) $(PPCROSSNAME) $(TEMPNAME) $(TEMPNAME1) $(TEMPNAME2) $(TEMPNAME3) $(MSG2INC)
  1838. $(MAKEDEP): $(UTILSDIR)/ppdep.pp
  1839. $(COMPILER) $(UTILSDIR)/ppdep.pp
  1840. $(COPY) $(UTILSDIR)/$(MAKEDEP) $(MAKEDEP)
  1841. dependencies : $(MAKEDEP)
  1842. $(MAKEDEP) pp.pas $(FPCOPTDEF) $(LOCALDEF) '-F$$(COMPILER) $$(LOCALOPT)' > depend
  1843. ifdef USEDEPEND
  1844. include depend
  1845. endif
  1846. $(MSG2INC): $(COMPILERUTILSDIR)/msg2inc.pp
  1847. $(COMPILER) -FE. $(COMPILERUTILSDIR)/msg2inc.pp
  1848. msgtxt.inc: $(MSGFILE)
  1849. $(MAKE) $(MSG2INC)
  1850. $(MSG2INC) $(MSGFILE) msg msg
  1851. msg: msgtxt.inc
  1852. ifndef COMPLETE
  1853. $(EXENAME) : $(wildcard *.pas) $(wildcard *.inc) msg \
  1854. $(wildcard systems/*.pas) $(wilcard systems/*.inc) \
  1855. $(wildcard $(PPC_TARGET)/*.pas) $(wildcard $(PPC_TARGET)/*.inc)
  1856. $(COMPILER) pp.pas
  1857. $(EXECPPAS)
  1858. $(MOVE) $(COMPILER_TARGETDIR)/$(PPEXENAME) $(EXENAME)
  1859. else
  1860. $(EXENAME) : $(wildcard *.pas) $(wildcard *.inc) msg \
  1861. $(wildcard systems/*.pas) $(wilcard systems/*.inc) \
  1862. $(wildcard $(PPC_TARGET)/*.pas) $(wildcard $(PPC_TARGET)/*.inc)
  1863. $(COMPILER) pp.pas
  1864. $(EXECPPAS)
  1865. $(COMPILER) pp.pas
  1866. $(EXECPPAS)
  1867. $(COMPILER) pp.pas
  1868. $(EXECPPAS)
  1869. $(MOVE) $(COMPILER_TARGETDIR)/$(PPEXENAME) $(EXENAME)
  1870. endif
  1871. tokens.dat : $(wildcard *.pas) $(wildcard *.inc)
  1872. $(COMPILER) tokendat.pas
  1873. ./tokendat
  1874. ifeq ($(CPU_SOURCE),$(PPC_TARGET))
  1875. ifeq ($(OS_SOURCE),$(OS_TARGET))
  1876. ifndef DIFFRESULT
  1877. next :
  1878. @echo $(OLDFPC) and $(FPC) are equal
  1879. $(COPY) $(FPC) $(EXENAME)
  1880. else
  1881. next :
  1882. $(MAKE) execlean
  1883. $(MAKE) -C $(UNITDIR_RTL) clean
  1884. $(MAKE) -C $(UNITDIR_RTL) 'FPC=$(FPC)' 'OPT=$(RTLOPTS)'
  1885. $(MAKE) clean
  1886. $(MAKE) $(EXENAME)
  1887. $(MAKE) echotime
  1888. endif
  1889. $(TEMPNAME1) : $(EXENAME)
  1890. -$(DEL) $(TEMPNAME1)
  1891. $(MOVE) $(EXENAME) $(TEMPNAME1)
  1892. $(TEMPNAME2) : $(TEMPNAME1)
  1893. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME1)' 'OLDFPC=' next
  1894. -$(DEL) $(TEMPNAME2)
  1895. $(MOVE) $(EXENAME) $(TEMPNAME2)
  1896. $(TEMPNAME3) : $(TEMPNAME2)
  1897. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME2)' 'OLDFPC=$(BASEDIR)/$(TEMPNAME1)' next
  1898. -$(DEL) $(TEMPNAME3)
  1899. $(MOVE) $(EXENAME) $(TEMPNAME3)
  1900. remake: $(EXENAME)
  1901. $(MOVE) $(EXENAME) $(TEMPNAME)
  1902. $(MAKE) execlean
  1903. $(MAKE) -C $(UNITDIR_RTL) clean
  1904. $(MAKE) clean
  1905. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' all
  1906. remake3: $(TEMPNAME3)
  1907. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3)' 'OLDFPC=$(BASEDIR)/$(TEMPNAME2)' next
  1908. $(DIFF) $(TEMPNAME3) $(EXENAME)
  1909. cycle:
  1910. $(MAKE) clean
  1911. $(MAKE) -C $(UNITDIR_RTL) clean
  1912. $(MAKE) -C $(UNITDIR_RTL) 'OPT=$(RTLOPTS)' all
  1913. $(MAKE) remake3
  1914. $(MAKE) $(addsuffix _all,$(TARGET_DIRS)) 'FPC=$(BASEDIR)/$(EXENAME)'
  1915. $(MAKE) echotime
  1916. else
  1917. cycle:
  1918. $(MAKE) OS_TARGET=$(OS_SOURCE) CROSSBINDIR="" BINUTILSPREFIX="" CROSSCYCLEBOOTSTRAP=1 rtlclean rtl
  1919. $(MAKE) OS_TARGET=$(OS_SOURCE) EXENAME=$(TEMPNAME) CROSSBINDIR="" BINUTILSPREFIX="" CROSSCYCLEBOOTSTRAP=1 clean compiler
  1920. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' OS_TARGET=$(OS_SOURCE) CROSSBINDIR="" BINUTILSPREFIX="" CROSSCYCLEBOOTSTRAP=1 rtlclean rtl
  1921. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' OS_TARGET=$(OS_SOURCE) EXENAME=$(PPCROSSNAME) CROSSBINDIR="" BINUTILSPREFIX="" CROSSCYCLEBOOTSTRAP=1 clean compiler
  1922. $(MAKE) 'FPC=$(BASEDIR)/$(PPCROSSNAME)' rtlclean rtl
  1923. $(MAKE) 'FPC=$(BASEDIR)/$(PPCROSSNAME)' clean compiler
  1924. endif
  1925. else
  1926. cycle:
  1927. $(MAKE) OS_TARGET=$(OS_SOURCE) CPU_TARGET=$(CPU_SOURCE) CROSSBINDIR="" BINUTILSPREFIX="" CROSSCYCLEBOOTSTRAP=1 rtlclean rtl
  1928. $(MAKE) OS_TARGET=$(OS_SOURCE) CPU_TARGET=$(CPU_SOURCE) EXENAME=$(TEMPNAME) CROSSBINDIR="" BINUTILSPREFIX="" CROSSCYCLEBOOTSTRAP=1 clean compiler
  1929. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' OS_TARGET=$(OS_SOURCE) CPU_TARGET=$(CPU_SOURCE) CROSSBINDIR="" BINUTILSPREFIX="" CROSSCYCLEBOOTSTRAP=1 rtlclean rtl
  1930. $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' OS_TARGET=$(OS_SOURCE) CPU_TARGET=$(CPU_SOURCE) PPC_TARGET=$(CPU_TARGET) EXENAME=$(PPCROSSNAME) CROSSBINDIR="" BINUTILSPREFIX="" CROSSCYCLEBOOTSTRAP=1 clean compiler
  1931. $(MAKE) 'FPC=$(BASEDIR)/$(PPCROSSNAME)' rtlclean rtl
  1932. $(MAKE) 'FPC=$(BASEDIR)/$(PPCROSSNAME)' clean compiler
  1933. endif
  1934. cycledep:
  1935. $(MAKE) cycle USEDEPEND=1
  1936. extcycle:
  1937. $(MAKE) cycle OPT='-n -OG2p3 -gl -CRriot -dEXTDEBUG'
  1938. cvstest:
  1939. $(MAKE) cycle 'LOCALOPT=-n -Se' 'RTLOPTS=-n -Se'
  1940. full: fullcycle
  1941. fullcycle:
  1942. $(MAKE) cycle
  1943. $(MAKE) ppuclean
  1944. $(MAKE) $(filter-out $(PPC_TARGET),$(CYCLETARGETS)) 'FPC=$(BASEDIR)/$(EXENAME)'
  1945. htmldocs:
  1946. $(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
  1947. .PHONY: quickinstall install installsym
  1948. MSGINSTALLDIR=$(INSTALL_BASEDIR)/msg
  1949. override PPEXEFILE:=$(wildcard $(EXENAME))
  1950. ifdef UNIXHier
  1951. ifdef CROSSCOMPILE
  1952. PPCCPULOCATION= $(INSTALL_BINDIR)
  1953. PPCCROSSLOCATION=$(INSTALL_BASEDIR)/cross/$(FULL_TARGET)
  1954. else
  1955. PPCCPULOCATION= $(INSTALL_BASEDIR)
  1956. endif
  1957. else
  1958. ifdef CROSSCOMPILE
  1959. PPCCPULOCATION= $(INSTALL_BINDIR)
  1960. PPCCROSSLOCATION=$(INSTALL_BINDIR)/cross/$(FULL_TARGET)
  1961. else
  1962. PPCCPULOCATION= $(INSTALL_BINDIR)
  1963. endif
  1964. endif
  1965. quickinstall: $(addsuffix _install,$(TARGET_DIRS))
  1966. ifneq ($(PPEXEFILE),)
  1967. ifdef UPXPROG
  1968. -$(UPXPROG) $(EXENAME)
  1969. endif
  1970. $(MKDIR) $(PPCCPULOCATION)
  1971. $(INSTALLEXE) $(EXENAME) $(PPCCPULOCATION)
  1972. ifdef CROSSCOMPILE
  1973. $(MKDIR) $(PPCCROSSLOCATION)
  1974. $(ECHO) $(PPCROSSNAME)
  1975. $(ECHO $(PPCCROSSLOCATION)
  1976. $(INSTALLEXE) $(PPCROSSNAME) $(PPCCROSSLOCATION)
  1977. endif
  1978. endif
  1979. install: quickinstall
  1980. ifdef UNIXHier
  1981. $(MKDIR) $(INSTALL_BASEDIR)
  1982. $(INSTALLEXE) $(COMPILERUTILSDIR)/samplecfg $(INSTALL_BASEDIR)/samplecfg
  1983. endif
  1984. $(MKDIR) $(MSGINSTALLDIR)
  1985. $(INSTALL) $(MSGFILES) $(MSGINSTALLDIR)
  1986. installsymlink: install
  1987. ifdef UNIXHier
  1988. $(MKDIR) $(INSTALL_BINDIR)
  1989. ln -sf $(INSTALL_BASEDIR)/$(EXENAME) $(INSTALL_BINDIR)/$(EXENAME)
  1990. endif
  1991. .PHONY: rtl rtlclean rtlinstall
  1992. rtl:
  1993. $(MAKE) -C $(UNITDIR_RTL) 'OPT=$(RTLOPTS)' all
  1994. rtlclean:
  1995. $(MAKE) -C $(UNITDIR_RTL) clean
  1996. rtlinstall:
  1997. $(MAKE) -C $(UNITDIR_RTL) install
  1998. localmake:=$(strip $(wildcard makefile.loc))
  1999. ifdef localmake
  2000. include ./$(localmake)
  2001. endif