Makefile 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731
  1. #
  2. # Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/03/19]
  3. #
  4. default: all
  5. MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-palmos arm-wince powerpc64-linux
  6. BSDs = freebsd netbsd openbsd darwin
  7. UNIXs = linux $(BSDs) solaris qnx
  8. LIMIT83fs = go32v2 os2 emx watcom
  9. FORCE:
  10. .PHONY: FORCE
  11. override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
  12. ifneq ($(findstring darwin,$(OSTYPE)),)
  13. inUnix=1 #darwin
  14. SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
  15. else
  16. ifeq ($(findstring ;,$(PATH)),)
  17. inUnix=1
  18. SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
  19. else
  20. SEARCHPATH:=$(subst ;, ,$(PATH))
  21. endif
  22. endif
  23. SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
  24. PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
  25. ifeq ($(PWD),)
  26. PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
  27. ifeq ($(PWD),)
  28. $(error You need the GNU utils package to use this Makefile)
  29. else
  30. PWD:=$(firstword $(PWD))
  31. SRCEXEEXT=
  32. endif
  33. else
  34. PWD:=$(firstword $(PWD))
  35. SRCEXEEXT=.exe
  36. endif
  37. ifndef inUnix
  38. ifeq ($(OS),Windows_NT)
  39. inWinNT=1
  40. else
  41. ifdef OS2_SHELL
  42. inOS2=1
  43. endif
  44. endif
  45. else
  46. ifneq ($(findstring cygdrive,$(PATH)),)
  47. inCygWin=1
  48. endif
  49. endif
  50. ifdef inUnix
  51. SRCBATCHEXT=.sh
  52. else
  53. ifdef inOS2
  54. SRCBATCHEXT=.cmd
  55. else
  56. SRCBATCHEXT=.bat
  57. endif
  58. endif
  59. ifdef inUnix
  60. PATHSEP=/
  61. else
  62. PATHSEP:=$(subst /,\,/)
  63. ifdef inCygWin
  64. PATHSEP=/
  65. endif
  66. endif
  67. ifdef PWD
  68. BASEDIR:=$(subst \,/,$(shell $(PWD)))
  69. ifdef inCygWin
  70. ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
  71. BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
  72. BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
  73. BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
  74. endif
  75. endif
  76. else
  77. BASEDIR=.
  78. endif
  79. ifdef inOS2
  80. ifndef ECHO
  81. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  82. ifeq ($(ECHO),)
  83. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  84. ifeq ($(ECHO),)
  85. ECHO=echo
  86. else
  87. ECHO:=$(firstword $(ECHO))
  88. endif
  89. else
  90. ECHO:=$(firstword $(ECHO))
  91. endif
  92. endif
  93. export ECHO
  94. endif
  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=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
  108. endif
  109. else
  110. override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
  111. endif
  112. endif
  113. override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
  114. override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
  115. FOUNDFPC:=$(strip $(wildcard $(FPC)))
  116. ifeq ($(FOUNDFPC),)
  117. FOUNDFPC=$(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))
  118. ifeq ($(FOUNDFPC),)
  119. $(error Compiler $(FPC) not found)
  120. endif
  121. endif
  122. ifndef FPC_COMPILERINFO
  123. FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
  124. endif
  125. ifndef FPC_VERSION
  126. FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
  127. endif
  128. export FPC FPC_VERSION FPC_COMPILERINFO
  129. unexport CHECKDEPEND ALLDEPENDENCIES
  130. ifndef CPU_TARGET
  131. ifdef CPU_TARGET_DEFAULT
  132. CPU_TARGET=$(CPU_TARGET_DEFAULT)
  133. endif
  134. endif
  135. ifndef OS_TARGET
  136. ifdef OS_TARGET_DEFAULT
  137. OS_TARGET=$(OS_TARGET_DEFAULT)
  138. endif
  139. endif
  140. ifneq ($(words $(FPC_COMPILERINFO)),5)
  141. FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
  142. FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
  143. FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
  144. FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
  145. endif
  146. ifndef CPU_SOURCE
  147. CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
  148. endif
  149. ifndef CPU_TARGET
  150. CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
  151. endif
  152. ifndef OS_SOURCE
  153. OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
  154. endif
  155. ifndef OS_TARGET
  156. OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
  157. endif
  158. FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
  159. FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
  160. ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
  161. TARGETSUFFIX=$(OS_TARGET)
  162. SOURCESUFFIX=$(OS_SOURCE)
  163. else
  164. TARGETSUFFIX=$(FULL_TARGET)
  165. SOURCESUFFIX=$(FULL_SOURCE)
  166. endif
  167. ifneq ($(FULL_TARGET),$(FULL_SOURCE))
  168. CROSSCOMPILE=1
  169. endif
  170. ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
  171. ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),)
  172. $(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
  173. endif
  174. endif
  175. ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
  176. BSDhier=1
  177. endif
  178. ifeq ($(OS_TARGET),linux)
  179. linuxHier=1
  180. endif
  181. export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE
  182. ifdef FPCDIR
  183. override FPCDIR:=$(subst \,/,$(FPCDIR))
  184. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  185. override FPCDIR=wrong
  186. endif
  187. else
  188. override FPCDIR=wrong
  189. endif
  190. ifdef DEFAULT_FPCDIR
  191. ifeq ($(FPCDIR),wrong)
  192. override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
  193. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  194. override FPCDIR=wrong
  195. endif
  196. endif
  197. endif
  198. ifeq ($(FPCDIR),wrong)
  199. ifdef inUnix
  200. override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
  201. ifeq ($(wildcard $(FPCDIR)/units),)
  202. override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
  203. endif
  204. else
  205. override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
  206. override FPCDIR:=$(FPCDIR)/..
  207. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  208. override FPCDIR:=$(FPCDIR)/..
  209. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  210. override FPCDIR:=$(BASEDIR)
  211. ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
  212. override FPCDIR=c:/pp
  213. endif
  214. endif
  215. endif
  216. endif
  217. endif
  218. ifndef CROSSBINDIR
  219. CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
  220. endif
  221. ifndef BINUTILSPREFIX
  222. ifndef CROSSBINDIR
  223. ifdef CROSSCOMPILE
  224. BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)-
  225. endif
  226. endif
  227. endif
  228. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX))
  229. ifeq ($(UNITSDIR),)
  230. UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
  231. endif
  232. PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
  233. ifeq ($(FULL_TARGET),i386-linux)
  234. override TARGET_PROGRAMS+=mciapi1 mciapi2
  235. endif
  236. ifeq ($(FULL_TARGET),i386-go32v2)
  237. override TARGET_PROGRAMS+=mciapi1 mciapi2
  238. endif
  239. ifeq ($(FULL_TARGET),i386-win32)
  240. override TARGET_PROGRAMS+=mciapi1 mciapi2
  241. endif
  242. ifeq ($(FULL_TARGET),i386-os2)
  243. override TARGET_PROGRAMS+=mciapi1 mciapi2
  244. endif
  245. ifeq ($(FULL_TARGET),i386-freebsd)
  246. override TARGET_PROGRAMS+=mciapi1 mciapi2
  247. endif
  248. ifeq ($(FULL_TARGET),i386-beos)
  249. override TARGET_PROGRAMS+=mciapi1 mciapi2
  250. endif
  251. ifeq ($(FULL_TARGET),i386-netbsd)
  252. override TARGET_PROGRAMS+=mciapi1 mciapi2
  253. endif
  254. ifeq ($(FULL_TARGET),i386-solaris)
  255. override TARGET_PROGRAMS+=mciapi1 mciapi2
  256. endif
  257. ifeq ($(FULL_TARGET),i386-qnx)
  258. override TARGET_PROGRAMS+=mciapi1 mciapi2
  259. endif
  260. ifeq ($(FULL_TARGET),i386-netware)
  261. override TARGET_PROGRAMS+=mciapi1 mciapi2
  262. endif
  263. ifeq ($(FULL_TARGET),i386-openbsd)
  264. override TARGET_PROGRAMS+=mciapi1 mciapi2
  265. endif
  266. ifeq ($(FULL_TARGET),i386-wdosx)
  267. override TARGET_PROGRAMS+=mciapi1 mciapi2
  268. endif
  269. ifeq ($(FULL_TARGET),i386-darwin)
  270. override TARGET_PROGRAMS+=mciapi1 mciapi2
  271. endif
  272. ifeq ($(FULL_TARGET),i386-emx)
  273. override TARGET_PROGRAMS+=mciapi1 mciapi2
  274. endif
  275. ifeq ($(FULL_TARGET),i386-watcom)
  276. override TARGET_PROGRAMS+=mciapi1 mciapi2
  277. endif
  278. ifeq ($(FULL_TARGET),i386-netwlibc)
  279. override TARGET_PROGRAMS+=mciapi1 mciapi2
  280. endif
  281. ifeq ($(FULL_TARGET),i386-wince)
  282. override TARGET_PROGRAMS+=mciapi1 mciapi2
  283. endif
  284. ifeq ($(FULL_TARGET),m68k-linux)
  285. override TARGET_PROGRAMS+=mciapi1 mciapi2
  286. endif
  287. ifeq ($(FULL_TARGET),m68k-freebsd)
  288. override TARGET_PROGRAMS+=mciapi1 mciapi2
  289. endif
  290. ifeq ($(FULL_TARGET),m68k-netbsd)
  291. override TARGET_PROGRAMS+=mciapi1 mciapi2
  292. endif
  293. ifeq ($(FULL_TARGET),m68k-amiga)
  294. override TARGET_PROGRAMS+=mciapi1 mciapi2
  295. endif
  296. ifeq ($(FULL_TARGET),m68k-atari)
  297. override TARGET_PROGRAMS+=mciapi1 mciapi2
  298. endif
  299. ifeq ($(FULL_TARGET),m68k-openbsd)
  300. override TARGET_PROGRAMS+=mciapi1 mciapi2
  301. endif
  302. ifeq ($(FULL_TARGET),m68k-palmos)
  303. override TARGET_PROGRAMS+=mciapi1 mciapi2
  304. endif
  305. ifeq ($(FULL_TARGET),powerpc-linux)
  306. override TARGET_PROGRAMS+=mciapi1 mciapi2
  307. endif
  308. ifeq ($(FULL_TARGET),powerpc-netbsd)
  309. override TARGET_PROGRAMS+=mciapi1 mciapi2
  310. endif
  311. ifeq ($(FULL_TARGET),powerpc-macos)
  312. override TARGET_PROGRAMS+=mciapi1 mciapi2
  313. endif
  314. ifeq ($(FULL_TARGET),powerpc-darwin)
  315. override TARGET_PROGRAMS+=mciapi1 mciapi2
  316. endif
  317. ifeq ($(FULL_TARGET),powerpc-morphos)
  318. override TARGET_PROGRAMS+=mciapi1 mciapi2
  319. endif
  320. ifeq ($(FULL_TARGET),sparc-linux)
  321. override TARGET_PROGRAMS+=mciapi1 mciapi2
  322. endif
  323. ifeq ($(FULL_TARGET),sparc-netbsd)
  324. override TARGET_PROGRAMS+=mciapi1 mciapi2
  325. endif
  326. ifeq ($(FULL_TARGET),sparc-solaris)
  327. override TARGET_PROGRAMS+=mciapi1 mciapi2
  328. endif
  329. ifeq ($(FULL_TARGET),x86_64-linux)
  330. override TARGET_PROGRAMS+=mciapi1 mciapi2
  331. endif
  332. ifeq ($(FULL_TARGET),x86_64-freebsd)
  333. override TARGET_PROGRAMS+=mciapi1 mciapi2
  334. endif
  335. ifeq ($(FULL_TARGET),x86_64-win64)
  336. override TARGET_PROGRAMS+=mciapi1 mciapi2
  337. endif
  338. ifeq ($(FULL_TARGET),arm-linux)
  339. override TARGET_PROGRAMS+=mciapi1 mciapi2
  340. endif
  341. ifeq ($(FULL_TARGET),arm-palmos)
  342. override TARGET_PROGRAMS+=mciapi1 mciapi2
  343. endif
  344. ifeq ($(FULL_TARGET),arm-wince)
  345. override TARGET_PROGRAMS+=mciapi1 mciapi2
  346. endif
  347. ifeq ($(FULL_TARGET),powerpc64-linux)
  348. override TARGET_PROGRAMS+=mciapi1 mciapi2
  349. endif
  350. override INSTALL_FPCPACKAGE=y
  351. ifdef REQUIRE_UNITSDIR
  352. override UNITSDIR+=$(REQUIRE_UNITSDIR)
  353. endif
  354. ifdef REQUIRE_PACKAGESDIR
  355. override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
  356. endif
  357. ifdef ZIPINSTALL
  358. ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
  359. UNIXHier=1
  360. endif
  361. else
  362. ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
  363. UNIXHier=1
  364. endif
  365. endif
  366. ifndef INSTALL_PREFIX
  367. ifdef PREFIX
  368. INSTALL_PREFIX=$(PREFIX)
  369. endif
  370. endif
  371. ifndef INSTALL_PREFIX
  372. ifdef UNIXHier
  373. INSTALL_PREFIX=/usr/local
  374. else
  375. ifdef INSTALL_FPCPACKAGE
  376. INSTALL_BASEDIR:=/pp
  377. else
  378. INSTALL_BASEDIR:=/$(PACKAGE_NAME)
  379. endif
  380. endif
  381. endif
  382. export INSTALL_PREFIX
  383. ifdef INSTALL_FPCSUBDIR
  384. export INSTALL_FPCSUBDIR
  385. endif
  386. ifndef DIST_DESTDIR
  387. DIST_DESTDIR:=$(BASEDIR)
  388. endif
  389. export DIST_DESTDIR
  390. ifndef COMPILER_UNITTARGETDIR
  391. ifdef PACKAGEDIR_MAIN
  392. COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX)
  393. else
  394. COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX)
  395. endif
  396. endif
  397. ifndef COMPILER_TARGETDIR
  398. COMPILER_TARGETDIR=.
  399. endif
  400. ifndef INSTALL_BASEDIR
  401. ifdef UNIXHier
  402. ifdef INSTALL_FPCPACKAGE
  403. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
  404. else
  405. INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
  406. endif
  407. else
  408. INSTALL_BASEDIR:=$(INSTALL_PREFIX)
  409. endif
  410. endif
  411. ifndef INSTALL_BINDIR
  412. ifdef UNIXHier
  413. INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
  414. else
  415. INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
  416. ifdef INSTALL_FPCPACKAGE
  417. ifdef CROSSCOMPILE
  418. ifdef CROSSINSTALL
  419. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX)
  420. else
  421. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
  422. endif
  423. else
  424. INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
  425. endif
  426. endif
  427. endif
  428. endif
  429. ifndef INSTALL_UNITDIR
  430. INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX)
  431. ifdef INSTALL_FPCPACKAGE
  432. ifdef PACKAGE_NAME
  433. INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
  434. endif
  435. endif
  436. endif
  437. ifndef INSTALL_LIBDIR
  438. ifdef UNIXHier
  439. INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
  440. else
  441. INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
  442. endif
  443. endif
  444. ifndef INSTALL_SOURCEDIR
  445. ifdef UNIXHier
  446. ifdef BSDhier
  447. SRCPREFIXDIR=share/src
  448. else
  449. ifdef linuxHier
  450. SRCPREFIXDIR=share/src
  451. else
  452. SRCPREFIXDIR=src
  453. endif
  454. endif
  455. ifdef INSTALL_FPCPACKAGE
  456. ifdef INSTALL_FPCSUBDIR
  457. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  458. else
  459. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  460. endif
  461. else
  462. INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  463. endif
  464. else
  465. ifdef INSTALL_FPCPACKAGE
  466. ifdef INSTALL_FPCSUBDIR
  467. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
  468. else
  469. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
  470. endif
  471. else
  472. INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
  473. endif
  474. endif
  475. endif
  476. ifndef INSTALL_DOCDIR
  477. ifdef UNIXHier
  478. ifdef BSDhier
  479. DOCPREFIXDIR=share/doc
  480. else
  481. ifdef linuxHier
  482. DOCPREFIXDIR=share/doc
  483. else
  484. DOCPREFIXDIR=doc
  485. endif
  486. endif
  487. ifdef INSTALL_FPCPACKAGE
  488. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  489. else
  490. INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  491. endif
  492. else
  493. ifdef INSTALL_FPCPACKAGE
  494. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
  495. else
  496. INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
  497. endif
  498. endif
  499. endif
  500. ifndef INSTALL_EXAMPLEDIR
  501. ifdef UNIXHier
  502. ifdef INSTALL_FPCPACKAGE
  503. ifdef BSDhier
  504. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
  505. else
  506. ifdef linuxHier
  507. INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples
  508. else
  509. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
  510. endif
  511. endif
  512. else
  513. ifdef BSDhier
  514. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  515. else
  516. ifdef linuxHier
  517. INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  518. else
  519. INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
  520. endif
  521. endif
  522. endif
  523. else
  524. ifdef INSTALL_FPCPACKAGE
  525. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
  526. else
  527. INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
  528. endif
  529. endif
  530. endif
  531. ifndef INSTALL_DATADIR
  532. INSTALL_DATADIR=$(INSTALL_BASEDIR)
  533. endif
  534. ifndef INSTALL_SHAREDDIR
  535. INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
  536. endif
  537. ifdef CROSSCOMPILE
  538. ifndef CROSSBINDIR
  539. CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
  540. ifeq ($(CROSSBINDIR),)
  541. CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE))
  542. endif
  543. endif
  544. else
  545. CROSSBINDIR=
  546. endif
  547. BATCHEXT=.bat
  548. LOADEREXT=.as
  549. EXEEXT=.exe
  550. PPLEXT=.ppl
  551. PPUEXT=.ppu
  552. OEXT=.o
  553. ASMEXT=.s
  554. SMARTEXT=.sl
  555. STATICLIBEXT=.a
  556. SHAREDLIBEXT=.so
  557. SHAREDLIBPREFIX=libfp
  558. STATICLIBPREFIX=libp
  559. RSTEXT=.rst
  560. ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
  561. ifeq ($(OS_TARGET),go32v1)
  562. STATICLIBPREFIX=
  563. SHORTSUFFIX=v1
  564. endif
  565. ifeq ($(OS_TARGET),go32v2)
  566. STATICLIBPREFIX=
  567. SHORTSUFFIX=dos
  568. endif
  569. ifeq ($(OS_TARGET),watcom)
  570. STATICLIBPREFIX=
  571. OEXT=.obj
  572. ASMEXT=.asm
  573. SHAREDLIBEXT=.dll
  574. SHORTSUFFIX=wat
  575. endif
  576. ifeq ($(OS_TARGET),linux)
  577. BATCHEXT=.sh
  578. EXEEXT=
  579. HASSHAREDLIB=1
  580. SHORTSUFFIX=lnx
  581. endif
  582. ifeq ($(OS_TARGET),freebsd)
  583. BATCHEXT=.sh
  584. EXEEXT=
  585. HASSHAREDLIB=1
  586. SHORTSUFFIX=fbs
  587. endif
  588. ifeq ($(OS_TARGET),netbsd)
  589. BATCHEXT=.sh
  590. EXEEXT=
  591. HASSHAREDLIB=1
  592. SHORTSUFFIX=nbs
  593. endif
  594. ifeq ($(OS_TARGET),openbsd)
  595. BATCHEXT=.sh
  596. EXEEXT=
  597. HASSHAREDLIB=1
  598. SHORTSUFFIX=obs
  599. endif
  600. ifeq ($(OS_TARGET),win32)
  601. SHAREDLIBEXT=.dll
  602. SHORTSUFFIX=w32
  603. endif
  604. ifeq ($(OS_TARGET),os2)
  605. BATCHEXT=.cmd
  606. AOUTEXT=.out
  607. STATICLIBPREFIX=
  608. SHAREDLIBEXT=.dll
  609. SHORTSUFFIX=os2
  610. ECHO=echo
  611. endif
  612. ifeq ($(OS_TARGET),emx)
  613. BATCHEXT=.cmd
  614. AOUTEXT=.out
  615. STATICLIBPREFIX=
  616. SHAREDLIBEXT=.dll
  617. SHORTSUFFIX=emx
  618. ECHO=echo
  619. endif
  620. ifeq ($(OS_TARGET),amiga)
  621. EXEEXT=
  622. SHAREDLIBEXT=.library
  623. SHORTSUFFIX=amg
  624. endif
  625. ifeq ($(OS_TARGET),morphos)
  626. EXEEXT=
  627. SHAREDLIBEXT=.library
  628. SHORTSUFFIX=mos
  629. endif
  630. ifeq ($(OS_TARGET),atari)
  631. EXEEXT=.ttp
  632. SHORTSUFFIX=ata
  633. endif
  634. ifeq ($(OS_TARGET),beos)
  635. BATCHEXT=.sh
  636. EXEEXT=
  637. SHORTSUFFIX=be
  638. endif
  639. ifeq ($(OS_TARGET),solaris)
  640. BATCHEXT=.sh
  641. EXEEXT=
  642. SHORTSUFFIX=sun
  643. endif
  644. ifeq ($(OS_TARGET),qnx)
  645. BATCHEXT=.sh
  646. EXEEXT=
  647. SHORTSUFFIX=qnx
  648. endif
  649. ifeq ($(OS_TARGET),netware)
  650. EXEEXT=.nlm
  651. STATICLIBPREFIX=
  652. SHORTSUFFIX=nw
  653. endif
  654. ifeq ($(OS_TARGET),netwlibc)
  655. EXEEXT=.nlm
  656. STATICLIBPREFIX=
  657. SHORTSUFFIX=nwl
  658. endif
  659. ifeq ($(OS_TARGET),macos)
  660. BATCHEXT=
  661. EXEEXT=
  662. DEBUGSYMEXT=.xcoff
  663. SHORTSUFFIX=mac
  664. endif
  665. ifeq ($(OS_TARGET),darwin)
  666. BATCHEXT=.sh
  667. EXEEXT=
  668. HASSHAREDLIB=1
  669. SHORTSUFFIX=dwn
  670. endif
  671. else
  672. ifeq ($(OS_TARGET),go32v1)
  673. PPUEXT=.pp1
  674. OEXT=.o1
  675. ASMEXT=.s1
  676. SMARTEXT=.sl1
  677. STATICLIBEXT=.a1
  678. SHAREDLIBEXT=.so1
  679. STATICLIBPREFIX=
  680. SHORTSUFFIX=v1
  681. endif
  682. ifeq ($(OS_TARGET),go32v2)
  683. STATICLIBPREFIX=
  684. SHORTSUFFIX=dos
  685. endif
  686. ifeq ($(OS_TARGET),watcom)
  687. STATICLIBPREFIX=
  688. SHORTSUFFIX=wat
  689. endif
  690. ifeq ($(OS_TARGET),linux)
  691. BATCHEXT=.sh
  692. EXEEXT=
  693. HASSHAREDLIB=1
  694. SHORTSUFFIX=lnx
  695. endif
  696. ifeq ($(OS_TARGET),freebsd)
  697. BATCHEXT=.sh
  698. EXEEXT=
  699. HASSHAREDLIB=1
  700. SHORTSUFFIX=fbs
  701. endif
  702. ifeq ($(OS_TARGET),netbsd)
  703. BATCHEXT=.sh
  704. EXEEXT=
  705. HASSHAREDLIB=1
  706. SHORTSUFFIX=nbs
  707. endif
  708. ifeq ($(OS_TARGET),openbsd)
  709. BATCHEXT=.sh
  710. EXEEXT=
  711. HASSHAREDLIB=1
  712. SHORTSUFFIX=obs
  713. endif
  714. ifeq ($(OS_TARGET),win32)
  715. PPUEXT=.ppw
  716. OEXT=.ow
  717. ASMEXT=.sw
  718. SMARTEXT=.slw
  719. STATICLIBEXT=.aw
  720. SHAREDLIBEXT=.dll
  721. SHORTSUFFIX=w32
  722. endif
  723. ifeq ($(OS_TARGET),os2)
  724. BATCHEXT=.cmd
  725. PPUEXT=.ppo
  726. ASMEXT=.so2
  727. OEXT=.oo2
  728. AOUTEXT=.out
  729. SMARTEXT=.sl2
  730. STATICLIBPREFIX=
  731. STATICLIBEXT=.ao2
  732. SHAREDLIBEXT=.dll
  733. SHORTSUFFIX=os2
  734. ECHO=echo
  735. endif
  736. ifeq ($(OS_TARGET),amiga)
  737. EXEEXT=
  738. PPUEXT=.ppu
  739. ASMEXT=.asm
  740. OEXT=.o
  741. SMARTEXT=.sl
  742. STATICLIBEXT=.a
  743. SHAREDLIBEXT=.library
  744. SHORTSUFFIX=amg
  745. endif
  746. ifeq ($(OS_TARGET),atari)
  747. PPUEXT=.ppu
  748. ASMEXT=.s
  749. OEXT=.o
  750. SMARTEXT=.sl
  751. STATICLIBEXT=.a
  752. EXEEXT=.ttp
  753. SHORTSUFFIX=ata
  754. endif
  755. ifeq ($(OS_TARGET),beos)
  756. BATCHEXT=.sh
  757. PPUEXT=.ppu
  758. ASMEXT=.s
  759. OEXT=.o
  760. SMARTEXT=.sl
  761. STATICLIBEXT=.a
  762. EXEEXT=
  763. SHORTSUFFIX=be
  764. endif
  765. ifeq ($(OS_TARGET),solaris)
  766. BATCHEXT=.sh
  767. PPUEXT=.ppu
  768. ASMEXT=.s
  769. OEXT=.o
  770. SMARTEXT=.sl
  771. STATICLIBEXT=.a
  772. EXEEXT=
  773. SHORTSUFFIX=sun
  774. endif
  775. ifeq ($(OS_TARGET),qnx)
  776. BATCHEXT=.sh
  777. PPUEXT=.ppu
  778. ASMEXT=.s
  779. OEXT=.o
  780. SMARTEXT=.sl
  781. STATICLIBEXT=.a
  782. EXEEXT=
  783. SHORTSUFFIX=qnx
  784. endif
  785. ifeq ($(OS_TARGET),netware)
  786. STATICLIBPREFIX=
  787. PPUEXT=.ppu
  788. OEXT=.o
  789. ASMEXT=.s
  790. SMARTEXT=.sl
  791. STATICLIBEXT=.a
  792. SHAREDLIBEXT=.nlm
  793. EXEEXT=.nlm
  794. SHORTSUFFIX=nw
  795. endif
  796. ifeq ($(OS_TARGET),netwlibc)
  797. STATICLIBPREFIX=
  798. PPUEXT=.ppu
  799. OEXT=.o
  800. ASMEXT=.s
  801. SMARTEXT=.sl
  802. STATICLIBEXT=.a
  803. SHAREDLIBEXT=.nlm
  804. EXEEXT=.nlm
  805. SHORTSUFFIX=nwl
  806. endif
  807. ifeq ($(OS_TARGET),macos)
  808. BATCHEXT=
  809. PPUEXT=.ppu
  810. ASMEXT=.s
  811. OEXT=.o
  812. SMARTEXT=.sl
  813. STATICLIBEXT=.a
  814. EXEEXT=
  815. DEBUGSYMEXT=.xcoff
  816. SHORTSUFFIX=mac
  817. endif
  818. endif
  819. ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
  820. FPCMADE=fpcmade.$(SHORTSUFFIX)
  821. ZIPSUFFIX=$(SHORTSUFFIX)
  822. ZIPCROSSPREFIX=
  823. ZIPSOURCESUFFIX=src
  824. ZIPEXAMPLESUFFIX=exm
  825. else
  826. FPCMADE=fpcmade.$(TARGETSUFFIX)
  827. ZIPSOURCESUFFIX=.source
  828. ZIPEXAMPLESUFFIX=.examples
  829. ifdef CROSSCOMPILE
  830. ZIPSUFFIX=.$(SOURCESUFFIX)
  831. ZIPCROSSPREFIX=$(TARGETSUFFIX)-
  832. else
  833. ZIPSUFFIX=.$(TARGETSUFFIX)
  834. ZIPCROSSPREFIX=
  835. endif
  836. endif
  837. ifndef ECHO
  838. ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
  839. ifeq ($(ECHO),)
  840. ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
  841. ifeq ($(ECHO),)
  842. ECHO= __missing_command_ECHO
  843. else
  844. ECHO:=$(firstword $(ECHO))
  845. endif
  846. else
  847. ECHO:=$(firstword $(ECHO))
  848. endif
  849. endif
  850. export ECHO
  851. ifndef DATE
  852. DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
  853. ifeq ($(DATE),)
  854. DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
  855. ifeq ($(DATE),)
  856. DATE= __missing_command_DATE
  857. else
  858. DATE:=$(firstword $(DATE))
  859. endif
  860. else
  861. DATE:=$(firstword $(DATE))
  862. endif
  863. endif
  864. export DATE
  865. ifndef GINSTALL
  866. GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
  867. ifeq ($(GINSTALL),)
  868. GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
  869. ifeq ($(GINSTALL),)
  870. GINSTALL= __missing_command_GINSTALL
  871. else
  872. GINSTALL:=$(firstword $(GINSTALL))
  873. endif
  874. else
  875. GINSTALL:=$(firstword $(GINSTALL))
  876. endif
  877. endif
  878. export GINSTALL
  879. ifndef CPPROG
  880. CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
  881. ifeq ($(CPPROG),)
  882. CPPROG= __missing_command_CPPROG
  883. else
  884. CPPROG:=$(firstword $(CPPROG))
  885. endif
  886. endif
  887. export CPPROG
  888. ifndef RMPROG
  889. RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
  890. ifeq ($(RMPROG),)
  891. RMPROG= __missing_command_RMPROG
  892. else
  893. RMPROG:=$(firstword $(RMPROG))
  894. endif
  895. endif
  896. export RMPROG
  897. ifndef MVPROG
  898. MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
  899. ifeq ($(MVPROG),)
  900. MVPROG= __missing_command_MVPROG
  901. else
  902. MVPROG:=$(firstword $(MVPROG))
  903. endif
  904. endif
  905. export MVPROG
  906. ifndef MKDIRPROG
  907. MKDIRPROG:=$(strip $(wildcard $(addsuffix /gmkdir$(SRCEXEEXT),$(SEARCHPATH))))
  908. ifeq ($(MKDIRPROG),)
  909. MKDIRPROG:=$(strip $(wildcard $(addsuffix /mkdir$(SRCEXEEXT),$(SEARCHPATH))))
  910. ifeq ($(MKDIRPROG),)
  911. MKDIRPROG= __missing_command_MKDIRPROG
  912. else
  913. MKDIRPROG:=$(firstword $(MKDIRPROG))
  914. endif
  915. else
  916. MKDIRPROG:=$(firstword $(MKDIRPROG))
  917. endif
  918. endif
  919. export MKDIRPROG
  920. ifndef ECHOREDIR
  921. ifndef inUnix
  922. ECHOREDIR=echo
  923. else
  924. ECHOREDIR=$(ECHO)
  925. endif
  926. endif
  927. ifndef COPY
  928. COPY:=$(CPPROG) -fp
  929. endif
  930. ifndef COPYTREE
  931. COPYTREE:=$(CPPROG) -Rfp
  932. endif
  933. ifndef MKDIRTREE
  934. MKDIRTREE:=$(MKDIRPROG) -p
  935. endif
  936. ifndef MOVE
  937. MOVE:=$(MVPROG) -f
  938. endif
  939. ifndef DEL
  940. DEL:=$(RMPROG) -f
  941. endif
  942. ifndef DELTREE
  943. DELTREE:=$(RMPROG) -rf
  944. endif
  945. ifndef INSTALL
  946. ifdef inUnix
  947. INSTALL:=$(GINSTALL) -c -m 644
  948. else
  949. INSTALL:=$(COPY)
  950. endif
  951. endif
  952. ifndef INSTALLEXE
  953. ifdef inUnix
  954. INSTALLEXE:=$(GINSTALL) -c -m 755
  955. else
  956. INSTALLEXE:=$(COPY)
  957. endif
  958. endif
  959. ifndef MKDIR
  960. MKDIR:=$(GINSTALL) -m 755 -d
  961. endif
  962. export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
  963. ifndef PPUMOVE
  964. PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
  965. ifeq ($(PPUMOVE),)
  966. PPUMOVE= __missing_command_PPUMOVE
  967. else
  968. PPUMOVE:=$(firstword $(PPUMOVE))
  969. endif
  970. endif
  971. export PPUMOVE
  972. ifndef FPCMAKE
  973. FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
  974. ifeq ($(FPCMAKE),)
  975. FPCMAKE= __missing_command_FPCMAKE
  976. else
  977. FPCMAKE:=$(firstword $(FPCMAKE))
  978. endif
  979. endif
  980. export FPCMAKE
  981. ifndef ZIPPROG
  982. ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
  983. ifeq ($(ZIPPROG),)
  984. ZIPPROG= __missing_command_ZIPPROG
  985. else
  986. ZIPPROG:=$(firstword $(ZIPPROG))
  987. endif
  988. endif
  989. export ZIPPROG
  990. ifndef TARPROG
  991. TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
  992. ifeq ($(TARPROG),)
  993. TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
  994. ifeq ($(TARPROG),)
  995. TARPROG= __missing_command_TARPROG
  996. else
  997. TARPROG:=$(firstword $(TARPROG))
  998. endif
  999. else
  1000. TARPROG:=$(firstword $(TARPROG))
  1001. endif
  1002. endif
  1003. export TARPROG
  1004. ASNAME=$(BINUTILSPREFIX)as
  1005. LDNAME=$(BINUTILSPREFIX)ld
  1006. ARNAME=$(BINUTILSPREFIX)ar
  1007. RCNAME=$(BINUTILSPREFIX)rc
  1008. ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
  1009. ifeq ($(OS_TARGET),win32)
  1010. ifeq ($(CROSSBINDIR),)
  1011. ASNAME=asw
  1012. LDNAME=ldw
  1013. ARNAME=arw
  1014. endif
  1015. endif
  1016. endif
  1017. ifndef ASPROG
  1018. ifdef CROSSBINDIR
  1019. ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
  1020. else
  1021. ASPROG=$(ASNAME)
  1022. endif
  1023. endif
  1024. ifndef LDPROG
  1025. ifdef CROSSBINDIR
  1026. LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
  1027. else
  1028. LDPROG=$(LDNAME)
  1029. endif
  1030. endif
  1031. ifndef RCPROG
  1032. ifdef CROSSBINDIR
  1033. RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
  1034. else
  1035. RCPROG=$(RCNAME)
  1036. endif
  1037. endif
  1038. ifndef ARPROG
  1039. ifdef CROSSBINDIR
  1040. ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
  1041. else
  1042. ARPROG=$(ARNAME)
  1043. endif
  1044. endif
  1045. AS=$(ASPROG)
  1046. LD=$(LDPROG)
  1047. RC=$(RCPROG)
  1048. AR=$(ARPROG)
  1049. PPAS=ppas$(SRCBATCHEXT)
  1050. ifdef inUnix
  1051. LDCONFIG=ldconfig
  1052. else
  1053. LDCONFIG=
  1054. endif
  1055. ifdef DATE
  1056. DATESTR:=$(shell $(DATE) +%Y%m%d)
  1057. else
  1058. DATESTR=
  1059. endif
  1060. ifndef UPXPROG
  1061. ifeq ($(OS_TARGET),go32v2)
  1062. UPXPROG:=1
  1063. endif
  1064. ifeq ($(OS_TARGET),win32)
  1065. UPXPROG:=1
  1066. endif
  1067. ifdef UPXPROG
  1068. UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
  1069. ifeq ($(UPXPROG),)
  1070. UPXPROG=
  1071. else
  1072. UPXPROG:=$(firstword $(UPXPROG))
  1073. endif
  1074. else
  1075. UPXPROG=
  1076. endif
  1077. endif
  1078. export UPXPROG
  1079. ZIPOPT=-9
  1080. ZIPEXT=.zip
  1081. ifeq ($(USETAR),bz2)
  1082. TAROPT=vj
  1083. TAREXT=.tar.bz2
  1084. else
  1085. TAROPT=vz
  1086. TAREXT=.tar.gz
  1087. endif
  1088. override REQUIRE_PACKAGES=rtl
  1089. ifeq ($(FULL_TARGET),i386-linux)
  1090. REQUIRE_PACKAGES_RTL=1
  1091. endif
  1092. ifeq ($(FULL_TARGET),i386-go32v2)
  1093. REQUIRE_PACKAGES_RTL=1
  1094. endif
  1095. ifeq ($(FULL_TARGET),i386-win32)
  1096. REQUIRE_PACKAGES_RTL=1
  1097. endif
  1098. ifeq ($(FULL_TARGET),i386-os2)
  1099. REQUIRE_PACKAGES_RTL=1
  1100. endif
  1101. ifeq ($(FULL_TARGET),i386-freebsd)
  1102. REQUIRE_PACKAGES_RTL=1
  1103. endif
  1104. ifeq ($(FULL_TARGET),i386-beos)
  1105. REQUIRE_PACKAGES_RTL=1
  1106. endif
  1107. ifeq ($(FULL_TARGET),i386-netbsd)
  1108. REQUIRE_PACKAGES_RTL=1
  1109. endif
  1110. ifeq ($(FULL_TARGET),i386-solaris)
  1111. REQUIRE_PACKAGES_RTL=1
  1112. endif
  1113. ifeq ($(FULL_TARGET),i386-qnx)
  1114. REQUIRE_PACKAGES_RTL=1
  1115. endif
  1116. ifeq ($(FULL_TARGET),i386-netware)
  1117. REQUIRE_PACKAGES_RTL=1
  1118. endif
  1119. ifeq ($(FULL_TARGET),i386-openbsd)
  1120. REQUIRE_PACKAGES_RTL=1
  1121. endif
  1122. ifeq ($(FULL_TARGET),i386-wdosx)
  1123. REQUIRE_PACKAGES_RTL=1
  1124. endif
  1125. ifeq ($(FULL_TARGET),i386-darwin)
  1126. REQUIRE_PACKAGES_RTL=1
  1127. endif
  1128. ifeq ($(FULL_TARGET),i386-emx)
  1129. REQUIRE_PACKAGES_RTL=1
  1130. endif
  1131. ifeq ($(FULL_TARGET),i386-watcom)
  1132. REQUIRE_PACKAGES_RTL=1
  1133. endif
  1134. ifeq ($(FULL_TARGET),i386-netwlibc)
  1135. REQUIRE_PACKAGES_RTL=1
  1136. endif
  1137. ifeq ($(FULL_TARGET),i386-wince)
  1138. REQUIRE_PACKAGES_RTL=1
  1139. endif
  1140. ifeq ($(FULL_TARGET),m68k-linux)
  1141. REQUIRE_PACKAGES_RTL=1
  1142. endif
  1143. ifeq ($(FULL_TARGET),m68k-freebsd)
  1144. REQUIRE_PACKAGES_RTL=1
  1145. endif
  1146. ifeq ($(FULL_TARGET),m68k-netbsd)
  1147. REQUIRE_PACKAGES_RTL=1
  1148. endif
  1149. ifeq ($(FULL_TARGET),m68k-amiga)
  1150. REQUIRE_PACKAGES_RTL=1
  1151. endif
  1152. ifeq ($(FULL_TARGET),m68k-atari)
  1153. REQUIRE_PACKAGES_RTL=1
  1154. endif
  1155. ifeq ($(FULL_TARGET),m68k-openbsd)
  1156. REQUIRE_PACKAGES_RTL=1
  1157. endif
  1158. ifeq ($(FULL_TARGET),m68k-palmos)
  1159. REQUIRE_PACKAGES_RTL=1
  1160. endif
  1161. ifeq ($(FULL_TARGET),powerpc-linux)
  1162. REQUIRE_PACKAGES_RTL=1
  1163. endif
  1164. ifeq ($(FULL_TARGET),powerpc-netbsd)
  1165. REQUIRE_PACKAGES_RTL=1
  1166. endif
  1167. ifeq ($(FULL_TARGET),powerpc-macos)
  1168. REQUIRE_PACKAGES_RTL=1
  1169. endif
  1170. ifeq ($(FULL_TARGET),powerpc-darwin)
  1171. REQUIRE_PACKAGES_RTL=1
  1172. endif
  1173. ifeq ($(FULL_TARGET),powerpc-morphos)
  1174. REQUIRE_PACKAGES_RTL=1
  1175. endif
  1176. ifeq ($(FULL_TARGET),sparc-linux)
  1177. REQUIRE_PACKAGES_RTL=1
  1178. endif
  1179. ifeq ($(FULL_TARGET),sparc-netbsd)
  1180. REQUIRE_PACKAGES_RTL=1
  1181. endif
  1182. ifeq ($(FULL_TARGET),sparc-solaris)
  1183. REQUIRE_PACKAGES_RTL=1
  1184. endif
  1185. ifeq ($(FULL_TARGET),x86_64-linux)
  1186. REQUIRE_PACKAGES_RTL=1
  1187. endif
  1188. ifeq ($(FULL_TARGET),x86_64-freebsd)
  1189. REQUIRE_PACKAGES_RTL=1
  1190. endif
  1191. ifeq ($(FULL_TARGET),x86_64-win64)
  1192. REQUIRE_PACKAGES_RTL=1
  1193. endif
  1194. ifeq ($(FULL_TARGET),arm-linux)
  1195. REQUIRE_PACKAGES_RTL=1
  1196. endif
  1197. ifeq ($(FULL_TARGET),arm-palmos)
  1198. REQUIRE_PACKAGES_RTL=1
  1199. endif
  1200. ifeq ($(FULL_TARGET),arm-wince)
  1201. REQUIRE_PACKAGES_RTL=1
  1202. endif
  1203. ifeq ($(FULL_TARGET),powerpc64-linux)
  1204. REQUIRE_PACKAGES_RTL=1
  1205. endif
  1206. ifdef REQUIRE_PACKAGES_RTL
  1207. PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
  1208. ifneq ($(PACKAGEDIR_RTL),)
  1209. ifneq ($(wildcard $(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)),)
  1210. UNITDIR_RTL=$(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)
  1211. else
  1212. UNITDIR_RTL=$(PACKAGEDIR_RTL)
  1213. endif
  1214. ifdef CHECKDEPEND
  1215. $(PACKAGEDIR_RTL)/$(FPCMADE):
  1216. $(MAKE) -C $(PACKAGEDIR_RTL) $(FPCMADE)
  1217. override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
  1218. endif
  1219. else
  1220. PACKAGEDIR_RTL=
  1221. UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
  1222. ifneq ($(UNITDIR_RTL),)
  1223. UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
  1224. else
  1225. UNITDIR_RTL=
  1226. endif
  1227. endif
  1228. ifdef UNITDIR_RTL
  1229. override COMPILER_UNITDIR+=$(UNITDIR_RTL)
  1230. endif
  1231. endif
  1232. ifndef NOCPUDEF
  1233. override FPCOPTDEF=$(CPU_TARGET)
  1234. endif
  1235. ifneq ($(OS_TARGET),$(OS_SOURCE))
  1236. override FPCOPT+=-T$(OS_TARGET)
  1237. endif
  1238. ifeq ($(OS_SOURCE),openbsd)
  1239. override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
  1240. endif
  1241. ifndef CROSSBOOTSTRAP
  1242. ifneq ($(BINUTILSPREFIX),)
  1243. override FPCOPT+=-XP$(BINUTILSPREFIX) -Xc
  1244. endif
  1245. ifneq ($(BINUTILSPREFIX),)
  1246. override FPCOPT+=-Xr$(RLINKPATH)
  1247. endif
  1248. endif
  1249. ifdef UNITDIR
  1250. override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
  1251. endif
  1252. ifdef LIBDIR
  1253. override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
  1254. endif
  1255. ifdef OBJDIR
  1256. override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
  1257. endif
  1258. ifdef INCDIR
  1259. override FPCOPT+=$(addprefix -Fi,$(INCDIR))
  1260. endif
  1261. ifdef LINKSMART
  1262. override FPCOPT+=-XX
  1263. endif
  1264. ifdef CREATESMART
  1265. override FPCOPT+=-CX
  1266. endif
  1267. ifdef DEBUG
  1268. override FPCOPT+=-gl
  1269. override FPCOPTDEF+=DEBUG
  1270. endif
  1271. ifdef RELEASE
  1272. ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
  1273. ifeq ($(CPU_TARGET),i386)
  1274. FPCCPUOPT:=-OG2p3
  1275. endif
  1276. ifeq ($(CPU_TARGET),powerpc)
  1277. FPCCPUOPT:=-O1r
  1278. endif
  1279. else
  1280. FPCCPUOPT:=-O2
  1281. endif
  1282. override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
  1283. override FPCOPTDEF+=RELEASE
  1284. endif
  1285. ifdef STRIP
  1286. override FPCOPT+=-Xs
  1287. endif
  1288. ifdef OPTIMIZE
  1289. override FPCOPT+=-O2
  1290. endif
  1291. ifdef VERBOSE
  1292. override FPCOPT+=-vwni
  1293. endif
  1294. ifdef COMPILER_OPTIONS
  1295. override FPCOPT+=$(COMPILER_OPTIONS)
  1296. endif
  1297. ifdef COMPILER_UNITDIR
  1298. override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
  1299. endif
  1300. ifdef COMPILER_LIBRARYDIR
  1301. override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
  1302. endif
  1303. ifdef COMPILER_OBJECTDIR
  1304. override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
  1305. endif
  1306. ifdef COMPILER_INCLUDEDIR
  1307. override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
  1308. endif
  1309. ifdef CROSSBINDIR
  1310. override FPCOPT+=-FD$(CROSSBINDIR)
  1311. endif
  1312. ifdef COMPILER_TARGETDIR
  1313. override FPCOPT+=-FE$(COMPILER_TARGETDIR)
  1314. ifeq ($(COMPILER_TARGETDIR),.)
  1315. override TARGETDIRPREFIX=
  1316. else
  1317. override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
  1318. endif
  1319. endif
  1320. ifdef COMPILER_UNITTARGETDIR
  1321. override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
  1322. ifeq ($(COMPILER_UNITTARGETDIR),.)
  1323. override UNITTARGETDIRPREFIX=
  1324. else
  1325. override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
  1326. endif
  1327. else
  1328. ifdef COMPILER_TARGETDIR
  1329. override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
  1330. override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
  1331. endif
  1332. endif
  1333. ifdef CREATESHARED
  1334. override FPCOPT+=-Cg
  1335. ifeq ($(CPU_TARGET),i386)
  1336. override FPCOPT+=-Aas
  1337. endif
  1338. endif
  1339. ifdef LINKSHARED
  1340. endif
  1341. ifdef OPT
  1342. override FPCOPT+=$(OPT)
  1343. endif
  1344. ifdef FPCOPTDEF
  1345. override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
  1346. endif
  1347. ifdef CFGFILE
  1348. override FPCOPT+=@$(CFGFILE)
  1349. endif
  1350. ifdef USEENV
  1351. override FPCEXTCMD:=$(FPCOPT)
  1352. override FPCOPT:=!FPCEXTCMD
  1353. export FPCEXTCMD
  1354. endif
  1355. override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
  1356. override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
  1357. ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
  1358. override ACROSSCOMPILE=1
  1359. endif
  1360. ifdef ACROSSCOMPILE
  1361. override FPCOPT+=$(CROSSOPT)
  1362. endif
  1363. override COMPILER:=$(FPC) $(FPCOPT)
  1364. ifeq (,$(findstring -s ,$(COMPILER)))
  1365. EXECPPAS=
  1366. else
  1367. ifeq ($(FULL_SOURCE),$(FULL_TARGET))
  1368. EXECPPAS:=@$(PPAS)
  1369. endif
  1370. endif
  1371. .PHONY: fpc_exes
  1372. ifndef CROSSINSTALL
  1373. ifneq ($(TARGET_PROGRAMS),)
  1374. override EXEFILES=$(addsuffix $(EXEEXT),$(TARGET_PROGRAMS))
  1375. override EXEOFILES:=$(addsuffix $(OEXT),$(TARGET_PROGRAMS)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS)))
  1376. override ALLTARGET+=fpc_exes
  1377. override INSTALLEXEFILES+=$(EXEFILES)
  1378. override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
  1379. ifeq ($(OS_TARGET),os2)
  1380. override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
  1381. endif
  1382. ifeq ($(OS_TARGET),emx)
  1383. override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
  1384. endif
  1385. endif
  1386. endif
  1387. fpc_exes: $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(EXEFILES)
  1388. ifdef TARGET_RSTS
  1389. override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
  1390. override CLEANRSTFILES+=$(RSTFILES)
  1391. endif
  1392. .PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
  1393. $(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
  1394. @$(ECHOREDIR) Compiled > $(FPCMADE)
  1395. fpc_all: $(FPCMADE)
  1396. fpc_smart:
  1397. $(MAKE) all LINKSMART=1 CREATESMART=1
  1398. fpc_debug:
  1399. $(MAKE) all DEBUG=1
  1400. fpc_release:
  1401. $(MAKE) all RELEASE=1
  1402. .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res
  1403. $(COMPILER_UNITTARGETDIR):
  1404. $(MKDIRTREE) $(COMPILER_UNITTARGETDIR)
  1405. $(COMPILER_TARGETDIR):
  1406. $(MKDIRTREE) $(COMPILER_TARGETDIR)
  1407. %$(PPUEXT): %.pp
  1408. $(COMPILER) $<
  1409. $(EXECPPAS)
  1410. %$(PPUEXT): %.pas
  1411. $(COMPILER) $<
  1412. $(EXECPPAS)
  1413. %$(EXEEXT): %.pp
  1414. $(COMPILER) $<
  1415. $(EXECPPAS)
  1416. %$(EXEEXT): %.pas
  1417. $(COMPILER) $<
  1418. $(EXECPPAS)
  1419. %$(EXEEXT): %.lpr
  1420. $(COMPILER) $<
  1421. $(EXECPPAS)
  1422. %$(EXEEXT): %.dpr
  1423. $(COMPILER) $<
  1424. $(EXECPPAS)
  1425. %.res: %.rc
  1426. windres -i $< -o $@
  1427. vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  1428. vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  1429. vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  1430. vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
  1431. vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
  1432. vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
  1433. .PHONY: fpc_shared
  1434. override INSTALLTARGET+=fpc_shared_install
  1435. ifndef SHARED_LIBVERSION
  1436. SHARED_LIBVERSION=$(FPC_VERSION)
  1437. endif
  1438. ifndef SHARED_LIBNAME
  1439. SHARED_LIBNAME=$(PACKAGE_NAME)
  1440. endif
  1441. ifndef SHARED_FULLNAME
  1442. SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
  1443. endif
  1444. ifndef SHARED_LIBUNITS
  1445. SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS)
  1446. override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS))
  1447. endif
  1448. fpc_shared:
  1449. ifdef HASSHAREDLIB
  1450. $(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
  1451. ifneq ($(SHARED_BUILD),n)
  1452. $(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
  1453. endif
  1454. else
  1455. @$(ECHO) Shared Libraries not supported
  1456. endif
  1457. fpc_shared_install:
  1458. ifneq ($(SHARED_BUILD),n)
  1459. ifneq ($(SHARED_LIBUNITS),)
  1460. ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),)
  1461. $(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
  1462. endif
  1463. endif
  1464. endif
  1465. .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
  1466. ifdef INSTALL_UNITS
  1467. override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
  1468. endif
  1469. ifdef INSTALL_BUILDUNIT
  1470. override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
  1471. endif
  1472. ifdef INSTALLPPUFILES
  1473. override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
  1474. ifneq ($(UNITTARGETDIRPREFIX),)
  1475. override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
  1476. override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
  1477. endif
  1478. override INSTALL_CREATEPACKAGEFPC=1
  1479. endif
  1480. ifdef INSTALLEXEFILES
  1481. ifneq ($(TARGETDIRPREFIX),)
  1482. override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES)))
  1483. endif
  1484. endif
  1485. fpc_install: all $(INSTALLTARGET)
  1486. ifdef INSTALLEXEFILES
  1487. $(MKDIR) $(INSTALL_BINDIR)
  1488. ifdef UPXPROG
  1489. -$(UPXPROG) $(INSTALLEXEFILES)
  1490. endif
  1491. $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
  1492. endif
  1493. ifdef INSTALL_CREATEPACKAGEFPC
  1494. ifdef FPCMAKE
  1495. ifdef PACKAGE_VERSION
  1496. ifneq ($(wildcard Makefile.fpc),)
  1497. $(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc
  1498. $(MKDIR) $(INSTALL_UNITDIR)
  1499. $(INSTALL) Package.fpc $(INSTALL_UNITDIR)
  1500. endif
  1501. endif
  1502. endif
  1503. endif
  1504. ifdef INSTALLPPUFILES
  1505. $(MKDIR) $(INSTALL_UNITDIR)
  1506. $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
  1507. ifneq ($(INSTALLPPULINKFILES),)
  1508. $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
  1509. endif
  1510. ifneq ($(wildcard $(LIB_FULLNAME)),)
  1511. $(MKDIR) $(INSTALL_LIBDIR)
  1512. $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
  1513. ifdef inUnix
  1514. ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
  1515. endif
  1516. endif
  1517. endif
  1518. ifdef INSTALL_FILES
  1519. $(MKDIR) $(INSTALL_DATADIR)
  1520. $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
  1521. endif
  1522. fpc_sourceinstall: distclean
  1523. $(MKDIR) $(INSTALL_SOURCEDIR)
  1524. $(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
  1525. fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
  1526. ifdef HASEXAMPLES
  1527. $(MKDIR) $(INSTALL_EXAMPLEDIR)
  1528. endif
  1529. ifdef EXAMPLESOURCEFILES
  1530. $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
  1531. endif
  1532. ifdef TARGET_EXAMPLEDIRS
  1533. $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
  1534. endif
  1535. .PHONY: fpc_clean fpc_cleanall fpc_distclean
  1536. ifdef EXEFILES
  1537. override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
  1538. endif
  1539. ifdef CLEAN_UNITS
  1540. override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
  1541. endif
  1542. ifdef CLEANPPUFILES
  1543. override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
  1544. ifdef DEBUGSYMEXT
  1545. override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
  1546. endif
  1547. override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
  1548. override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
  1549. endif
  1550. fpc_clean: $(CLEANTARGET)
  1551. ifdef CLEANEXEFILES
  1552. -$(DEL) $(CLEANEXEFILES)
  1553. endif
  1554. ifdef CLEANPPUFILES
  1555. -$(DEL) $(CLEANPPUFILES)
  1556. endif
  1557. ifneq ($(CLEANPPULINKFILES),)
  1558. -$(DEL) $(CLEANPPULINKFILES)
  1559. endif
  1560. ifdef CLEANRSTFILES
  1561. -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
  1562. endif
  1563. ifdef CLEAN_FILES
  1564. -$(DEL) $(CLEAN_FILES)
  1565. endif
  1566. ifdef LIB_NAME
  1567. -$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
  1568. endif
  1569. -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  1570. -$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT)
  1571. fpc_cleanall: $(CLEANTARGET)
  1572. ifdef CLEANEXEFILES
  1573. -$(DEL) $(CLEANEXEFILES)
  1574. endif
  1575. ifdef COMPILER_UNITTARGETDIR
  1576. ifdef CLEANPPUFILES
  1577. -$(DEL) $(CLEANPPUFILES)
  1578. endif
  1579. ifneq ($(CLEANPPULINKFILES),)
  1580. -$(DEL) $(CLEANPPULINKFILES)
  1581. endif
  1582. ifdef CLEANRSTFILES
  1583. -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
  1584. endif
  1585. endif
  1586. -$(DELTREE) units
  1587. -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
  1588. ifneq ($(PPUEXT),.ppu)
  1589. -$(DEL) *.o *.ppu *.a
  1590. endif
  1591. -$(DELTREE) *$(SMARTEXT)
  1592. -$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
  1593. -$(DEL) *_ppas$(BATCHEXT)
  1594. ifdef AOUTEXT
  1595. -$(DEL) *$(AOUTEXT)
  1596. endif
  1597. ifdef DEBUGSYMEXT
  1598. -$(DEL) *$(DEBUGSYMEXT)
  1599. endif
  1600. fpc_distclean: cleanall
  1601. .PHONY: fpc_baseinfo
  1602. override INFORULES+=fpc_baseinfo
  1603. fpc_baseinfo:
  1604. @$(ECHO)
  1605. @$(ECHO) == Package info ==
  1606. @$(ECHO) Package Name..... $(PACKAGE_NAME)
  1607. @$(ECHO) Package Version.. $(PACKAGE_VERSION)
  1608. @$(ECHO)
  1609. @$(ECHO) == Configuration info ==
  1610. @$(ECHO)
  1611. @$(ECHO) FPC.......... $(FPC)
  1612. @$(ECHO) FPC Version.. $(FPC_VERSION)
  1613. @$(ECHO) Source CPU... $(CPU_SOURCE)
  1614. @$(ECHO) Target CPU... $(CPU_TARGET)
  1615. @$(ECHO) Source OS.... $(OS_SOURCE)
  1616. @$(ECHO) Target OS.... $(OS_TARGET)
  1617. @$(ECHO) Full Source.. $(FULL_SOURCE)
  1618. @$(ECHO) Full Target.. $(FULL_TARGET)
  1619. @$(ECHO) SourceSuffix. $(SOURCESUFFIX)
  1620. @$(ECHO) TargetSuffix. $(TARGETSUFFIX)
  1621. @$(ECHO)
  1622. @$(ECHO) == Directory info ==
  1623. @$(ECHO)
  1624. @$(ECHO) Required pkgs... $(REQUIRE_PACKAGES)
  1625. @$(ECHO)
  1626. @$(ECHO) Basedir......... $(BASEDIR)
  1627. @$(ECHO) FPCDir.......... $(FPCDIR)
  1628. @$(ECHO) CrossBinDir..... $(CROSSBINDIR)
  1629. @$(ECHO) UnitsDir........ $(UNITSDIR)
  1630. @$(ECHO) PackagesDir..... $(PACKAGESDIR)
  1631. @$(ECHO)
  1632. @$(ECHO) GCC library..... $(GCCLIBDIR)
  1633. @$(ECHO) Other library... $(OTHERLIBDIR)
  1634. @$(ECHO)
  1635. @$(ECHO) == Tools info ==
  1636. @$(ECHO)
  1637. @$(ECHO) As........ $(AS)
  1638. @$(ECHO) Ld........ $(LD)
  1639. @$(ECHO) Ar........ $(AR)
  1640. @$(ECHO) Rc........ $(RC)
  1641. @$(ECHO)
  1642. @$(ECHO) Mv........ $(MVPROG)
  1643. @$(ECHO) Cp........ $(CPPROG)
  1644. @$(ECHO) Rm........ $(RMPROG)
  1645. @$(ECHO) GInstall.. $(GINSTALL)
  1646. @$(ECHO) Echo...... $(ECHO)
  1647. @$(ECHO) Shell..... $(SHELL)
  1648. @$(ECHO) Date...... $(DATE)
  1649. @$(ECHO) FPCMake... $(FPCMAKE)
  1650. @$(ECHO) PPUMove... $(PPUMOVE)
  1651. @$(ECHO) Upx....... $(UPXPROG)
  1652. @$(ECHO) Zip....... $(ZIPPROG)
  1653. @$(ECHO)
  1654. @$(ECHO) == Object info ==
  1655. @$(ECHO)
  1656. @$(ECHO) Target Loaders........ $(TARGET_LOADERS)
  1657. @$(ECHO) Target Units.......... $(TARGET_UNITS)
  1658. @$(ECHO) Target Implicit Units. $(TARGET_IMPLICITUNITS)
  1659. @$(ECHO) Target Programs....... $(TARGET_PROGRAMS)
  1660. @$(ECHO) Target Dirs........... $(TARGET_DIRS)
  1661. @$(ECHO) Target Examples....... $(TARGET_EXAMPLES)
  1662. @$(ECHO) Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
  1663. @$(ECHO)
  1664. @$(ECHO) Clean Units......... $(CLEAN_UNITS)
  1665. @$(ECHO) Clean Files......... $(CLEAN_FILES)
  1666. @$(ECHO)
  1667. @$(ECHO) Install Units....... $(INSTALL_UNITS)
  1668. @$(ECHO) Install Files....... $(INSTALL_FILES)
  1669. @$(ECHO)
  1670. @$(ECHO) == Install info ==
  1671. @$(ECHO)
  1672. @$(ECHO) DateStr.............. $(DATESTR)
  1673. @$(ECHO) ZipName.............. $(ZIPNAME)
  1674. @$(ECHO) ZipPrefix............ $(ZIPPREFIX)
  1675. @$(ECHO) ZipCrossPrefix....... $(ZIPCROSSPREFIX)
  1676. @$(ECHO) ZipSuffix............ $(ZIPSUFFIX)
  1677. @$(ECHO) FullZipName.......... $(FULLZIPNAME)
  1678. @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE)
  1679. @$(ECHO)
  1680. @$(ECHO) Install base dir..... $(INSTALL_BASEDIR)
  1681. @$(ECHO) Install binary dir... $(INSTALL_BINDIR)
  1682. @$(ECHO) Install library dir.. $(INSTALL_LIBDIR)
  1683. @$(ECHO) Install units dir.... $(INSTALL_UNITDIR)
  1684. @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR)
  1685. @$(ECHO) Install doc dir...... $(INSTALL_DOCDIR)
  1686. @$(ECHO) Install example dir.. $(INSTALL_EXAMPLEDIR)
  1687. @$(ECHO) Install data dir..... $(INSTALL_DATADIR)
  1688. @$(ECHO)
  1689. @$(ECHO) Dist destination dir. $(DIST_DESTDIR)
  1690. @$(ECHO) Dist zip name........ $(DIST_ZIPNAME)
  1691. @$(ECHO)
  1692. .PHONY: fpc_info
  1693. fpc_info: $(INFORULES)
  1694. .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
  1695. fpc_makefile_dirs
  1696. fpc_makefile:
  1697. $(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
  1698. fpc_makefile_sub1:
  1699. ifdef TARGET_DIRS
  1700. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
  1701. endif
  1702. ifdef TARGET_EXAMPLEDIRS
  1703. $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
  1704. endif
  1705. fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
  1706. fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
  1707. fpc_makefiles: fpc_makefile fpc_makefile_dirs
  1708. all: fpc_all
  1709. debug: fpc_debug
  1710. smart: fpc_smart
  1711. release: fpc_release
  1712. units: fpc_units
  1713. examples:
  1714. shared: fpc_shared
  1715. install: fpc_install
  1716. sourceinstall: fpc_sourceinstall
  1717. exampleinstall: fpc_exampleinstall
  1718. distinstall:
  1719. zipinstall:
  1720. zipsourceinstall:
  1721. zipexampleinstall:
  1722. zipdistinstall:
  1723. clean: fpc_clean
  1724. distclean: fpc_distclean
  1725. cleanall: fpc_cleanall
  1726. info: fpc_info
  1727. makefiles: fpc_makefiles
  1728. .PHONY: all debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
  1729. ifneq ($(wildcard fpcmake.loc),)
  1730. include fpcmake.loc
  1731. endif