Makefile 30 KB

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