Makefile 31 KB

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