Makefile 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261
  1. #
  2. # Don't edit, this file is generated by FPCMake Version 1.1 [2002/10/05]
  3. #
  4. default: all
  5. MAKEFILETARGETS=win32
  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. ifneq ($(findstring sh.exe,$(SHELL)),)
  62. PATHSEP=/
  63. endif
  64. endif
  65. ifdef PWD
  66. BASEDIR:=$(subst \,/,$(shell $(PWD)))
  67. ifdef inCygWin
  68. ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
  69. BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
  70. BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
  71. BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
  72. endif
  73. endif
  74. else
  75. BASEDIR=.
  76. endif
  77. ifdef inOS2
  78. ifndef ECHO
  79. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  80. ifeq ($(ECHO),)
  81. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  82. ifeq ($(ECHO),)
  83. ECHO=echo
  84. else
  85. ECHO:=$(firstword $(ECHO))
  86. endif
  87. else
  88. ECHO:=$(firstword $(ECHO))
  89. endif
  90. endif
  91. export ECHO
  92. endif
  93. override OS_TARGET_DEFAULT=win32
  94. override DEFAULT_FPCDIR=../..
  95. ifndef FPC
  96. ifdef PP
  97. FPC=$(PP)
  98. endif
  99. endif
  100. ifndef FPC
  101. FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
  102. ifneq ($(FPCPROG),)
  103. FPCPROG:=$(firstword $(FPCPROG))
  104. FPC:=$(shell $(FPCPROG) -PB)
  105. ifneq ($(findstring Error,$(FPC)),)
  106. override FPC=ppc386
  107. endif
  108. else
  109. override FPC=ppc386
  110. endif
  111. endif
  112. override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
  113. override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
  114. ifndef FPC_VERSION
  115. FPC_VERSION:=$(shell $(FPC) -iV)
  116. endif
  117. export FPC FPC_VERSION
  118. unexport CHECKDEPEND ALLDEPENDENCIES
  119. ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
  120. COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
  121. ifndef CPU_SOURCE
  122. CPU_SOURCE:=$(word 1,$(COMPILERINFO))
  123. endif
  124. ifndef CPU_TARGET
  125. CPU_TARGET:=$(word 2,$(COMPILERINFO))
  126. endif
  127. ifndef OS_SOURCE
  128. OS_SOURCE:=$(word 3,$(COMPILERINFO))
  129. endif
  130. ifndef OS_TARGET
  131. OS_TARGET:=$(word 4,$(COMPILERINFO))
  132. endif
  133. else
  134. ifndef CPU_SOURCE
  135. CPU_SOURCE:=$(shell $(FPC) -iSP)
  136. endif
  137. ifndef CPU_TARGET
  138. CPU_TARGET:=$(shell $(FPC) -iTP)
  139. endif
  140. ifndef OS_SOURCE
  141. OS_SOURCE:=$(shell $(FPC) -iSO)
  142. endif
  143. ifndef OS_TARGET
  144. OS_TARGET:=$(shell $(FPC) -iTO)
  145. endif
  146. endif
  147. ifndef CPU_TARGET
  148. ifdef CPU_TARGET_DEFAULT
  149. CPU_TARGET=$(CPU_TARGET_DEFAULT)
  150. endif
  151. endif
  152. ifndef OS_TARGET
  153. ifdef OS_TARGET_DEFAULT
  154. OS_TARGET=$(OS_TARGET_DEFAULT)
  155. endif
  156. endif
  157. FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
  158. FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
  159. ifneq ($(FULL_TARGET),$(FULL_SOURCE))
  160. CROSSCOMPILE=1
  161. endif
  162. ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
  163. ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
  164. $(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
  165. endif
  166. endif
  167. export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
  168. ifdef FPCDIR
  169. override FPCDIR:=$(subst \,/,$(FPCDIR))
  170. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  171. override FPCDIR=wrong
  172. endif
  173. else
  174. override FPCDIR=wrong
  175. endif
  176. ifdef DEFAULT_FPCDIR
  177. ifeq ($(FPCDIR),wrong)
  178. override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
  179. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  180. override FPCDIR=wrong
  181. endif
  182. endif
  183. endif
  184. ifeq ($(FPCDIR),wrong)
  185. ifdef inUnix
  186. override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
  187. ifeq ($(wildcard $(FPCDIR)/units),)
  188. override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
  189. endif
  190. else
  191. override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
  192. override FPCDIR:=$(FPCDIR)/..
  193. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  194. override FPCDIR:=$(FPCDIR)/..
  195. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  196. override FPCDIR=c:/pp
  197. endif
  198. endif
  199. endif
  200. endif
  201. ifndef CROSSDIR
  202. CROSSDIR:=$(FPCDIR)/cross/$(FULL_TARGET)
  203. endif
  204. ifndef CROSSTARGETDIR
  205. CROSSTARGETDIR=$(CROSSDIR)/$(FULL_TARGET)
  206. endif
  207. ifdef CROSSCOMPILE
  208. UNITSDIR:=$(wildcard $(CROSSTARGETDIR)/units)
  209. ifeq ($(UNITSDIR),)
  210. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
  211. endif
  212. else
  213. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
  214. endif
  215. PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
  216. override PACKAGE_NAME=rtl
  217. RTL=..
  218. INC=$(RTL)/inc
  219. PROCINC=$(RTL)/$(CPU_TARGET)
  220. WININC=wininc
  221. UNITPREFIX=rtl
  222. ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
  223. SYSTEMUNIT=system
  224. PRT0=wprt0
  225. override FPCOPT+=-dMT
  226. else
  227. SYSTEMUNIT=syswin32
  228. PRT0=wprt0_10
  229. endif
  230. ifdef RELEASE
  231. override FPCOPT+=-Ur
  232. endif
  233. OBJPASDIR=$(RTL)/objpas
  234. GRAPHDIR=$(INC)/graph
  235. include $(WININC)/makefile.inc
  236. WINDOWS_SOURCE_FILES=$(addprefix $(WININC)/,$(addsuffix .inc,$(WINDOWS_FILES)))
  237. override TARGET_UNITS+=$(SYSTEMUNIT) systhrds objpas strings lineinfo heaptrc windows ole2 activex opengl32 winsock initc dos crt objects graph messages sysutils typinfo math varutils variants cpu mmx charset ucomplex getopts wincrt winmouse winevent sockets printer dynlibs video mouse keyboard types comobj
  238. override TARGET_LOADERS+=wprt0 wdllprt0
  239. override TARGET_RSTS+=math varutils typinfo
  240. override INSTALL_FPCPACKAGE=y
  241. override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
  242. override COMPILER_SOURCEDIR+=$(INC) $(PROCINC)
  243. override COMPILER_TARGETDIR+=.
  244. ifdef REQUIRE_UNITSDIR
  245. override UNITSDIR+=$(REQUIRE_UNITSDIR)
  246. endif
  247. ifdef REQUIRE_PACKAGESDIR
  248. override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
  249. endif
  250. ifdef ZIPINSTALL
  251. ifeq ($(OS_TARGET),linux)
  252. UNIXINSTALLDIR=1
  253. endif
  254. ifeq ($(OS_TARGET),freebsd)
  255. UNIXINSTALLDIR=1
  256. endif
  257. ifeq ($(OS_TARGET),netbsd)
  258. UNIXINSTALLDIR=1
  259. endif
  260. ifeq ($(OS_TARGET),openbsd)
  261. UNIXINSTALLDIR=1
  262. endif
  263. ifeq ($(OS_TARGET),sunos)
  264. UNIXINSTALLDIR=1
  265. endif
  266. ifeq ($(OS_TARGET),qnx)
  267. UNIXINSTALLDIR=1
  268. endif
  269. else
  270. ifeq ($(OS_SOURCE),linux)
  271. UNIXINSTALLDIR=1
  272. endif
  273. ifeq ($(OS_SOURCE),freebsd)
  274. UNIXINSTALLDIR=1
  275. endif
  276. ifeq ($(OS_SOURCE),netbsd)
  277. UNIXINSTALLDIR=1
  278. endif
  279. ifeq ($(OS_SOURCE),openbsd)
  280. UNIXINSTALLDIR=1
  281. endif
  282. ifeq ($(OS_TARGET),sunos)
  283. UNIXINSTALLDIR=1
  284. endif
  285. ifeq ($(OS_TARGET),qnx)
  286. UNIXINSTALLDIR=1
  287. endif
  288. endif
  289. ifndef INSTALL_PREFIX
  290. ifdef PREFIX
  291. INSTALL_PREFIX=$(PREFIX)
  292. endif
  293. endif
  294. ifndef INSTALL_PREFIX
  295. ifdef UNIXINSTALLDIR
  296. INSTALL_PREFIX=/usr/local
  297. else
  298. ifdef INSTALL_FPCPACKAGE
  299. INSTALL_BASEDIR:=/pp
  300. else
  301. INSTALL_BASEDIR:=/$(PACKAGE_NAME)
  302. endif
  303. endif
  304. endif
  305. export INSTALL_PREFIX
  306. ifdef INSTALL_FPCSUBDIR
  307. export INSTALL_FPCSUBDIR
  308. endif
  309. ifndef DIST_DESTDIR
  310. DIST_DESTDIR:=$(BASEDIR)
  311. endif
  312. export DIST_DESTDIR
  313. ifndef INSTALL_BASEDIR
  314. ifdef UNIXINSTALLDIR
  315. ifdef INSTALL_FPCPACKAGE
  316. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
  317. else
  318. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
  319. endif
  320. else
  321. INSTALL_BASEDIR:=$(INSTALL_PREFIX)
  322. endif
  323. endif
  324. ifndef INSTALL_BINDIR
  325. ifdef UNIXINSTALLDIR
  326. INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
  327. else
  328. INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
  329. ifdef INSTALL_FPCPACKAGE
  330. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)
  331. endif
  332. endif
  333. endif
  334. ifndef INSTALL_UNITDIR
  335. ifdef CROSSCOMPILE
  336. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/units
  337. else
  338. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(OS_TARGET)
  339. endif
  340. ifdef INSTALL_FPCPACKAGE
  341. ifdef PACKAGE_NAME
  342. INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
  343. endif
  344. endif
  345. endif
  346. ifndef INSTALL_LIBDIR
  347. ifdef UNIXINSTALLDIR
  348. INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
  349. else
  350. INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
  351. endif
  352. endif
  353. ifndef INSTALL_SOURCEDIR
  354. ifdef UNIXINSTALLDIR
  355. ifdef BSDhier
  356. SRCPREFIXDIR=share/src
  357. else
  358. SRCPREFIXDIR=src
  359. endif
  360. ifdef INSTALL_FPCPACKAGE
  361. ifdef INSTALL_FPCSUBDIR
  362. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  363. else
  364. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  365. endif
  366. else
  367. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  368. endif
  369. else
  370. ifdef INSTALL_FPCPACKAGE
  371. ifdef INSTALL_FPCSUBDIR
  372. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  373. else
  374. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
  375. endif
  376. else
  377. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
  378. endif
  379. endif
  380. endif
  381. ifndef INSTALL_DOCDIR
  382. ifdef UNIXINSTALLDIR
  383. ifdef BSDhier
  384. DOCPREFIXDIR=share/doc
  385. else
  386. DOCPREFIXDIR=doc
  387. endif
  388. ifdef INSTALL_FPCPACKAGE
  389. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  390. else
  391. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  392. endif
  393. else
  394. ifdef INSTALL_FPCPACKAGE
  395. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
  396. else
  397. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
  398. endif
  399. endif
  400. endif
  401. ifndef INSTALL_EXAMPLEDIR
  402. ifdef UNIXINSTALLDIR
  403. ifdef INSTALL_FPCPACKAGE
  404. ifdef BSDhier
  405. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  406. else
  407. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
  408. endif
  409. else
  410. ifdef BSDhier
  411. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  412. else
  413. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  414. endif
  415. endif
  416. else
  417. ifdef INSTALL_FPCPACKAGE
  418. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
  419. else
  420. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
  421. endif
  422. endif
  423. endif
  424. ifndef INSTALL_DATADIR
  425. INSTALL_DATADIR=$(INSTALL_BASEDIR)
  426. endif
  427. ifdef CROSSCOMPILE
  428. ifndef CROSSBINDIR
  429. CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(FULL_SOURCE))
  430. ifeq ($(CROSSBINDIR),)
  431. CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/bin/$(FULL_SOURCE))
  432. endif
  433. endif
  434. else
  435. CROSSBINDIR=
  436. endif
  437. LOADEREXT=.as
  438. EXEEXT=.exe
  439. PPLEXT=.ppl
  440. PPUEXT=.ppu
  441. OEXT=.o
  442. ASMEXT=.s
  443. SMARTEXT=.sl
  444. STATICLIBEXT=.a
  445. SHAREDLIBEXT=.so
  446. STATICLIBPREFIX=libp
  447. RSTEXT=.rst
  448. FPCMADE=fpcmade
  449. ifeq ($(OS_TARGET),go32v1)
  450. PPUEXT=.pp1
  451. OEXT=.o1
  452. ASMEXT=.s1
  453. SMARTEXT=.sl1
  454. STATICLIBEXT=.a1
  455. SHAREDLIBEXT=.so1
  456. STATICLIBPREFIX=
  457. FPCMADE=fpcmade.v1
  458. PACKAGESUFFIX=v1
  459. endif
  460. ifeq ($(OS_TARGET),go32v2)
  461. STATICLIBPREFIX=
  462. FPCMADE=fpcmade.dos
  463. ZIPSUFFIX=go32
  464. endif
  465. ifeq ($(OS_TARGET),linux)
  466. EXEEXT=
  467. HASSHAREDLIB=1
  468. FPCMADE=fpcmade.lnx
  469. ZIPSUFFIX=linux
  470. endif
  471. ifeq ($(OS_TARGET),freebsd)
  472. EXEEXT=
  473. HASSHAREDLIB=1
  474. FPCMADE=fpcmade.freebsd
  475. ZIPSUFFIX=freebsd
  476. endif
  477. ifeq ($(OS_TARGET),netbsd)
  478. EXEEXT=
  479. HASSHAREDLIB=1
  480. FPCMADE=fpcmade.netbsd
  481. ZIPSUFFIX=netbsd
  482. endif
  483. ifeq ($(OS_TARGET),openbsd)
  484. EXEEXT=
  485. HASSHAREDLIB=1
  486. FPCMADE=fpcmade.openbsd
  487. ZIPSUFFIX=openbsd
  488. endif
  489. ifeq ($(OS_TARGET),win32)
  490. PPUEXT=.ppw
  491. OEXT=.ow
  492. ASMEXT=.sw
  493. SMARTEXT=.slw
  494. STATICLIBEXT=.aw
  495. SHAREDLIBEXT=.dll
  496. FPCMADE=fpcmade.w32
  497. ZIPSUFFIX=w32
  498. endif
  499. ifeq ($(OS_TARGET),os2)
  500. PPUEXT=.ppo
  501. ASMEXT=.so2
  502. OEXT=.oo2
  503. AOUTEXT=.out
  504. SMARTEXT=.sl2
  505. STATICLIBPREFIX=
  506. STATICLIBEXT=.ao2
  507. SHAREDLIBEXT=.dll
  508. FPCMADE=fpcmade.os2
  509. ZIPSUFFIX=emx
  510. ECHO=echo
  511. endif
  512. ifeq ($(OS_TARGET),amiga)
  513. EXEEXT=
  514. PPUEXT=.ppu
  515. ASMEXT=.asm
  516. OEXT=.o
  517. SMARTEXT=.sl
  518. STATICLIBEXT=.a
  519. SHAREDLIBEXT=.library
  520. FPCMADE=fpcmade.amg
  521. endif
  522. ifeq ($(OS_TARGET),atari)
  523. PPUEXT=.ppu
  524. ASMEXT=.s
  525. OEXT=.o
  526. SMARTEXT=.sl
  527. STATICLIBEXT=.a
  528. EXEEXT=.ttp
  529. FPCMADE=fpcmade.ata
  530. endif
  531. ifeq ($(OS_TARGET),beos)
  532. PPUEXT=.ppu
  533. ASMEXT=.s
  534. OEXT=.o
  535. SMARTEXT=.sl
  536. STATICLIBEXT=.a
  537. EXEEXT=
  538. FPCMADE=fpcmade.be
  539. ZIPSUFFIX=be
  540. endif
  541. ifeq ($(OS_TARGET),sunos)
  542. PPUEXT=.ppu
  543. ASMEXT=.s
  544. OEXT=.o
  545. SMARTEXT=.sl
  546. STATICLIBEXT=.a
  547. EXEEXT=
  548. FPCMADE=fpcmade.sun
  549. ZIPSUFFIX=sun
  550. endif
  551. ifeq ($(OS_TARGET),qnx)
  552. PPUEXT=.ppu
  553. ASMEXT=.s
  554. OEXT=.o
  555. SMARTEXT=.sl
  556. STATICLIBEXT=.a
  557. EXEEXT=
  558. FPCMADE=fpcmade.qnx
  559. ZIPSUFFIX=qnx
  560. endif
  561. ifeq ($(OS_TARGET),netware)
  562. STATICLIBPREFIX=
  563. PPUEXT=.ppn
  564. OEXT=.on
  565. ASMEXT=.s
  566. SMARTEXT=.sl
  567. STATICLIBEXT=.a
  568. SHAREDLIBEXT=.nlm
  569. FPCMADE=fpcmade.nw
  570. ZIPSUFFIX=nw
  571. EXEEXT=.nlm
  572. endif
  573. ifndef ECHO
  574. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  575. ifeq ($(ECHO),)
  576. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  577. ifeq ($(ECHO),)
  578. ECHO=
  579. else
  580. ECHO:=$(firstword $(ECHO))
  581. endif
  582. else
  583. ECHO:=$(firstword $(ECHO))
  584. endif
  585. endif
  586. export ECHO
  587. ifndef DATE
  588. DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
  589. ifeq ($(DATE),)
  590. DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
  591. ifeq ($(DATE),)
  592. DATE=
  593. else
  594. DATE:=$(firstword $(DATE))
  595. endif
  596. else
  597. DATE:=$(firstword $(DATE))
  598. endif
  599. endif
  600. export DATE
  601. ifndef GINSTALL
  602. GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
  603. ifeq ($(GINSTALL),)
  604. GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
  605. ifeq ($(GINSTALL),)
  606. GINSTALL=
  607. else
  608. GINSTALL:=$(firstword $(GINSTALL))
  609. endif
  610. else
  611. GINSTALL:=$(firstword $(GINSTALL))
  612. endif
  613. endif
  614. export GINSTALL
  615. ifndef CPPROG
  616. CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
  617. ifeq ($(CPPROG),)
  618. CPPROG=
  619. else
  620. CPPROG:=$(firstword $(CPPROG))
  621. endif
  622. endif
  623. export CPPROG
  624. ifndef RMPROG
  625. RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
  626. ifeq ($(RMPROG),)
  627. RMPROG=
  628. else
  629. RMPROG:=$(firstword $(RMPROG))
  630. endif
  631. endif
  632. export RMPROG
  633. ifndef MVPROG
  634. MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
  635. ifeq ($(MVPROG),)
  636. MVPROG=
  637. else
  638. MVPROG:=$(firstword $(MVPROG))
  639. endif
  640. endif
  641. export MVPROG
  642. ifndef ECHOREDIR
  643. ECHOREDIR:=$(subst /,$(PATHSEP),$(ECHO))
  644. endif
  645. ifndef COPY
  646. COPY:=$(CPPROG) -fp
  647. endif
  648. ifndef COPYTREE
  649. COPYTREE:=$(CPPROG) -rfp
  650. endif
  651. ifndef MOVE
  652. MOVE:=$(MVPROG) -f
  653. endif
  654. ifndef DEL
  655. DEL:=$(RMPROG) -f
  656. endif
  657. ifndef DELTREE
  658. DELTREE:=$(RMPROG) -rf
  659. endif
  660. ifndef INSTALL
  661. ifdef inUnix
  662. INSTALL:=$(GINSTALL) -c -m 644
  663. else
  664. INSTALL:=$(COPY)
  665. endif
  666. endif
  667. ifndef INSTALLEXE
  668. ifdef inUnix
  669. INSTALLEXE:=$(GINSTALL) -c -m 755
  670. else
  671. INSTALLEXE:=$(COPY)
  672. endif
  673. endif
  674. ifndef MKDIR
  675. MKDIR:=$(GINSTALL) -m 755 -d
  676. endif
  677. export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
  678. ifndef PPUMOVE
  679. PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
  680. ifeq ($(PPUMOVE),)
  681. PPUMOVE=
  682. else
  683. PPUMOVE:=$(firstword $(PPUMOVE))
  684. endif
  685. endif
  686. export PPUMOVE
  687. ifndef FPCMAKE
  688. FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
  689. ifeq ($(FPCMAKE),)
  690. FPCMAKE=
  691. else
  692. FPCMAKE:=$(firstword $(FPCMAKE))
  693. endif
  694. endif
  695. export FPCMAKE
  696. ifndef ZIPPROG
  697. ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
  698. ifeq ($(ZIPPROG),)
  699. ZIPPROG=
  700. else
  701. ZIPPROG:=$(firstword $(ZIPPROG))
  702. endif
  703. endif
  704. export ZIPPROG
  705. ifndef TARPROG
  706. TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
  707. ifeq ($(TARPROG),)
  708. TARPROG=
  709. else
  710. TARPROG:=$(firstword $(TARPROG))
  711. endif
  712. endif
  713. export TARPROG
  714. ASNAME=as
  715. LDNAME=ld
  716. ARNAME=ar
  717. RCNAME=rc
  718. ifeq ($(OS_TARGET),win32)
  719. ASNAME=asw
  720. LDNAME=ldw
  721. ARNAME=arw
  722. endif
  723. ifndef ASPROG
  724. ifdef CROSSBINDIR
  725. ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
  726. else
  727. ASPROG=$(ASNAME)
  728. endif
  729. endif
  730. ifndef LDPROG
  731. ifdef CROSSBINDIR
  732. LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
  733. else
  734. LDPROG=$(LDNAME)
  735. endif
  736. endif
  737. ifndef RCPROG
  738. ifdef CROSSBINDIR
  739. RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
  740. else
  741. RCPROG=$(RCNAME)
  742. endif
  743. endif
  744. ifndef ARPROG
  745. ifdef CROSSBINDIR
  746. ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
  747. else
  748. ARPROG=$(ARNAME)
  749. endif
  750. endif
  751. AS=$(ASPROG)
  752. LD=$(LDPROG)
  753. RC=$(RCPROG)
  754. AR=$(ARPROG)
  755. PPAS=ppas$(BATCHEXT)
  756. ifdef inUnix
  757. LDCONFIG=ldconfig
  758. else
  759. LDCONFIG=
  760. endif
  761. ifdef DATE
  762. DATESTR:=$(shell $(DATE) +%Y%m%d)
  763. else
  764. DATESTR=
  765. endif
  766. ifndef UPXPROG
  767. ifeq ($(OS_TARGET),go32v2)
  768. UPXPROG:=1
  769. endif
  770. ifeq ($(OS_TARGET),win32)
  771. UPXPROG:=1
  772. endif
  773. ifdef UPXPROG
  774. UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
  775. ifeq ($(UPXPROG),)
  776. UPXPROG=
  777. else
  778. UPXPROG:=$(firstword $(UPXPROG))
  779. endif
  780. else
  781. UPXPROG=
  782. endif
  783. endif
  784. export UPXPROG
  785. ZIPOPT=-9
  786. ZIPEXT=.zip
  787. ifeq ($(USETAR),bz2)
  788. TAROPT=vI
  789. TAREXT=.tar.bz2
  790. else
  791. TAROPT=vz
  792. TAREXT=.tar.gz
  793. endif
  794. ifndef NOCPUDEF
  795. override FPCOPTDEF=$(CPU_TARGET)
  796. endif
  797. ifneq ($(OS_TARGET),$(OS_SOURCE))
  798. override FPCOPT+=-T$(OS_TARGET)
  799. endif
  800. ifeq ($(OS_SOURCE),openbsd)
  801. override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
  802. endif
  803. ifdef UNITDIR
  804. override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
  805. endif
  806. ifdef LIBDIR
  807. override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
  808. endif
  809. ifdef OBJDIR
  810. override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
  811. endif
  812. ifdef INCDIR
  813. override FPCOPT+=$(addprefix -Fi,$(INCDIR))
  814. endif
  815. ifdef LINKSMART
  816. override FPCOPT+=-XX
  817. endif
  818. ifdef CREATESMART
  819. override FPCOPT+=-CX
  820. endif
  821. ifdef DEBUG
  822. override FPCOPT+=-gl
  823. override FPCOPTDEF+=DEBUG
  824. endif
  825. ifdef RELEASE
  826. ifeq ($(CPU_TARGET),i386)
  827. FPCCPUOPT:=-OG2p3
  828. else
  829. FPCCPUOPT:=
  830. endif
  831. override FPCOPT+=-Xs $(FPCCPUOPT) -n
  832. override FPCOPTDEF+=RELEASE
  833. endif
  834. ifdef STRIP
  835. override FPCOPT+=-Xs
  836. endif
  837. ifdef OPTIMIZE
  838. ifeq ($(CPU_TARGET),i386)
  839. override FPCOPT+=-OG2p3
  840. endif
  841. endif
  842. ifdef VERBOSE
  843. override FPCOPT+=-vwni
  844. endif
  845. ifdef COMPILER_OPTIONS
  846. override FPCOPT+=$(COMPILER_OPTIONS)
  847. endif
  848. ifdef COMPILER_UNITDIR
  849. override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
  850. endif
  851. ifdef COMPILER_LIBRARYDIR
  852. override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
  853. endif
  854. ifdef COMPILER_OBJECTDIR
  855. override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
  856. endif
  857. ifdef COMPILER_INCLUDEDIR
  858. override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
  859. endif
  860. ifdef CROSSBINDIR
  861. override FPCOPT+=-FD$(CROSSBINDIR)
  862. endif
  863. ifdef COMPILER_TARGETDIR
  864. override FPCOPT+=-FE$(COMPILER_TARGETDIR)
  865. ifeq ($(COMPILER_TARGETDIR),.)
  866. override TARGETDIRPREFIX=
  867. else
  868. override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
  869. endif
  870. endif
  871. ifdef COMPILER_UNITTARGETDIR
  872. override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
  873. ifeq ($(COMPILER_UNITTARGETDIR),.)
  874. override UNITTARGETDIRPREFIX=
  875. else
  876. override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
  877. endif
  878. else
  879. ifdef COMPILER_TARGETDIR
  880. override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
  881. override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
  882. endif
  883. endif
  884. ifdef OPT
  885. override FPCOPT+=$(OPT)
  886. endif
  887. ifdef FPCOPTDEF
  888. override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
  889. endif
  890. ifdef CFGFILE
  891. override FPCOPT+=@$(CFGFILE)
  892. endif
  893. ifdef USEENV
  894. override FPCEXTCMD:=$(FPCOPT)
  895. override FPCOPT:=!FPCEXTCMD
  896. export FPCEXTCMD
  897. endif
  898. override COMPILER:=$(FPC) $(FPCOPT)
  899. ifeq (,$(findstring -s ,$(COMPILER)))
  900. EXECPPAS=
  901. else
  902. ifeq ($(OS_SOURCE),$(OS_TARGET))
  903. EXECPPAS:=@$(PPAS)
  904. endif
  905. endif
  906. .PHONY: fpc_loaders
  907. ifdef TARGET_LOADERS
  908. override ALLTARGET+=fpc_loaders
  909. override CLEANTARGET+=fpc_loaders_clean
  910. override INSTALLTARGET+=fpc_loaders_install
  911. override LOADEROFILES:=$(addsuffix $(OEXT),$(TARGET_LOADERS))
  912. endif
  913. %$(OEXT): %$(LOADEREXT)
  914. $(AS) -o $*$(OEXT) $<
  915. fpc_loaders: $(LOADEROFILES)
  916. fpc_loaders_clean:
  917. -$(DEL) $(LOADEROFILES)
  918. fpc_loaders_install:
  919. $(MKDIR) $(INSTALL_UNITDIR)
  920. $(INSTALL) $(LOADEROFILES) $(INSTALL_UNITDIR)
  921. .PHONY: fpc_units
  922. ifdef TARGET_UNITS
  923. override ALLTARGET+=fpc_units
  924. override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
  925. override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
  926. override INSTALLPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
  927. override CLEANPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
  928. endif
  929. fpc_units: $(UNITPPUFILES)
  930. ifdef TARGET_RSTS
  931. override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
  932. override CLEANRSTFILES+=$(RSTFILES)
  933. endif
  934. .PHONY: fpc_all fpc_smart fpc_debug fpc_release
  935. $(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
  936. @$(ECHOREDIR) Compiled > $(FPCMADE)
  937. fpc_all: $(FPCMADE)
  938. fpc_smart:
  939. $(MAKE) all LINKSMART=1 CREATESMART=1
  940. fpc_debug:
  941. $(MAKE) all DEBUG=1
  942. fpc_release:
  943. $(MAKE) all RELEASE=1
  944. .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
  945. %$(PPUEXT): %.pp
  946. $(COMPILER) $<
  947. $(EXECPPAS)
  948. %$(PPUEXT): %.pas
  949. $(COMPILER) $<
  950. $(EXECPPAS)
  951. %$(EXEEXT): %.pp
  952. $(COMPILER) $<
  953. $(EXECPPAS)
  954. %$(EXEEXT): %.pas
  955. $(COMPILER) $<
  956. $(EXECPPAS)
  957. %.res: %.rc
  958. windres -i $< -o $@
  959. vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  960. vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  961. vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
  962. .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
  963. ifdef INSTALL_UNITS
  964. override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
  965. endif
  966. ifdef INSTALL_BUILDUNIT
  967. override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
  968. endif
  969. ifdef INSTALLPPUFILES
  970. override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
  971. override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPUFILES))
  972. override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPULINKFILES)))
  973. override INSTALL_CREATEPACKAGEFPC=1
  974. endif
  975. ifdef INSTALLEXEFILES
  976. override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
  977. endif
  978. fpc_install: all $(INSTALLTARGET)
  979. ifdef INSTALLEXEFILES
  980. $(MKDIR) $(INSTALL_BINDIR)
  981. ifdef UPXPROG
  982. -$(UPXPROG) $(INSTALLEXEFILES)
  983. endif
  984. $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
  985. endif
  986. ifdef INSTALL_CREATEPACKAGEFPC
  987. ifdef FPCMAKE
  988. ifdef PACKAGE_VERSION
  989. ifneq ($(wildcard Makefile.fpc),)
  990. $(FPCMAKE) -p -T$(OS_TARGET) Makefile.fpc
  991. $(MKDIR) $(INSTALL_UNITDIR)
  992. $(INSTALL) Package.fpc $(INSTALL_UNITDIR)
  993. endif
  994. endif
  995. endif
  996. endif
  997. ifdef INSTALLPPUFILES
  998. $(MKDIR) $(INSTALL_UNITDIR)
  999. $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
  1000. ifneq ($(INSTALLPPULINKFILES),)
  1001. $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
  1002. endif
  1003. ifneq ($(wildcard $(LIB_FULLNAME)),)
  1004. $(MKDIR) $(INSTALL_LIBDIR)
  1005. $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
  1006. ifdef inUnix
  1007. ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
  1008. endif
  1009. endif
  1010. endif
  1011. ifdef INSTALL_FILES
  1012. $(MKDIR) $(INSTALL_DATADIR)
  1013. $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
  1014. endif
  1015. fpc_sourceinstall: distclean
  1016. $(MKDIR) $(INSTALL_SOURCEDIR)
  1017. $(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
  1018. fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
  1019. ifdef HASEXAMPLES
  1020. $(MKDIR) $(INSTALL_EXAMPLEDIR)
  1021. endif
  1022. ifdef EXAMPLESOURCEFILES
  1023. $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
  1024. endif
  1025. ifdef TARGET_EXAMPLEDIRS
  1026. $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
  1027. endif
  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) Shell..... $(SHELL)
  1119. @$(ECHO) Date...... $(DATE)
  1120. @$(ECHO) FPCMake... $(FPCMAKE)
  1121. @$(ECHO) PPUMove... $(PPUMOVE)
  1122. @$(ECHO) Upx....... $(UPXPROG)
  1123. @$(ECHO) Zip....... $(ZIPPROG)
  1124. @$(ECHO)
  1125. @$(ECHO) == Object info ==
  1126. @$(ECHO)
  1127. @$(ECHO) Target Loaders........ $(TARGET_LOADERS)
  1128. @$(ECHO) Target Units.......... $(TARGET_UNITS)
  1129. @$(ECHO) Target Implicit Units. $(TARGET_IMPLICITUNITS)
  1130. @$(ECHO) Target Programs....... $(TARGET_PROGRAMS)
  1131. @$(ECHO) Target Dirs........... $(TARGET_DIRS)
  1132. @$(ECHO) Target Examples....... $(TARGET_EXAMPLES)
  1133. @$(ECHO) Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
  1134. @$(ECHO)
  1135. @$(ECHO) Clean Units......... $(CLEAN_UNITS)
  1136. @$(ECHO) Clean Files......... $(CLEAN_FILES)
  1137. @$(ECHO)
  1138. @$(ECHO) Install Units....... $(INSTALL_UNITS)
  1139. @$(ECHO) Install Files....... $(INSTALL_FILES)
  1140. @$(ECHO)
  1141. @$(ECHO) == Install info ==
  1142. @$(ECHO)
  1143. @$(ECHO) DateStr.............. $(DATESTR)
  1144. @$(ECHO) ZipPrefix............ $(ZIPPREFIX)
  1145. @$(ECHO) ZipSuffix............ $(ZIPSUFFIX)
  1146. @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE)
  1147. @$(ECHO)
  1148. @$(ECHO) Install base dir..... $(INSTALL_BASEDIR)
  1149. @$(ECHO) Install binary dir... $(INSTALL_BINDIR)
  1150. @$(ECHO) Install library dir.. $(INSTALL_LIBDIR)
  1151. @$(ECHO) Install units dir.... $(INSTALL_UNITDIR)
  1152. @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR)
  1153. @$(ECHO) Install doc dir...... $(INSTALL_DOCDIR)
  1154. @$(ECHO) Install example dir.. $(INSTALL_EXAMPLEDIR)
  1155. @$(ECHO) Install data dir..... $(INSTALL_DATADIR)
  1156. @$(ECHO)
  1157. @$(ECHO) Dist destination dir. $(DIST_DESTDIR)
  1158. @$(ECHO) Dist zip name........ $(DIST_ZIPNAME)
  1159. @$(ECHO)
  1160. .PHONY: fpc_info
  1161. fpc_info: $(INFORULES)
  1162. .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
  1163. fpc_makefile_dirs
  1164. fpc_makefile:
  1165. $(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
  1166. fpc_makefile_sub1:
  1167. ifdef TARGET_DIRS
  1168. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
  1169. endif
  1170. ifdef TARGET_EXAMPLEDIRS
  1171. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
  1172. endif
  1173. fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
  1174. fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
  1175. fpc_makefiles: fpc_makefile fpc_makefile_dirs
  1176. all: fpc_all
  1177. debug: fpc_debug
  1178. smart: fpc_smart
  1179. release: fpc_release
  1180. examples:
  1181. shared:
  1182. install: fpc_install
  1183. sourceinstall: fpc_sourceinstall
  1184. exampleinstall: fpc_exampleinstall
  1185. distinstall:
  1186. zipinstall:
  1187. zipsourceinstall:
  1188. zipexampleinstall:
  1189. zipdistinstall:
  1190. clean: fpc_clean
  1191. distclean: fpc_distclean
  1192. cleanall: fpc_cleanall
  1193. info: fpc_info
  1194. makefiles: fpc_makefiles
  1195. .PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
  1196. ifneq ($(wildcard fpcmake.loc),)
  1197. include fpcmake.loc
  1198. endif
  1199. SYSTEMPPU=$(addsuffix $(PPUEXT),$(SYSTEMUNIT))
  1200. include $(INC)/makefile.inc
  1201. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  1202. include $(PROCINC)/makefile.cpu
  1203. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  1204. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  1205. wprt0$(OEXT) : $(PRT0).as
  1206. $(AS) -o wprt0$(OEXT) $(PRT0).as
  1207. wdllprt0$(OEXT) : wdllprt0.as
  1208. $(AS) -o wdllprt0$(OEXT) wdllprt0.as
  1209. $(SYSTEMUNIT)$(PPUEXT) : $(SYSTEMUNIT).pp win32.inc $(SYSDEPS)
  1210. $(COMPILER) -Us -Sg $(SYSTEMUNIT).pp
  1211. systhrds$(PPUEXT): systhrds.pp $(INC)/threadh.inc $(SYSTEMUNIT)$(PPUEXT)
  1212. objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
  1213. $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
  1214. strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
  1215. $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
  1216. $(SYSTEMUNIT)$(PPUEXT)
  1217. windows$(PPUEXT) : windows.pp $(WINDOWS_SOURCE_FILES) $(SYSTEMUNIT)$(PPUEXT)
  1218. $(COMPILER) -I$(WININC) windows.pp
  1219. messages$(PPUEXT): messages.pp $(SYSTEMUNIT)$(PPUEXT)
  1220. $(COMPILER) -I$(WININC) messages.pp
  1221. ole2$(PPUEXT) : ole2.pp windows$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1222. activex$(PPUEXT) : activex.pp $(WININC)/objbase.inc windows$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1223. opengl32$(PPUEXT) : opengl32.pp windows$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1224. winsock$(PPUEXT) : winsock.pp windows$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1225. sockets$(PPUEXT) : sockets.pp windows$(PPUEXT) winsock$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
  1226. $(INC)/sockets.inc $(INC)/socketsh.inc
  1227. initc$(PPUEXT) : initc.pp $(SYSTEMUNIT)$(PPUEXT)
  1228. wincrt$(PPUEXT) : wincrt.pp $(SYSTEMUNIT)$(PPUEXT) windows$(PPUEXT) graph$(PPUEXT)
  1229. winmouse$(PPUEXT) : winmouse.pp $(SYSTEMUNIT)$(PPUEXT) windows$(PPUEXT) graph$(PPUEXT)
  1230. dynlibs$(PPUEXT) : $(INC)/dynlibs.pp windows$(PPUEXT)
  1231. dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1232. crt$(PPUEXT) : crt.pp $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT) objpas$(PPUEXT) dos$(PPUEXT) windows$(PPUEXT)
  1233. objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMUNIT)$(PPUEXT)
  1234. include $(GRAPHDIR)/makefile.inc
  1235. GRAPHINCDEPS=$(addprefix $(GRAPHDIR)/,$(GRAPHINCNAMES))
  1236. graph$(PPUEXT) : graph.pp strings$(PPUEXT) windows$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
  1237. $(GRAPHINCDEPS)
  1238. $(COMPILER) -I$(GRAPHDIR) graph.pp
  1239. sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/*.inc) \
  1240. objpas$(PPUEXT) dos$(PPUEXT) windows$(PPUEXT)
  1241. $(COMPILER) -I$(OBJPASDIR) sysutils.pp
  1242. typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
  1243. $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp
  1244. math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
  1245. $(COMPILER) $(OBJPASDIR)/math.pp
  1246. varutils$(PPUEXT) : varutils.pp $(OBJPASDIR)/cvarutil.inc \
  1247. objpas$(PPUEXT) $(OBJPASDIR)/varutilh.inc
  1248. $(COMPILER) -I$(OBJPASDIR) varutils.pp
  1249. types$(PPUEXT) : $(OBJPASDIR/types.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1250. $(COMPILER) $(OBJPASDIR)/types.pp
  1251. comobj$(PPUEXT) : comobj.pp activex$(PPUEXT) sysutils$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) $(OBJPASDIR)/comobjh.inc $(OBJPASDIR)/comobj.inc
  1252. $(COMPILER) -I$(OBJPASDIR) comobj.pp
  1253. cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT)
  1254. mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1255. getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
  1256. heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
  1257. $(COMPILER) -Sg $(INC)/heaptrc.pp
  1258. lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT)
  1259. charset$(PPUEXT) : $(INC)/charset.pp $(SYSTEMUNIT)$(PPUEXT)
  1260. ucomplex$(PPUEXT) : $(INC)/ucomplex.pp math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  1261. callspec$(PPUEXT) : $(INC)/callspec.pp $(SYSTEMUNIT)$(PPUEXT)