Makefile 43 KB

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