Makefile 38 KB

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