Makefile 50 KB

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