Makefile 32 KB

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