Makefile 29 KB

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