Makefile 48 KB

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