Makefile 34 KB

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