Makefile 54 KB

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