Makefile 44 KB

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