Makefile 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396
  1. #
  2. # Don't edit, this file is generated by FPCMake Version 1.1 [2004/01/11]
  3. #
  4. default: all
  5. MAKEFILETARGETS=darwin
  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 OS_TARGET_DEFAULT=darwin
  95. override DEFAULT_FPCDIR=../..
  96. ifndef FPC
  97. ifdef PP
  98. FPC=$(PP)
  99. endif
  100. endif
  101. ifndef FPC
  102. FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
  103. ifneq ($(FPCPROG),)
  104. FPCPROG:=$(firstword $(FPCPROG))
  105. FPC:=$(shell $(FPCPROG) -PB)
  106. ifneq ($(findstring Error,$(FPC)),)
  107. override FPC=ppc386
  108. endif
  109. else
  110. override FPC=ppc386
  111. endif
  112. endif
  113. override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
  114. override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
  115. ifndef FPC_VERSION
  116. FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
  117. FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
  118. endif
  119. export FPC FPC_VERSION FPC_COMPILERINFO
  120. unexport CHECKDEPEND ALLDEPENDENCIES
  121. ifndef CPU_TARGET
  122. ifdef CPU_TARGET_DEFAULT
  123. CPU_TARGET=$(CPU_TARGET_DEFAULT)
  124. endif
  125. endif
  126. ifndef OS_TARGET
  127. ifdef OS_TARGET_DEFAULT
  128. OS_TARGET=$(OS_TARGET_DEFAULT)
  129. endif
  130. endif
  131. ifneq ($(words $(FPC_COMPILERINFO)),5)
  132. FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
  133. FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
  134. FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
  135. FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
  136. endif
  137. ifndef CPU_SOURCE
  138. CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
  139. endif
  140. ifndef CPU_TARGET
  141. CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
  142. endif
  143. ifndef OS_SOURCE
  144. OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
  145. endif
  146. ifndef OS_TARGET
  147. OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
  148. endif
  149. FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
  150. FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
  151. ifneq ($(FULL_TARGET),$(FULL_SOURCE))
  152. CROSSCOMPILE=1
  153. endif
  154. ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
  155. ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
  156. $(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
  157. endif
  158. endif
  159. export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
  160. ifdef FPCDIR
  161. override FPCDIR:=$(subst \,/,$(FPCDIR))
  162. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  163. override FPCDIR=wrong
  164. endif
  165. else
  166. override FPCDIR=wrong
  167. endif
  168. ifdef DEFAULT_FPCDIR
  169. ifeq ($(FPCDIR),wrong)
  170. override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
  171. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  172. override FPCDIR=wrong
  173. endif
  174. endif
  175. endif
  176. ifeq ($(FPCDIR),wrong)
  177. ifdef inUnix
  178. override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
  179. ifeq ($(wildcard $(FPCDIR)/units),)
  180. override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
  181. endif
  182. else
  183. override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
  184. override FPCDIR:=$(FPCDIR)/..
  185. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  186. override FPCDIR:=$(FPCDIR)/..
  187. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  188. override FPCDIR=c:/pp
  189. endif
  190. endif
  191. endif
  192. endif
  193. ifndef CROSSDIR
  194. CROSSDIR:=$(FPCDIR)/cross/$(FULL_TARGET)
  195. endif
  196. ifndef CROSSTARGETDIR
  197. CROSSTARGETDIR=$(CROSSDIR)/$(FULL_TARGET)
  198. endif
  199. ifdef CROSSCOMPILE
  200. UNITSDIR:=$(wildcard $(CROSSTARGETDIR)/units)
  201. ifeq ($(UNITSDIR),)
  202. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
  203. endif
  204. else
  205. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
  206. endif
  207. PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
  208. override PACKAGE_NAME=rtl
  209. RTL=..
  210. INC=$(RTL)/inc
  211. PROCINC=$(RTL)/$(CPU_TARGET)
  212. BSDINC=$(RTL)/bsd
  213. BSDPROCINC=$(BSDINC)/$(CPU_TARGET)
  214. OSPROCINC=$(RTL)/darwin/$(CPU_TARGET)
  215. UNIXINC=$(RTL)/unix
  216. UNITPREFIX=rtl
  217. ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
  218. SYSTEMUNIT=system
  219. override FPCOPT+=-dNOMOUSE
  220. else
  221. SYSTEMUNIT="Error: Darwin is not supported for 1.0"
  222. endif
  223. ifdef RELEASE
  224. override FPCOPT+=-Ur
  225. endif
  226. override FPCOPT+=-dFPC_USE_LIBC
  227. OBJPASDIR=$(RTL)/objpas
  228. GRAPHDIR=$(INC)/graph
  229. ifndef USELIBGGI
  230. USELIBGGI=NO
  231. endif
  232. override TARGET_UNITS+=$(SYSTEMUNIT) objpas strings sysctl baseunix unixutil unix initc dos dl objects printer sysutils typinfo systhrds classes math varutils charset ucomplex getopts heaptrc lineinfo errors terminfo termio video crt mouse keyboard console variants types sysctl dateutils sysconst cthreads strutils rtlconst
  233. override TARGET_RSTS+=math varutils typinfo classes variants dateutils systhrds sysconst rtlconst
  234. override INSTALL_FPCPACKAGE=y
  235. override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(BSDINC) $(BSDPROCINC) $(OSPROCINC)
  236. override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(BSDINC)
  237. override COMPILER_TARGETDIR+=.
  238. ifdef REQUIRE_UNITSDIR
  239. override UNITSDIR+=$(REQUIRE_UNITSDIR)
  240. endif
  241. ifdef REQUIRE_PACKAGESDIR
  242. override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
  243. endif
  244. ifdef ZIPINSTALL
  245. ifeq ($(OS_TARGET),linux)
  246. UNIXINSTALLDIR=1
  247. endif
  248. ifeq ($(OS_TARGET),freebsd)
  249. UNIXINSTALLDIR=1
  250. endif
  251. ifeq ($(OS_TARGET),netbsd)
  252. UNIXINSTALLDIR=1
  253. endif
  254. ifeq ($(OS_TARGET),openbsd)
  255. UNIXINSTALLDIR=1
  256. endif
  257. ifeq ($(OS_TARGET),sunos)
  258. UNIXINSTALLDIR=1
  259. endif
  260. ifeq ($(OS_TARGET),qnx)
  261. UNIXINSTALLDIR=1
  262. endif
  263. else
  264. ifeq ($(OS_SOURCE),linux)
  265. UNIXINSTALLDIR=1
  266. endif
  267. ifeq ($(OS_SOURCE),freebsd)
  268. UNIXINSTALLDIR=1
  269. endif
  270. ifeq ($(OS_SOURCE),netbsd)
  271. UNIXINSTALLDIR=1
  272. endif
  273. ifeq ($(OS_SOURCE),openbsd)
  274. UNIXINSTALLDIR=1
  275. endif
  276. ifeq ($(OS_TARGET),sunos)
  277. UNIXINSTALLDIR=1
  278. endif
  279. ifeq ($(OS_TARGET),qnx)
  280. UNIXINSTALLDIR=1
  281. endif
  282. endif
  283. ifndef INSTALL_PREFIX
  284. ifdef PREFIX
  285. INSTALL_PREFIX=$(PREFIX)
  286. endif
  287. endif
  288. ifndef INSTALL_PREFIX
  289. ifdef UNIXINSTALLDIR
  290. INSTALL_PREFIX=/usr/local
  291. else
  292. ifdef INSTALL_FPCPACKAGE
  293. INSTALL_BASEDIR:=/pp
  294. else
  295. INSTALL_BASEDIR:=/$(PACKAGE_NAME)
  296. endif
  297. endif
  298. endif
  299. export INSTALL_PREFIX
  300. ifdef INSTALL_FPCSUBDIR
  301. export INSTALL_FPCSUBDIR
  302. endif
  303. ifndef DIST_DESTDIR
  304. DIST_DESTDIR:=$(BASEDIR)
  305. endif
  306. export DIST_DESTDIR
  307. ifndef INSTALL_BASEDIR
  308. ifdef UNIXINSTALLDIR
  309. ifdef INSTALL_FPCPACKAGE
  310. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
  311. else
  312. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
  313. endif
  314. else
  315. INSTALL_BASEDIR:=$(INSTALL_PREFIX)
  316. endif
  317. endif
  318. ifndef INSTALL_BINDIR
  319. ifdef UNIXINSTALLDIR
  320. ifdef CROSSCOMPILE
  321. INSTALL_BINDIR:=$(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/bin
  322. else
  323. INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
  324. endif
  325. else
  326. ifdef CROSSCOMPILE
  327. INSTALL_BINDIR:=$(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/bin
  328. else
  329. INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
  330. endif
  331. ifdef INSTALL_FPCPACKAGE
  332. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)
  333. endif
  334. endif
  335. endif
  336. ifndef INSTALL_UNITDIR
  337. ifdef CROSSCOMPILE
  338. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/units
  339. else
  340. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(OS_TARGET)
  341. endif
  342. ifdef INSTALL_FPCPACKAGE
  343. ifdef PACKAGE_NAME
  344. INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
  345. endif
  346. endif
  347. endif
  348. ifndef INSTALL_LIBDIR
  349. ifdef UNIXINSTALLDIR
  350. INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
  351. else
  352. INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
  353. endif
  354. endif
  355. ifndef INSTALL_SOURCEDIR
  356. ifdef UNIXINSTALLDIR
  357. ifdef BSDhier
  358. SRCPREFIXDIR=share/src
  359. else
  360. SRCPREFIXDIR=src
  361. endif
  362. ifdef INSTALL_FPCPACKAGE
  363. ifdef INSTALL_FPCSUBDIR
  364. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  365. else
  366. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  367. endif
  368. else
  369. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  370. endif
  371. else
  372. ifdef INSTALL_FPCPACKAGE
  373. ifdef INSTALL_FPCSUBDIR
  374. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  375. else
  376. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
  377. endif
  378. else
  379. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
  380. endif
  381. endif
  382. endif
  383. ifndef INSTALL_DOCDIR
  384. ifdef UNIXINSTALLDIR
  385. ifdef BSDhier
  386. DOCPREFIXDIR=share/doc
  387. else
  388. DOCPREFIXDIR=doc
  389. endif
  390. ifdef INSTALL_FPCPACKAGE
  391. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  392. else
  393. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  394. endif
  395. else
  396. ifdef INSTALL_FPCPACKAGE
  397. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
  398. else
  399. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
  400. endif
  401. endif
  402. endif
  403. ifndef INSTALL_EXAMPLEDIR
  404. ifdef UNIXINSTALLDIR
  405. ifdef INSTALL_FPCPACKAGE
  406. ifdef BSDhier
  407. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  408. else
  409. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
  410. endif
  411. else
  412. ifdef BSDhier
  413. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  414. else
  415. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  416. endif
  417. endif
  418. else
  419. ifdef INSTALL_FPCPACKAGE
  420. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
  421. else
  422. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
  423. endif
  424. endif
  425. endif
  426. ifndef INSTALL_DATADIR
  427. INSTALL_DATADIR=$(INSTALL_BASEDIR)
  428. endif
  429. ifdef CROSSCOMPILE
  430. ifndef CROSSBINDIR
  431. CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(FULL_SOURCE))
  432. ifeq ($(CROSSBINDIR),)
  433. CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/bin/$(FULL_SOURCE))
  434. endif
  435. endif
  436. else
  437. CROSSBINDIR=
  438. endif
  439. LOADEREXT=.as
  440. EXEEXT=.exe
  441. PPLEXT=.ppl
  442. PPUEXT=.ppu
  443. OEXT=.o
  444. ASMEXT=.s
  445. SMARTEXT=.sl
  446. STATICLIBEXT=.a
  447. SHAREDLIBEXT=.so
  448. STATICLIBPREFIX=libp
  449. RSTEXT=.rst
  450. FPCMADE=fpcmade
  451. ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
  452. ifeq ($(OS_TARGET),go32v1)
  453. STATICLIBPREFIX=
  454. FPCMADE=fpcmade.v1
  455. PACKAGESUFFIX=v1
  456. endif
  457. ifeq ($(OS_TARGET),go32v2)
  458. STATICLIBPREFIX=
  459. FPCMADE=fpcmade.dos
  460. ZIPSUFFIX=go32
  461. endif
  462. ifeq ($(OS_TARGET),watcom)
  463. STATICLIBPREFIX=
  464. FPCMADE=fpcmade.wat
  465. ZIPSUFFIX=watc
  466. OEXT=.obj
  467. ASMEXT=.asm
  468. SHAREDLIBEXT=.dll
  469. endif
  470. ifeq ($(OS_TARGET),linux)
  471. EXEEXT=
  472. HASSHAREDLIB=1
  473. FPCMADE=fpcmade.lnx
  474. ZIPSUFFIX=linux
  475. endif
  476. ifeq ($(OS_TARGET),freebsd)
  477. EXEEXT=
  478. HASSHAREDLIB=1
  479. FPCMADE=fpcmade.freebsd
  480. ZIPSUFFIX=freebsd
  481. endif
  482. ifeq ($(OS_TARGET),netbsd)
  483. EXEEXT=
  484. HASSHAREDLIB=1
  485. FPCMADE=fpcmade.netbsd
  486. ZIPSUFFIX=netbsd
  487. endif
  488. ifeq ($(OS_TARGET),openbsd)
  489. EXEEXT=
  490. HASSHAREDLIB=1
  491. FPCMADE=fpcmade.openbsd
  492. ZIPSUFFIX=openbsd
  493. endif
  494. ifeq ($(OS_TARGET),win32)
  495. SHAREDLIBEXT=.dll
  496. FPCMADE=fpcmade.w32
  497. ZIPSUFFIX=w32
  498. endif
  499. ifeq ($(OS_TARGET),os2)
  500. AOUTEXT=.out
  501. STATICLIBPREFIX=
  502. SHAREDLIBEXT=.dll
  503. FPCMADE=fpcmade.os2
  504. ZIPSUFFIX=os2
  505. ECHO=echo
  506. endif
  507. ifeq ($(OS_TARGET),emx)
  508. AOUTEXT=.out
  509. STATICLIBPREFIX=
  510. SHAREDLIBEXT=.dll
  511. FPCMADE=fpcmade.emx
  512. ZIPSUFFIX=emx
  513. ECHO=echo
  514. endif
  515. ifeq ($(OS_TARGET),amiga)
  516. EXEEXT=
  517. SHAREDLIBEXT=.library
  518. FPCMADE=fpcmade.amg
  519. endif
  520. ifeq ($(OS_TARGET),atari)
  521. EXEEXT=.ttp
  522. FPCMADE=fpcmade.ata
  523. endif
  524. ifeq ($(OS_TARGET),beos)
  525. EXEEXT=
  526. FPCMADE=fpcmade.be
  527. ZIPSUFFIX=be
  528. endif
  529. ifeq ($(OS_TARGET),sunos)
  530. EXEEXT=
  531. FPCMADE=fpcmade.sun
  532. ZIPSUFFIX=sun
  533. endif
  534. ifeq ($(OS_TARGET),qnx)
  535. EXEEXT=
  536. FPCMADE=fpcmade.qnx
  537. ZIPSUFFIX=qnx
  538. endif
  539. ifeq ($(OS_TARGET),netware)
  540. EXEEXT=.nlm
  541. STATICLIBPREFIX=
  542. FPCMADE=fpcmade.nw
  543. ZIPSUFFIX=nw
  544. endif
  545. ifeq ($(OS_TARGET),macos)
  546. EXEEXT=
  547. FPCMADE=fpcmade.mcc
  548. endif
  549. ifeq ($(OS_TARGET),darwin)
  550. EXEEXT=
  551. HASSHAREDLIB=1
  552. FPCMADE=fpcmade.darwin
  553. ZIPSUFFIX=darwin
  554. endif
  555. else
  556. ifeq ($(OS_TARGET),go32v1)
  557. PPUEXT=.pp1
  558. OEXT=.o1
  559. ASMEXT=.s1
  560. SMARTEXT=.sl1
  561. STATICLIBEXT=.a1
  562. SHAREDLIBEXT=.so1
  563. STATICLIBPREFIX=
  564. FPCMADE=fpcmade.v1
  565. PACKAGESUFFIX=v1
  566. endif
  567. ifeq ($(OS_TARGET),go32v2)
  568. STATICLIBPREFIX=
  569. FPCMADE=fpcmade.dos
  570. ZIPSUFFIX=go32
  571. endif
  572. ifeq ($(OS_TARGET),watcom)
  573. STATICLIBPREFIX=
  574. FPCMADE=fpcmade.dos
  575. ZIPSUFFIX=watcom
  576. endif
  577. ifeq ($(OS_TARGET),linux)
  578. EXEEXT=
  579. HASSHAREDLIB=1
  580. FPCMADE=fpcmade.lnx
  581. ZIPSUFFIX=linux
  582. endif
  583. ifeq ($(OS_TARGET),freebsd)
  584. EXEEXT=
  585. HASSHAREDLIB=1
  586. FPCMADE=fpcmade.freebsd
  587. ZIPSUFFIX=freebsd
  588. endif
  589. ifeq ($(OS_TARGET),netbsd)
  590. EXEEXT=
  591. HASSHAREDLIB=1
  592. FPCMADE=fpcmade.netbsd
  593. ZIPSUFFIX=netbsd
  594. endif
  595. ifeq ($(OS_TARGET),openbsd)
  596. EXEEXT=
  597. HASSHAREDLIB=1
  598. FPCMADE=fpcmade.openbsd
  599. ZIPSUFFIX=openbsd
  600. endif
  601. ifeq ($(OS_TARGET),win32)
  602. PPUEXT=.ppw
  603. OEXT=.ow
  604. ASMEXT=.sw
  605. SMARTEXT=.slw
  606. STATICLIBEXT=.aw
  607. SHAREDLIBEXT=.dll
  608. FPCMADE=fpcmade.w32
  609. ZIPSUFFIX=w32
  610. endif
  611. ifeq ($(OS_TARGET),os2)
  612. PPUEXT=.ppo
  613. ASMEXT=.so2
  614. OEXT=.oo2
  615. AOUTEXT=.out
  616. SMARTEXT=.sl2
  617. STATICLIBPREFIX=
  618. STATICLIBEXT=.ao2
  619. SHAREDLIBEXT=.dll
  620. FPCMADE=fpcmade.os2
  621. ZIPSUFFIX=emx
  622. ECHO=echo
  623. endif
  624. ifeq ($(OS_TARGET),amiga)
  625. EXEEXT=
  626. PPUEXT=.ppu
  627. ASMEXT=.asm
  628. OEXT=.o
  629. SMARTEXT=.sl
  630. STATICLIBEXT=.a
  631. SHAREDLIBEXT=.library
  632. FPCMADE=fpcmade.amg
  633. endif
  634. ifeq ($(OS_TARGET),atari)
  635. PPUEXT=.ppu
  636. ASMEXT=.s
  637. OEXT=.o
  638. SMARTEXT=.sl
  639. STATICLIBEXT=.a
  640. EXEEXT=.ttp
  641. FPCMADE=fpcmade.ata
  642. endif
  643. ifeq ($(OS_TARGET),beos)
  644. PPUEXT=.ppu
  645. ASMEXT=.s
  646. OEXT=.o
  647. SMARTEXT=.sl
  648. STATICLIBEXT=.a
  649. EXEEXT=
  650. FPCMADE=fpcmade.be
  651. ZIPSUFFIX=be
  652. endif
  653. ifeq ($(OS_TARGET),sunos)
  654. PPUEXT=.ppu
  655. ASMEXT=.s
  656. OEXT=.o
  657. SMARTEXT=.sl
  658. STATICLIBEXT=.a
  659. EXEEXT=
  660. FPCMADE=fpcmade.sun
  661. ZIPSUFFIX=sun
  662. endif
  663. ifeq ($(OS_TARGET),qnx)
  664. PPUEXT=.ppu
  665. ASMEXT=.s
  666. OEXT=.o
  667. SMARTEXT=.sl
  668. STATICLIBEXT=.a
  669. EXEEXT=
  670. FPCMADE=fpcmade.qnx
  671. ZIPSUFFIX=qnx
  672. endif
  673. ifeq ($(OS_TARGET),netware)
  674. STATICLIBPREFIX=
  675. PPUEXT=.ppu
  676. OEXT=.o
  677. ASMEXT=.s
  678. SMARTEXT=.sl
  679. STATICLIBEXT=.a
  680. SHAREDLIBEXT=.nlm
  681. FPCMADE=fpcmade.nw
  682. ZIPSUFFIX=nw
  683. EXEEXT=.nlm
  684. endif
  685. ifeq ($(OS_TARGET),macos)
  686. PPUEXT=.ppu
  687. ASMEXT=.s
  688. OEXT=.o
  689. SMARTEXT=.sl
  690. STATICLIBEXT=.a
  691. EXEEXT=
  692. FPCMADE=fpcmade.mcc
  693. endif
  694. endif
  695. ifndef ECHO
  696. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  697. ifeq ($(ECHO),)
  698. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  699. ifeq ($(ECHO),)
  700. ECHO=
  701. else
  702. ECHO:=$(firstword $(ECHO))
  703. endif
  704. else
  705. ECHO:=$(firstword $(ECHO))
  706. endif
  707. endif
  708. export ECHO
  709. ifndef DATE
  710. DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
  711. ifeq ($(DATE),)
  712. DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
  713. ifeq ($(DATE),)
  714. DATE=
  715. else
  716. DATE:=$(firstword $(DATE))
  717. endif
  718. else
  719. DATE:=$(firstword $(DATE))
  720. endif
  721. endif
  722. export DATE
  723. ifndef GINSTALL
  724. GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
  725. ifeq ($(GINSTALL),)
  726. GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
  727. ifeq ($(GINSTALL),)
  728. GINSTALL=
  729. else
  730. GINSTALL:=$(firstword $(GINSTALL))
  731. endif
  732. else
  733. GINSTALL:=$(firstword $(GINSTALL))
  734. endif
  735. endif
  736. export GINSTALL
  737. ifndef CPPROG
  738. CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
  739. ifeq ($(CPPROG),)
  740. CPPROG=
  741. else
  742. CPPROG:=$(firstword $(CPPROG))
  743. endif
  744. endif
  745. export CPPROG
  746. ifndef RMPROG
  747. RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
  748. ifeq ($(RMPROG),)
  749. RMPROG=
  750. else
  751. RMPROG:=$(firstword $(RMPROG))
  752. endif
  753. endif
  754. export RMPROG
  755. ifndef MVPROG
  756. MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
  757. ifeq ($(MVPROG),)
  758. MVPROG=
  759. else
  760. MVPROG:=$(firstword $(MVPROG))
  761. endif
  762. endif
  763. export MVPROG
  764. ifndef ECHOREDIR
  765. ifndef inUnix
  766. ECHOREDIR=echo
  767. else
  768. ECHOREDIR=$(ECHO)
  769. endif
  770. endif
  771. ifndef COPY
  772. COPY:=$(CPPROG) -fp
  773. endif
  774. ifndef COPYTREE
  775. COPYTREE:=$(CPPROG) -rfp
  776. endif
  777. ifndef MOVE
  778. MOVE:=$(MVPROG) -f
  779. endif
  780. ifndef DEL
  781. DEL:=$(RMPROG) -f
  782. endif
  783. ifndef DELTREE
  784. DELTREE:=$(RMPROG) -rf
  785. endif
  786. ifndef INSTALL
  787. ifdef inUnix
  788. INSTALL:=$(GINSTALL) -c -m 644
  789. else
  790. INSTALL:=$(COPY)
  791. endif
  792. endif
  793. ifndef INSTALLEXE
  794. ifdef inUnix
  795. INSTALLEXE:=$(GINSTALL) -c -m 755
  796. else
  797. INSTALLEXE:=$(COPY)
  798. endif
  799. endif
  800. ifndef MKDIR
  801. MKDIR:=$(GINSTALL) -m 755 -d
  802. endif
  803. export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
  804. ifndef PPUMOVE
  805. PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
  806. ifeq ($(PPUMOVE),)
  807. PPUMOVE=
  808. else
  809. PPUMOVE:=$(firstword $(PPUMOVE))
  810. endif
  811. endif
  812. export PPUMOVE
  813. ifndef FPCMAKE
  814. FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
  815. ifeq ($(FPCMAKE),)
  816. FPCMAKE=
  817. else
  818. FPCMAKE:=$(firstword $(FPCMAKE))
  819. endif
  820. endif
  821. export FPCMAKE
  822. ifndef ZIPPROG
  823. ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
  824. ifeq ($(ZIPPROG),)
  825. ZIPPROG=
  826. else
  827. ZIPPROG:=$(firstword $(ZIPPROG))
  828. endif
  829. endif
  830. export ZIPPROG
  831. ifndef TARPROG
  832. TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
  833. ifeq ($(TARPROG),)
  834. TARPROG=
  835. else
  836. TARPROG:=$(firstword $(TARPROG))
  837. endif
  838. endif
  839. export TARPROG
  840. ASNAME=$(BINUTILSPREFIX)as
  841. LDNAME=$(BINUTILSPREFIX)ld
  842. ARNAME=$(BINUTILSPREFIX)ar
  843. RCNAME=$(BINUTILSPREFIX)rc
  844. ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
  845. ifeq ($(OS_TARGET),win32)
  846. ASNAME=as
  847. LDNAME=ld
  848. ARNAME=ar
  849. endif
  850. endif
  851. ifndef ASPROG
  852. ifdef CROSSBINDIR
  853. ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
  854. else
  855. ASPROG=$(ASNAME)
  856. endif
  857. endif
  858. ifndef LDPROG
  859. ifdef CROSSBINDIR
  860. LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
  861. else
  862. LDPROG=$(LDNAME)
  863. endif
  864. endif
  865. ifndef RCPROG
  866. ifdef CROSSBINDIR
  867. RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
  868. else
  869. RCPROG=$(RCNAME)
  870. endif
  871. endif
  872. ifndef ARPROG
  873. ifdef CROSSBINDIR
  874. ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
  875. else
  876. ARPROG=$(ARNAME)
  877. endif
  878. endif
  879. AS=$(ASPROG)
  880. LD=$(LDPROG)
  881. RC=$(RCPROG)
  882. AR=$(ARPROG)
  883. PPAS=ppas$(BATCHEXT)
  884. ifdef inUnix
  885. LDCONFIG=ldconfig
  886. else
  887. LDCONFIG=
  888. endif
  889. ifdef DATE
  890. DATESTR:=$(shell $(DATE) +%Y%m%d)
  891. else
  892. DATESTR=
  893. endif
  894. ifndef UPXPROG
  895. ifeq ($(OS_TARGET),go32v2)
  896. UPXPROG:=1
  897. endif
  898. ifeq ($(OS_TARGET),win32)
  899. UPXPROG:=1
  900. endif
  901. ifdef UPXPROG
  902. UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
  903. ifeq ($(UPXPROG),)
  904. UPXPROG=
  905. else
  906. UPXPROG:=$(firstword $(UPXPROG))
  907. endif
  908. else
  909. UPXPROG=
  910. endif
  911. endif
  912. export UPXPROG
  913. ZIPOPT=-9
  914. ZIPEXT=.zip
  915. ifeq ($(USETAR),bz2)
  916. TAROPT=vI
  917. TAREXT=.tar.bz2
  918. else
  919. TAROPT=vz
  920. TAREXT=.tar.gz
  921. endif
  922. ifndef NOCPUDEF
  923. override FPCOPTDEF=$(CPU_TARGET)
  924. endif
  925. ifneq ($(OS_TARGET),$(OS_SOURCE))
  926. override FPCOPT+=-T$(OS_TARGET)
  927. endif
  928. ifeq ($(OS_SOURCE),openbsd)
  929. override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
  930. endif
  931. ifndef CROSSBOOTSTRAP
  932. ifneq ($(BINUTILSPREFIX),)
  933. override FPCOPT+=-XP$(BINUTILSPREFIX) -Xc
  934. endif
  935. ifneq ($(BINUTILSPREFIX),)
  936. override FPCOPT+=-Xr$(RLINKPATH)
  937. endif
  938. endif
  939. ifdef UNITDIR
  940. override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
  941. endif
  942. ifdef LIBDIR
  943. override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
  944. endif
  945. ifdef OBJDIR
  946. override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
  947. endif
  948. ifdef INCDIR
  949. override FPCOPT+=$(addprefix -Fi,$(INCDIR))
  950. endif
  951. ifdef LINKSMART
  952. override FPCOPT+=-XX
  953. endif
  954. ifdef CREATESMART
  955. override FPCOPT+=-CX
  956. endif
  957. ifdef DEBUG
  958. override FPCOPT+=-gl
  959. override FPCOPTDEF+=DEBUG
  960. endif
  961. ifdef RELEASE
  962. ifeq ($(CPU_TARGET),i386)
  963. FPCCPUOPT:=-OG2p3
  964. else
  965. FPCCPUOPT:=
  966. endif
  967. override FPCOPT+=-Xs $(FPCCPUOPT) -n
  968. override FPCOPTDEF+=RELEASE
  969. endif
  970. ifdef STRIP
  971. override FPCOPT+=-Xs
  972. endif
  973. ifdef OPTIMIZE
  974. ifeq ($(CPU_TARGET),i386)
  975. override FPCOPT+=-OG2p3
  976. endif
  977. endif
  978. ifdef VERBOSE
  979. override FPCOPT+=-vwni
  980. endif
  981. ifdef COMPILER_OPTIONS
  982. override FPCOPT+=$(COMPILER_OPTIONS)
  983. endif
  984. ifdef COMPILER_UNITDIR
  985. override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
  986. endif
  987. ifdef COMPILER_LIBRARYDIR
  988. override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
  989. endif
  990. ifdef COMPILER_OBJECTDIR
  991. override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
  992. endif
  993. ifdef COMPILER_INCLUDEDIR
  994. override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
  995. endif
  996. ifdef CROSSBINDIR
  997. override FPCOPT+=-FD$(CROSSBINDIR)
  998. endif
  999. ifdef COMPILER_TARGETDIR
  1000. override FPCOPT+=-FE$(COMPILER_TARGETDIR)
  1001. ifeq ($(COMPILER_TARGETDIR),.)
  1002. override TARGETDIRPREFIX=
  1003. else
  1004. override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
  1005. endif
  1006. endif
  1007. ifdef COMPILER_UNITTARGETDIR
  1008. override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
  1009. ifeq ($(COMPILER_UNITTARGETDIR),.)
  1010. override UNITTARGETDIRPREFIX=
  1011. else
  1012. override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
  1013. endif
  1014. else
  1015. ifdef COMPILER_TARGETDIR
  1016. override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
  1017. override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
  1018. endif
  1019. endif
  1020. ifeq ($(OS_TARGET),linux)
  1021. ifeq ($(FPC_VERSION),1.0.6)
  1022. override FPCOPTDEF+=HASUNIX
  1023. endif
  1024. endif
  1025. ifdef OPT
  1026. override FPCOPT+=$(OPT)
  1027. endif
  1028. ifdef FPCOPTDEF
  1029. override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
  1030. endif
  1031. ifdef CFGFILE
  1032. override FPCOPT+=@$(CFGFILE)
  1033. endif
  1034. ifdef USEENV
  1035. override FPCEXTCMD:=$(FPCOPT)
  1036. override FPCOPT:=!FPCEXTCMD
  1037. export FPCEXTCMD
  1038. endif
  1039. override COMPILER:=$(FPC) $(FPCOPT)
  1040. ifeq (,$(findstring -s ,$(COMPILER)))
  1041. EXECPPAS=
  1042. else
  1043. ifeq ($(FULL_SOURCE),$(FULL_TARGET))
  1044. EXECPPAS:=@$(PPAS)
  1045. endif
  1046. endif
  1047. .PHONY: fpc_units
  1048. ifdef TARGET_UNITS
  1049. override ALLTARGET+=fpc_units
  1050. override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
  1051. override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
  1052. override INSTALLPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
  1053. override CLEANPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
  1054. endif
  1055. fpc_units: $(UNITPPUFILES)
  1056. ifdef TARGET_RSTS
  1057. override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
  1058. override CLEANRSTFILES+=$(RSTFILES)
  1059. endif
  1060. .PHONY: fpc_all fpc_smart fpc_debug fpc_release
  1061. $(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
  1062. @$(ECHOREDIR) Compiled > $(FPCMADE)
  1063. fpc_all: $(FPCMADE)
  1064. fpc_smart:
  1065. $(MAKE) all LINKSMART=1 CREATESMART=1
  1066. fpc_debug:
  1067. $(MAKE) all DEBUG=1
  1068. fpc_release:
  1069. $(MAKE) all RELEASE=1
  1070. .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .dpr .pp .rc .res
  1071. %$(PPUEXT): %.pp
  1072. $(COMPILER) $<
  1073. $(EXECPPAS)
  1074. %$(PPUEXT): %.pas
  1075. $(COMPILER) $<
  1076. $(EXECPPAS)
  1077. %$(EXEEXT): %.pp
  1078. $(COMPILER) $<
  1079. $(EXECPPAS)
  1080. %$(EXEEXT): %.pas
  1081. $(COMPILER) $<
  1082. $(EXECPPAS)
  1083. %$(EXEEXT): %.dpr
  1084. $(COMPILER) $<
  1085. $(EXECPPAS)
  1086. %.res: %.rc
  1087. windres -i $< -o $@
  1088. vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  1089. vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  1090. vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  1091. vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
  1092. .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
  1093. ifdef INSTALL_UNITS
  1094. override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
  1095. endif
  1096. ifdef INSTALL_BUILDUNIT
  1097. override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
  1098. endif
  1099. ifdef INSTALLPPUFILES
  1100. override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
  1101. override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPUFILES))
  1102. override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPULINKFILES)))
  1103. override INSTALL_CREATEPACKAGEFPC=1
  1104. endif
  1105. ifdef INSTALLEXEFILES
  1106. override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
  1107. endif
  1108. fpc_install: all $(INSTALLTARGET)
  1109. ifdef INSTALLEXEFILES
  1110. $(MKDIR) $(INSTALL_BINDIR)
  1111. ifdef UPXPROG
  1112. -$(UPXPROG) $(INSTALLEXEFILES)
  1113. endif
  1114. $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
  1115. endif
  1116. ifdef INSTALL_CREATEPACKAGEFPC
  1117. ifdef FPCMAKE
  1118. ifdef PACKAGE_VERSION
  1119. ifneq ($(wildcard Makefile.fpc),)
  1120. $(FPCMAKE) -p -T$(OS_TARGET) Makefile.fpc
  1121. $(MKDIR) $(INSTALL_UNITDIR)
  1122. $(INSTALL) Package.fpc $(INSTALL_UNITDIR)
  1123. endif
  1124. endif
  1125. endif
  1126. endif
  1127. ifdef INSTALLPPUFILES
  1128. $(MKDIR) $(INSTALL_UNITDIR)
  1129. $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
  1130. ifneq ($(INSTALLPPULINKFILES),)
  1131. $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
  1132. endif
  1133. ifneq ($(wildcard $(LIB_FULLNAME)),)
  1134. $(MKDIR) $(INSTALL_LIBDIR)
  1135. $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
  1136. ifdef inUnix
  1137. ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
  1138. endif
  1139. endif
  1140. endif
  1141. ifdef INSTALL_FILES
  1142. $(MKDIR) $(INSTALL_DATADIR)
  1143. $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
  1144. endif
  1145. fpc_sourceinstall: distclean
  1146. $(MKDIR) $(INSTALL_SOURCEDIR)
  1147. $(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
  1148. fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
  1149. ifdef HASEXAMPLES
  1150. $(MKDIR) $(INSTALL_EXAMPLEDIR)
  1151. endif
  1152. ifdef EXAMPLESOURCEFILES
  1153. $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
  1154. endif
  1155. ifdef TARGET_EXAMPLEDIRS
  1156. $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
  1157. endif
  1158. .PHONY: fpc_clean fpc_cleanall fpc_distclean
  1159. ifdef EXEFILES
  1160. override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
  1161. endif
  1162. ifdef CLEAN_UNITS
  1163. override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
  1164. endif
  1165. ifdef CLEANPPUFILES
  1166. override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
  1167. override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
  1168. override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
  1169. endif
  1170. fpc_clean: $(CLEANTARGET)
  1171. ifdef CLEANEXEFILES
  1172. -$(DEL) $(CLEANEXEFILES)
  1173. endif
  1174. ifdef CLEANPPUFILES
  1175. -$(DEL) $(CLEANPPUFILES)
  1176. endif
  1177. ifneq ($(CLEANPPULINKFILES),)
  1178. -$(DEL) $(CLEANPPULINKFILES)
  1179. endif
  1180. ifdef CLEANRSTFILES
  1181. -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
  1182. endif
  1183. ifdef CLEAN_FILES
  1184. -$(DEL) $(CLEAN_FILES)
  1185. endif
  1186. ifdef LIB_NAME
  1187. -$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
  1188. endif
  1189. -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  1190. fpc_distclean: clean
  1191. ifdef COMPILER_UNITTARGETDIR
  1192. TARGETDIRCLEAN=fpc_clean
  1193. endif
  1194. fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
  1195. ifdef CLEANEXEFILES
  1196. -$(DEL) $(CLEANEXEFILES)
  1197. endif
  1198. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  1199. -$(DELTREE) *$(SMARTEXT)
  1200. -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  1201. ifdef AOUTEXT
  1202. -$(DEL) *$(AOUTEXT)
  1203. endif
  1204. .PHONY: fpc_baseinfo
  1205. override INFORULES+=fpc_baseinfo
  1206. fpc_baseinfo:
  1207. @$(ECHO)
  1208. @$(ECHO) == Package info ==
  1209. @$(ECHO) Package Name..... $(PACKAGE_NAME)
  1210. @$(ECHO) Package Version.. $(PACKAGE_VERSION)
  1211. @$(ECHO)
  1212. @$(ECHO) == Configuration info ==
  1213. @$(ECHO)
  1214. @$(ECHO) FPC.......... $(FPC)
  1215. @$(ECHO) FPC Version.. $(FPC_VERSION)
  1216. @$(ECHO) Source CPU... $(CPU_SOURCE)
  1217. @$(ECHO) Target CPU... $(CPU_TARGET)
  1218. @$(ECHO) Source OS.... $(OS_SOURCE)
  1219. @$(ECHO) Target OS.... $(OS_TARGET)
  1220. @$(ECHO) Full Source.. $(FULL_SOURCE)
  1221. @$(ECHO) Full Target.. $(FULL_TARGET)
  1222. @$(ECHO)
  1223. @$(ECHO) == Directory info ==
  1224. @$(ECHO)
  1225. @$(ECHO) Required pkgs... $(REQUIRE_PACKAGES)
  1226. @$(ECHO)
  1227. @$(ECHO) Basedir......... $(BASEDIR)
  1228. @$(ECHO) FPCDir.......... $(FPCDIR)
  1229. @$(ECHO) CrossBinDir..... $(CROSSBINDIR)
  1230. @$(ECHO) UnitsDir........ $(UNITSDIR)
  1231. @$(ECHO) PackagesDir..... $(PACKAGESDIR)
  1232. @$(ECHO)
  1233. @$(ECHO) GCC library..... $(GCCLIBDIR)
  1234. @$(ECHO) Other library... $(OTHERLIBDIR)
  1235. @$(ECHO)
  1236. @$(ECHO) == Tools info ==
  1237. @$(ECHO)
  1238. @$(ECHO) As........ $(AS)
  1239. @$(ECHO) Ld........ $(LD)
  1240. @$(ECHO) Ar........ $(AR)
  1241. @$(ECHO) Rc........ $(RC)
  1242. @$(ECHO)
  1243. @$(ECHO) Mv........ $(MVPROG)
  1244. @$(ECHO) Cp........ $(CPPROG)
  1245. @$(ECHO) Rm........ $(RMPROG)
  1246. @$(ECHO) GInstall.. $(GINSTALL)
  1247. @$(ECHO) Echo...... $(ECHO)
  1248. @$(ECHO) Shell..... $(SHELL)
  1249. @$(ECHO) Date...... $(DATE)
  1250. @$(ECHO) FPCMake... $(FPCMAKE)
  1251. @$(ECHO) PPUMove... $(PPUMOVE)
  1252. @$(ECHO) Upx....... $(UPXPROG)
  1253. @$(ECHO) Zip....... $(ZIPPROG)
  1254. @$(ECHO)
  1255. @$(ECHO) == Object info ==
  1256. @$(ECHO)
  1257. @$(ECHO) Target Loaders........ $(TARGET_LOADERS)
  1258. @$(ECHO) Target Units.......... $(TARGET_UNITS)
  1259. @$(ECHO) Target Implicit Units. $(TARGET_IMPLICITUNITS)
  1260. @$(ECHO) Target Programs....... $(TARGET_PROGRAMS)
  1261. @$(ECHO) Target Dirs........... $(TARGET_DIRS)
  1262. @$(ECHO) Target Examples....... $(TARGET_EXAMPLES)
  1263. @$(ECHO) Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
  1264. @$(ECHO)
  1265. @$(ECHO) Clean Units......... $(CLEAN_UNITS)
  1266. @$(ECHO) Clean Files......... $(CLEAN_FILES)
  1267. @$(ECHO)
  1268. @$(ECHO) Install Units....... $(INSTALL_UNITS)
  1269. @$(ECHO) Install Files....... $(INSTALL_FILES)
  1270. @$(ECHO)
  1271. @$(ECHO) == Install info ==
  1272. @$(ECHO)
  1273. @$(ECHO) DateStr.............. $(DATESTR)
  1274. @$(ECHO) ZipPrefix............ $(ZIPPREFIX)
  1275. @$(ECHO) ZipSuffix............ $(ZIPSUFFIX)
  1276. @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE)
  1277. @$(ECHO)
  1278. @$(ECHO) Install base dir..... $(INSTALL_BASEDIR)
  1279. @$(ECHO) Install binary dir... $(INSTALL_BINDIR)
  1280. @$(ECHO) Install library dir.. $(INSTALL_LIBDIR)
  1281. @$(ECHO) Install units dir.... $(INSTALL_UNITDIR)
  1282. @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR)
  1283. @$(ECHO) Install doc dir...... $(INSTALL_DOCDIR)
  1284. @$(ECHO) Install example dir.. $(INSTALL_EXAMPLEDIR)
  1285. @$(ECHO) Install data dir..... $(INSTALL_DATADIR)
  1286. @$(ECHO)
  1287. @$(ECHO) Dist destination dir. $(DIST_DESTDIR)
  1288. @$(ECHO) Dist zip name........ $(DIST_ZIPNAME)
  1289. @$(ECHO)
  1290. .PHONY: fpc_info
  1291. fpc_info: $(INFORULES)
  1292. .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
  1293. fpc_makefile_dirs
  1294. fpc_makefile:
  1295. $(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
  1296. fpc_makefile_sub1:
  1297. ifdef TARGET_DIRS
  1298. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
  1299. endif
  1300. ifdef TARGET_EXAMPLEDIRS
  1301. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
  1302. endif
  1303. fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
  1304. fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
  1305. fpc_makefiles: fpc_makefile fpc_makefile_dirs
  1306. all: fpc_all
  1307. debug: fpc_debug
  1308. smart: fpc_smart
  1309. release: fpc_release
  1310. examples:
  1311. shared:
  1312. install: fpc_install
  1313. sourceinstall: fpc_sourceinstall
  1314. exampleinstall: fpc_exampleinstall
  1315. distinstall:
  1316. zipinstall:
  1317. zipsourceinstall:
  1318. zipexampleinstall:
  1319. zipdistinstall:
  1320. clean: fpc_clean
  1321. distclean: fpc_distclean
  1322. cleanall: fpc_cleanall
  1323. info: fpc_info
  1324. makefiles: fpc_makefiles
  1325. .PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
  1326. ifneq ($(wildcard fpcmake.loc),)
  1327. include fpcmake.loc
  1328. endif
  1329. include $(INC)/makefile.inc
  1330. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  1331. include $(PROCINC)/makefile.cpu
  1332. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  1333. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  1334. $(SYSTEMUNIT)$(PPUEXT) : $(BSDINC)/$(SYSTEMUNIT).pp sysconst.inc $(SYSDEPS)
  1335. $(COMPILER) -Us -Sg $(BSDINC)/$(SYSTEMUNIT).pp
  1336. systhrds$(PPUEXT): systhrds.pp $(INC)/threadh.inc $(SYSTEMUNIT)$(PPUEXT) objpas$(PPUEXT)
  1337. objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
  1338. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
  1339. dateutils$(PPUEXT): $(OBJPASDIR)/dateutils.pp baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1340. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/dateutils.pp
  1341. strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
  1342. $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
  1343. $(SYSTEMUNIT)$(PPUEXT)
  1344. baseunix$(PPUEXT) : errno.inc $(BSDINC)/bunxtype.inc ptypes.inc $(BSDINC)/ctypes.inc \
  1345. signal.inc $(UNIXINC)/bunxh.inc $(BSDINC)/bunxmain.inc $(BSDINC)/ostypes.inc \
  1346. $(BSDINC)/bunxfunc.inc \
  1347. $(BSDINC)/ostypes.inc $(BSDINC)/ossysch.inc $(BSDINC)/bunxmacr.inc $(UNIXINC)/gensigset.inc \
  1348. $(UNIXINC)/genfuncs.inc $(SYSTEMUNIT)$(PPUEXT)
  1349. unix$(PPUEXT) : $(UNIXINC)/unix.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
  1350. sysconst.inc $(UNIXINC)/timezone.inc \
  1351. unixsysc.inc baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1352. dos$(PPUEXT) : $(UNIXINC)/dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
  1353. unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1354. crt$(PPUEXT) : $(UNIXINC)/crt.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1355. objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT)
  1356. printer$(PPUEXT) : $(UNIXINC)/printer.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1357. sysutils$(PPUEXT) : $(UNIXINC)/sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
  1358. objpas$(PPUEXT) unix$(PPUEXT) errors$(PPUEXT) sysconst$(PPUEXT)
  1359. $(COMPILER) -Fi$(OBJPASDIR)/sysutils $(UNIXINC)/sysutils.pp
  1360. classes$(PPUEXT) : classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
  1361. sysutils$(PPUEXT) typinfo$(PPUEXT) rtlconst$(PPUEXT) types$(PPUEXT)
  1362. $(COMPILER) -Fi$(OBJPASDIR)/classes classes.pp
  1363. typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
  1364. $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp
  1365. math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  1366. $(COMPILER) $(OBJPASDIR)/math.pp
  1367. gettext$(PPUEXT): $(OBJPASDIR)/gettext.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  1368. $(COMPILER) $(OBJPASDIR)/gettext.pp
  1369. varutils$(PPUEXT) : $(OBJPASDIR)/cvarutil.inc $(OBJPASDIR)/varutils.inc \
  1370. $(OBJPASDIR)/varutilh.inc varutils.pp
  1371. $(COMPILER) -I$(OBJPASDIR) $(UNIXINC)/varutils.pp
  1372. types$(PPUEXT) : $(OBJPASDIR)/types.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1373. $(COMPILER) $(OBJPASDIR)/types.pp
  1374. sysconst$(PPUEXT) : $(OBJPASDIR)/sysconst.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1375. $(COMPILER) $(OBJPASDIR)/sysconst.pp
  1376. rtlconst$(PPUEXT) : $(OBJPASDIR)/rtlconst.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1377. $(COMPILER) $(OBJPASDIR)/rtlconst.pp
  1378. strutils$(PPUEXT) : $(OBJPASDIR)/strutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
  1379. sysutils$(PPUEXT)
  1380. $(COMPILER) $(OBJPASDIR)/strutils.pp
  1381. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT)
  1382. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1383. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
  1384. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
  1385. $(COMPILER) -Sg $(INC)/heaptrc.pp
  1386. lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT)
  1387. charset$(PPUEXT) : $(INC)/charset.pp $(SYSTEMUNIT)$(PPUEXT)
  1388. ucomplex$(PPUEXT) : $(INC)/ucomplex.pp math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1389. sockets$(PPUEXT) : $(UNIXINC)/sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
  1390. unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1391. errors$(PPUEXT) : $(UNIXINC)/errors.pp strings$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1392. ipc$(PPUEXT) : $(UNIXINC)/ipc.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1393. terminfo$(PPUEXT) : terminfo.pp unix$(PPUEXT)
  1394. callspec$(PPUEXT) : $(INC)/callspec.pp $(SYSTEMUNIT)$(PPUEXT)
  1395. sysctl$(PPUEXT) : $(BSDINC)/sysctl.pp $(SYSTEMUNIT)$(PPUEXT)
  1396. cthreads$(PPUEXT) : $(UNIXINC)/cthreads.pp systhrds$(PPUEXT)