Makefile 42 KB

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