Makefile 48 KB

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