Makefile 33 KB

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