fpcmake.inc 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989
  1. {$ifdef Delphi}
  2. const fpcmakeini : array[0..181] of string[240]=(
  3. {$else Delphi}
  4. const fpcmakeini : array[0..181,1..240] of char=(
  5. {$endif Delphi}
  6. ';'#010+
  7. '; Templates used by fpcmake to create a Makefile from Makefile.fpc'#010+
  8. ';'#010+
  9. #010+
  10. '[osdetect]'#010+
  11. '#####################################################################'#010+
  12. '# Autodetect OS (Linux or Dos or Windows NT or OS/2)'#010+
  13. '# define inUnix when running under',' Unix like environment'#010+
  14. '# (Linux,FreeBSD,NetBSD,Cygwin)'#010+
  15. '# define inWinNT when running under WinNT'#010+
  16. '# define inOS2 when running under OS/2'#010+
  17. '# define inCygwin when running under Cygwin32'#010+
  18. '############################################','########################'+
  19. '#'#010+
  20. #010+
  21. '# We need only / in the path also remove the current dir'#010+
  22. 'override PATH:=$(subst \,/,$(PATH))'#010+
  23. #010+
  24. '# Determine if we'#039've a unix searchpath using : by looking for a ;'#010+
  25. '# that normally doesn'#039't exists in path names.'#010+
  26. 'ifeq ($','(findstring ;,$(PATH)),)'#010+
  27. 'inUnix=1'#010+
  28. 'SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))'#010+
  29. 'else'#010+
  30. 'SEARCHPATH:=$(subst ;, ,$(PATH))'#010+
  31. 'endif'#010+
  32. #010+
  33. '# Search for PWD and determine also if we are under linux'#010+
  34. 'PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHP','ATH))))'#010+
  35. 'ifeq ($(PWD),)'#010+
  36. 'PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))'#010+
  37. 'ifeq ($(PWD),)'#010+
  38. '$(error You need the GNU utils package to use this Makefile)'#010+
  39. 'else'#010+
  40. 'PWD:=$(firstword $(PWD))'#010+
  41. 'SRCEXEEXT='#010+
  42. 'endif'#010+
  43. 'else'#010+
  44. 'PWD:=$(firstword $(PWD))'#010+
  45. 'SRCEXE','EXT=.exe'#010+
  46. 'endif'#010+
  47. #010+
  48. '# Detect NT - NT sets OS to Windows_NT'#010+
  49. '# Detect OS/2 - OS/2 has OS2_SHELL defined'#010+
  50. 'ifndef inUnix'#010+
  51. 'ifeq ($(OS),Windows_NT)'#010+
  52. 'inWinNT=1'#010+
  53. 'else'#010+
  54. 'ifdef OS2_SHELL'#010+
  55. 'inOS2=1'#010+
  56. 'endif'#010+
  57. 'endif'#010+
  58. 'else'#010+
  59. 'ifneq ($(findstring cygwin,$(MACHTYPE)),)'#010+
  60. 'inCygW','in=1'#010+
  61. 'endif'#010+
  62. 'endif'#010+
  63. #010+
  64. '# Detect BSD, since BSD uses a slightly different directory hierarchy.'+
  65. #010+
  66. '# Note that maybe Linux Slackware users would also like this, since'#010+
  67. '# Slackwares hierachy is closer to BSD than other unices IIRC.'#010+
  68. #010+
  69. 'ifeq ($(OS_TARGET),','freebsd)'#010+
  70. 'BSDhier=1'#010+
  71. 'endif'#010+
  72. 'ifeq ($(OS_TARGET),netbsd)'#010+
  73. 'BSDhier=1'#010+
  74. 'endif'#010+
  75. 'ifeq ($(OS_TARGET),openbsd)'#010+
  76. 'BSDhier=1'#010+
  77. 'endif'#010+
  78. #010+
  79. '# The extension of batch files / scripts'#010+
  80. 'ifdef inUnix'#010+
  81. 'BATCHEXT=.sh'#010+
  82. 'else'#010+
  83. 'ifdef inOS2'#010+
  84. 'BATCHEXT=.cmd'#010+
  85. 'else'#010+
  86. 'BATCHEXT=.bat'#010+
  87. 'endif'#010+
  88. 'endi','f'#010+
  89. #010+
  90. '# Path Separator, the subst trick is necessary for the \ that can'#039't'+
  91. ' exists'#010+
  92. '# at the end of a line'#010+
  93. 'ifdef inUnix'#010+
  94. 'PATHSEP=/'#010+
  95. 'else'#010+
  96. 'PATHSEP:=$(subst /,\,/)'#010+
  97. '# cygwin bash or sh can not handle backslashs'#010+
  98. 'ifdef inCygWin'#010+
  99. 'PATHSEP=/'#010+
  100. 'endif'#010+
  101. 'endif'#010+
  102. #010+
  103. '# B','ase dir'#010+
  104. 'ifdef PWD'#010+
  105. 'BASEDIR:=$(subst \,/,$(shell $(PWD)))'#010+
  106. '# For Cygwin we need to replace /cygdrive/c/ with c:/'#010+
  107. 'ifdef inCygWin'#010+
  108. 'ifneq ($(findstring /cygdrive/,$(BASEDIR)),)'#010+
  109. 'BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))'#010+
  110. 'BASEDRIVE:=$(firstword ','$(subst /, ,$(BASENODIR)))'#010+
  111. 'BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))'#010+
  112. 'endif'#010+
  113. 'endif'#010+
  114. 'else'#010+
  115. 'BASEDIR=.'#010+
  116. 'endif'#010+
  117. #010+
  118. '# Echo is an internal command under OS/2 (and others), so it'#039's alw'+
  119. 'ays found'#010+
  120. 'ifdef inOS2'#010+
  121. 'ifndef ECHO'#010+
  122. 'ECHO:=$(str','ip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH'+
  123. '))))'#010+
  124. 'ifeq ($(ECHO),)'#010+
  125. 'ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH)))'+
  126. ')'#010+
  127. 'ifeq ($(ECHO),)'#010+
  128. 'ECHO=echo'#010+
  129. 'else'#010+
  130. 'ECHO:=$(firstword $(ECHO))'#010+
  131. 'endif'#010+
  132. 'else'#010+
  133. 'ECHO:=$(firstword $(E','CHO))'#010+
  134. 'endif'#010+
  135. 'endif'#010+
  136. 'export ECHO'#010+
  137. 'endif'#010+
  138. #010+
  139. '[fpcdetect]'#010+
  140. '#####################################################################'#010+
  141. '# FPC Binary and Version Detection'#010+
  142. '#####################################################################'#010+
  143. #010+
  144. '# Compatibility',' with old makefiles'#010+
  145. 'ifndef FPC'#010+
  146. 'ifdef PP'#010+
  147. 'FPC=$(PP)'#010+
  148. 'endif'#010+
  149. 'endif'#010+
  150. #010+
  151. '# Try to detect the ppcXXX file to use by using "fpc -PB" option'#010+
  152. '# to query for the default ppcXXX the fpc executable tries. When'#010+
  153. '# fpc is not found use ppc386 by default. Also ','when fpc -PB gives'#010+
  154. '# an error ppc386 will be used.'#010+
  155. 'ifndef FPC'#010+
  156. '# check if fpc exists'#010+
  157. 'FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH)'+
  158. ')))'#010+
  159. 'ifneq ($(FPCPROG),)'#010+
  160. 'FPCPROG:=$(firstword $(FPCPROG))'#010+
  161. 'FPC:=$(shell $(FPCPROG) -PB)'#010,
  162. '# Older fpc executables didn'#039't support it and return'#010+
  163. '# Error: Illegal processor... When found then fallback to ppc386'#010+
  164. 'ifneq ($(findstring Error,$(FPC)),)'#010+
  165. 'override FPC=ppc386'#010+
  166. 'endif'#010+
  167. 'else'#010+
  168. '# fpc binary not found, fallback to ppc386'#010+
  169. 'override FPC','=ppc386'#010+
  170. 'endif'#010+
  171. 'endif'#010+
  172. #010+
  173. '# Get a clean executable name'#010+
  174. 'override FPC:=$(subst $(SRCEXEEXT),,$(FPC))'#010+
  175. 'override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)'#010+
  176. #010+
  177. '# FPC version'#010+
  178. 'ifndef FPC_VERSION'#010+
  179. '# For 1.1 and up we can use a single compiler call to retrieve'#010+
  180. '# ','all needed information'#010+
  181. 'FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)'#010+
  182. 'FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))'#010+
  183. 'endif'#010+
  184. #010+
  185. 'export FPC FPC_VERSION FPC_COMPILERINFO'#010+
  186. '# CHECKDEPEND should not be exported'#010+
  187. '# This should limit multiple checks'#010+
  188. 'unexport',' CHECKDEPEND ALLDEPENDENCIES'#010+
  189. #010+
  190. '#####################################################################'#010+
  191. '# FPC Target Detection'#010+
  192. '#####################################################################'#010+
  193. #010+
  194. '# Fall back to default values if needed'#010+
  195. 'ifndef',' CPU_TARGET'#010+
  196. 'ifdef CPU_TARGET_DEFAULT'#010+
  197. 'CPU_TARGET=$(CPU_TARGET_DEFAULT)'#010+
  198. 'endif'#010+
  199. 'endif'#010+
  200. 'ifndef OS_TARGET'#010+
  201. 'ifdef OS_TARGET_DEFAULT'#010+
  202. 'OS_TARGET=$(OS_TARGET_DEFAULT)'#010+
  203. 'endif'#010+
  204. 'endif'#010+
  205. #010+
  206. '# For 1.0.x we need to use extra calls to retrieve all info'#010+
  207. 'ifneq ($(word','s $(FPC_COMPILERINFO)),5)'#010+
  208. 'FPC_COMPILERINFO+=$(shell $(FPC) -iSP)'#010+
  209. 'FPC_COMPILERINFO+=$(shell $(FPC) -iTP)'#010+
  210. 'FPC_COMPILERINFO+=$(shell $(FPC) -iSO)'#010+
  211. 'FPC_COMPILERINFO+=$(shell $(FPC) -iTO)'#010+
  212. 'endif'#010+
  213. #010+
  214. '# Retrieve Target/Source CPU and Target/Source OS'#010+
  215. 'i','fndef CPU_SOURCE'#010+
  216. 'CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))'#010+
  217. 'endif'#010+
  218. 'ifndef CPU_TARGET'#010+
  219. 'CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))'#010+
  220. 'endif'#010+
  221. 'ifndef OS_SOURCE'#010+
  222. 'OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))'#010+
  223. 'endif'#010+
  224. 'ifndef OS_TARGET'#010+
  225. 'OS_TARGET:=$(word 5,$(FPC_CO','MPILERINFO))'#010+
  226. 'endif'#010+
  227. #010+
  228. '# Full name of the target, including CPU and OS'#010+
  229. 'FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)'#010+
  230. 'FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)'#010+
  231. #010+
  232. '# Cross compile flag'#010+
  233. 'ifneq ($(FULL_TARGET),$(FULL_SOURCE))'#010+
  234. 'CROSSCOMPILE=1'#010+
  235. 'endif'#010+
  236. #010+
  237. '# Check if t','he Makefile supports this target, but not'#010+
  238. '# when the make target is to rebuild the makefile'#010+
  239. 'ifeq ($(findstring makefile,$(MAKECMDGOALS)),)'#010+
  240. 'ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)'#010+
  241. '$(error The Makefile doesn'#039't support target $(O','S_TARGET), please'+
  242. ' run fpcmake first)'#010+
  243. 'endif'#010+
  244. 'endif'#010+
  245. #010+
  246. 'export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOUR'+
  247. 'CE CROSSCOMPILE'#010+
  248. #010+
  249. #010+
  250. '[fpcdircheckenv]'#010+
  251. '#####################################################################'#010+
  252. '# FPCDIR Settin','g'#010+
  253. '#####################################################################'#010+
  254. #010+
  255. '# Test FPCDIR to look if the RTL dir exists'#010+
  256. 'ifdef FPCDIR'#010+
  257. 'override FPCDIR:=$(subst \,/,$(FPCDIR))'#010+
  258. 'ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)'#010+
  259. 'override FPCDIR=','wrong'#010+
  260. 'endif'#010+
  261. 'else'#010+
  262. 'override FPCDIR=wrong'#010+
  263. 'endif'#010+
  264. #010+
  265. '# Default FPCDIR from Makefile.fpc'#010+
  266. 'ifdef DEFAULT_FPCDIR'#010+
  267. 'ifeq ($(FPCDIR),wrong)'#010+
  268. 'override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))'#010+
  269. 'ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)'#010+
  270. 'override FPCD','IR=wrong'#010+
  271. 'endif'#010+
  272. 'endif'#010+
  273. 'endif'#010+
  274. #010+
  275. '[fpcdirdetect]'#010+
  276. '# Detect FPCDIR'#010+
  277. 'ifeq ($(FPCDIR),wrong)'#010+
  278. 'ifdef inUnix'#010+
  279. 'override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)'#010+
  280. 'ifeq ($(wildcard $(FPCDIR)/units),)'#010+
  281. 'override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)'#010+
  282. 'endif'#010+
  283. 'else'#010+
  284. 'over','ride FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(a'+
  285. 'ddsuffix /$(FPC),$(SEARCHPATH))))))'#010+
  286. 'override FPCDIR:=$(FPCDIR)/..'#010+
  287. 'ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)'#010+
  288. 'override FPCDIR:=$(FPCDIR)/..'#010+
  289. 'ifeq ($(wildcard $(addpref','ix $(FPCDIR)/,rtl units)),)'#010+
  290. 'override FPCDIR=c:/pp'#010+
  291. 'endif'#010+
  292. 'endif'#010+
  293. 'endif'#010+
  294. 'endif'#010+
  295. #010+
  296. '# Cross compiler dir'#010+
  297. 'ifndef CROSSDIR'#010+
  298. 'CROSSDIR:=$(FPCDIR)/cross/$(FULL_TARGET)'#010+
  299. 'endif'#010+
  300. #010+
  301. '# Cross target dir'#010+
  302. 'ifndef CROSSTARGETDIR'#010+
  303. 'CROSSTARGETDIR=$(CROSSDIR)/$(FULL_TARGE','T)'#010+
  304. 'endif'#010+
  305. #010+
  306. '# Units dir, when cross compiling try first the'#010+
  307. 'ifdef CROSSCOMPILE'#010+
  308. 'UNITSDIR:=$(wildcard $(CROSSTARGETDIR)/units)'#010+
  309. 'ifeq ($(UNITSDIR),)'#010+
  310. 'UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))'#010+
  311. 'endif'#010+
  312. 'else'#010+
  313. 'UNITSDIR:=$(wildcard $(FPCDIR)/unit','s/$(OS_TARGET))'#010+
  314. 'endif'#010+
  315. #010+
  316. '# Packages dir'#010+
  317. 'PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/pa'+
  318. 'ckages/extra)'#010+
  319. #010+
  320. #010+
  321. '[shelltools]'#010+
  322. '#####################################################################'#010+
  323. '# Shell tools'#010+
  324. '###################','#################################################'+
  325. '#'#010+
  326. #010+
  327. '# Echo that can redir (must be able run in the default OS shell)'#010+
  328. 'ifndef ECHOREDIR'#010+
  329. 'ECHOREDIR:=$(subst /,$(PATHSEP),$(ECHO))'#010+
  330. 'endif'#010+
  331. #010+
  332. '# To copy pograms'#010+
  333. 'ifndef COPY'#010+
  334. 'COPY:=$(CPPROG) -fp'#010+
  335. 'endif'#010+
  336. #010+
  337. '#',' Copy a whole tree'#010+
  338. 'ifndef COPYTREE'#010+
  339. 'COPYTREE:=$(CPPROG) -rfp'#010+
  340. 'endif'#010+
  341. #010+
  342. '# To move pograms'#010+
  343. 'ifndef MOVE'#010+
  344. 'MOVE:=$(MVPROG) -f'#010+
  345. 'endif'#010+
  346. #010+
  347. '# Check delete program'#010+
  348. 'ifndef DEL'#010+
  349. 'DEL:=$(RMPROG) -f'#010+
  350. 'endif'#010+
  351. #010+
  352. '# Check deltree program'#010+
  353. 'ifndef DELTREE'#010+
  354. 'DELTREE:=$(RMPROG) ','-rf'#010+
  355. 'endif'#010+
  356. #010+
  357. '# To install files'#010+
  358. 'ifndef INSTALL'#010+
  359. 'ifdef inUnix'#010+
  360. 'INSTALL:=$(GINSTALL) -c -m 644'#010+
  361. 'else'#010+
  362. 'INSTALL:=$(COPY)'#010+
  363. 'endif'#010+
  364. 'endif'#010+
  365. #010+
  366. '# To install programs'#010+
  367. 'ifndef INSTALLEXE'#010+
  368. 'ifdef inUnix'#010+
  369. 'INSTALLEXE:=$(GINSTALL) -c -m 755'#010+
  370. 'else'#010+
  371. 'INSTALLEXE:=$(COPY)'#010+
  372. 'endi','f'#010+
  373. 'endif'#010+
  374. #010+
  375. '# To make a directory.'#010+
  376. 'ifndef MKDIR'#010+
  377. 'MKDIR:=$(GINSTALL) -m 755 -d'#010+
  378. 'endif'#010+
  379. #010+
  380. 'export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKD'+
  381. 'IR'#010+
  382. #010+
  383. #010+
  384. '[defaultdirs]'#010+
  385. '#####################################################################'#010,
  386. '# Default Directories'#010+
  387. '#####################################################################'#010+
  388. #010+
  389. '# Units dir'#010+
  390. 'ifdef REQUIRE_UNITSDIR'#010+
  391. 'override UNITSDIR+=$(REQUIRE_UNITSDIR)'#010+
  392. 'endif'#010+
  393. #010+
  394. '# Units dir'#010+
  395. 'ifdef REQUIRE_PACKAGESDIR'#010+
  396. 'override PACKAGESDIR+=$(REQU','IRE_PACKAGESDIR)'#010+
  397. 'endif'#010+
  398. #010+
  399. #010+
  400. '# Linux, netbsd and freebsd use unix dirs with /usr/bin, /usr/lib'#010+
  401. '# When zipping use the target as default, when normal install then'#010+
  402. '# use the source os as default'#010+
  403. 'ifdef ZIPINSTALL'#010+
  404. '# Zipinstall'#010+
  405. 'ifeq ($(OS_TARGET),li','nux)'#010+
  406. 'UNIXINSTALLDIR=1'#010+
  407. 'endif'#010+
  408. 'ifeq ($(OS_TARGET),freebsd)'#010+
  409. 'UNIXINSTALLDIR=1'#010+
  410. 'endif'#010+
  411. 'ifeq ($(OS_TARGET),netbsd)'#010+
  412. 'UNIXINSTALLDIR=1'#010+
  413. 'endif'#010+
  414. 'ifeq ($(OS_TARGET),openbsd)'#010+
  415. 'UNIXINSTALLDIR=1'#010+
  416. 'endif'#010+
  417. #010+
  418. 'ifeq ($(OS_TARGET),sunos)'#010+
  419. 'UNIXINSTALLDIR=1'#010+
  420. 'endif'#010+
  421. 'ifeq ($(OS','_TARGET),qnx)'#010+
  422. 'UNIXINSTALLDIR=1'#010+
  423. 'endif'#010+
  424. 'else'#010+
  425. '# Normal install'#010+
  426. 'ifeq ($(OS_SOURCE),linux)'#010+
  427. 'UNIXINSTALLDIR=1'#010+
  428. 'endif'#010+
  429. 'ifeq ($(OS_SOURCE),freebsd)'#010+
  430. 'UNIXINSTALLDIR=1'#010+
  431. 'endif'#010+
  432. 'ifeq ($(OS_SOURCE),netbsd)'#010+
  433. 'UNIXINSTALLDIR=1'#010+
  434. 'endif'#010+
  435. 'ifeq ($(OS_SOURCE),openbsd)'#010+
  436. 'UNI','XINSTALLDIR=1'#010+
  437. 'endif'#010+
  438. 'ifeq ($(OS_TARGET),sunos)'#010+
  439. 'UNIXINSTALLDIR=1'#010+
  440. 'endif'#010+
  441. 'ifeq ($(OS_TARGET),qnx)'#010+
  442. 'UNIXINSTALLDIR=1'#010+
  443. 'endif'#010+
  444. 'endif'#010+
  445. #010+
  446. '# When install prefix is not set try to use prefix'#010+
  447. 'ifndef INSTALL_PREFIX'#010+
  448. 'ifdef PREFIX'#010+
  449. 'INSTALL_PREFIX=$(PREFIX)'#010+
  450. 'endif'#010,
  451. 'endif'#010+
  452. #010+
  453. '# set the prefix directory where to install everything'#010+
  454. 'ifndef INSTALL_PREFIX'#010+
  455. 'ifdef UNIXINSTALLDIR'#010+
  456. 'INSTALL_PREFIX=/usr/local'#010+
  457. 'else'#010+
  458. 'ifdef INSTALL_FPCPACKAGE'#010+
  459. 'INSTALL_BASEDIR:=/pp'#010+
  460. 'else'#010+
  461. 'INSTALL_BASEDIR:=/$(PACKAGE_NAME)'#010+
  462. 'endif'#010+
  463. 'endif'#010+
  464. 'endif'#010+
  465. 'e','xport INSTALL_PREFIX'#010+
  466. #010+
  467. '# Export also INSTALL_SOURCESUBDIR set so it will be'#010+
  468. '# used recursively for all subdirs'#010+
  469. 'ifdef INSTALL_FPCSUBDIR'#010+
  470. 'export INSTALL_FPCSUBDIR'#010+
  471. 'endif'#010+
  472. #010+
  473. '# Where to place the resulting zip files'#010+
  474. 'ifndef DIST_DESTDIR'#010+
  475. 'DIST_DESTDIR:','=$(BASEDIR)'#010+
  476. 'endif'#010+
  477. 'export DIST_DESTDIR'#010+
  478. #010+
  479. #010+
  480. '#####################################################################'#010+
  481. '# Install Directories'#010+
  482. '#####################################################################'#010+
  483. #010+
  484. '# set the base directory where to ins','tall everything'#010+
  485. 'ifndef INSTALL_BASEDIR'#010+
  486. 'ifdef UNIXINSTALLDIR'#010+
  487. 'ifdef INSTALL_FPCPACKAGE'#010+
  488. 'INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)'#010+
  489. 'else'#010+
  490. 'INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)'#010+
  491. 'endif'#010+
  492. 'else'#010+
  493. 'INSTALL_BASEDIR:=$(INSTALL','_PREFIX)'#010+
  494. 'endif'#010+
  495. 'endif'#010+
  496. #010+
  497. '# set the directory where to install the binaries'#010+
  498. 'ifndef INSTALL_BINDIR'#010+
  499. 'ifdef UNIXINSTALLDIR'#010+
  500. 'INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin'#010+
  501. 'else'#010+
  502. 'INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin'#010+
  503. '# for FPC packages install the binaries und','er their os target subdir'+
  504. #010+
  505. 'ifdef INSTALL_FPCPACKAGE'#010+
  506. 'INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)'#010+
  507. 'endif'#010+
  508. 'endif'#010+
  509. 'endif'#010+
  510. #010+
  511. '# set the directory where to install the units.'#010+
  512. 'ifndef INSTALL_UNITDIR'#010+
  513. '# If cross compiling install in the cross compile di','rectory'#010+
  514. 'ifdef CROSSCOMPILE'#010+
  515. 'INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/units'#010+
  516. 'else'#010+
  517. 'INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(OS_TARGET)'#010+
  518. 'endif'#010+
  519. 'ifdef INSTALL_FPCPACKAGE'#010+
  520. 'ifdef PACKAGE_NAME'#010+
  521. 'INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PA','CKAGE_NAME)'#010+
  522. 'endif'#010+
  523. 'endif'#010+
  524. 'endif'#010+
  525. #010+
  526. '# Where to install shared libraries'#010+
  527. 'ifndef INSTALL_LIBDIR'#010+
  528. 'ifdef UNIXINSTALLDIR'#010+
  529. 'INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib'#010+
  530. 'else'#010+
  531. 'INSTALL_LIBDIR:=$(INSTALL_UNITDIR)'#010+
  532. 'endif'#010+
  533. 'endif'#010+
  534. #010+
  535. '# Where the source files will be stored',#010+
  536. 'ifndef INSTALL_SOURCEDIR'#010+
  537. 'ifdef UNIXINSTALLDIR'#010+
  538. 'ifdef BSDhier'#010+
  539. 'SRCPREFIXDIR=share/src'#010+
  540. 'else'#010+
  541. 'SRCPREFIXDIR=src'#010+
  542. 'endif'#010+
  543. 'ifdef INSTALL_FPCPACKAGE'#010+
  544. 'ifdef INSTALL_FPCSUBDIR'#010+
  545. 'INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION'+
  546. ')/$(INSTA','LL_FPCSUBDIR)/$(PACKAGE_NAME)'#010+
  547. 'else'#010+
  548. 'INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION'+
  549. ')/$(PACKAGE_NAME)'#010+
  550. 'endif'#010+
  551. 'else'#010+
  552. 'INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$'+
  553. '(PACKAGE_VERSION)'#010+
  554. 'endif'#010+
  555. 'else'#010+
  556. 'ifdef I','NSTALL_FPCPACKAGE'#010+
  557. 'ifdef INSTALL_FPCSUBDIR'#010+
  558. 'INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PA'+
  559. 'CKAGE_NAME)'#010+
  560. 'else'#010+
  561. 'INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)'#010+
  562. 'endif'#010+
  563. 'else'#010+
  564. 'INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/s','ource'#010+
  565. 'endif'#010+
  566. 'endif'#010+
  567. 'endif'#010+
  568. #010+
  569. '# Where the doc files will be stored'#010+
  570. 'ifndef INSTALL_DOCDIR'#010+
  571. 'ifdef UNIXINSTALLDIR'#010+
  572. 'ifdef BSDhier'#010+
  573. 'DOCPREFIXDIR=share/doc'#010+
  574. 'else'#010+
  575. 'DOCPREFIXDIR=doc'#010+
  576. 'endif'#010+
  577. 'ifdef INSTALL_FPCPACKAGE'#010+
  578. 'INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIX','DIR)/fpc-$(FPC_VERSION)'+
  579. '/$(PACKAGE_NAME)'#010+
  580. 'else'#010+
  581. 'INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PA'+
  582. 'CKAGE_VERSION)'#010+
  583. 'endif'#010+
  584. 'else'#010+
  585. 'ifdef INSTALL_FPCPACKAGE'#010+
  586. 'INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)'#010+
  587. 'else'#010+
  588. 'INSTALL_DOCDIR',':=$(INSTALL_BASEDIR)/doc'#010+
  589. 'endif'#010+
  590. 'endif'#010+
  591. 'endif'#010+
  592. #010+
  593. '# Where to install the examples, under linux we use the doc dir'#010+
  594. '# because the copytree command will create a subdir itself'#010+
  595. 'ifndef INSTALL_EXAMPLEDIR'#010+
  596. 'ifdef UNIXINSTALLDIR'#010+
  597. 'ifdef INSTALL_FPCPACKAGE'#010+
  598. 'i','fdef BSDhier'#010+
  599. 'INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION'+
  600. ')/$(PACKAGE_NAME)'#010+
  601. 'else'#010+
  602. 'INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/'+
  603. '$(PACKAGE_NAME)'#010+
  604. 'endif'#010+
  605. 'else'#010+
  606. 'ifdef BSDhier'#010+
  607. 'INSTALL_EXAMPLEDIR:=$(I','NSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)'+
  608. '-$(PACKAGE_VERSION)'#010+
  609. 'else'#010+
  610. 'INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VE'+
  611. 'RSION)'#010+
  612. 'endif'#010+
  613. 'endif'#010+
  614. 'else'#010+
  615. 'ifdef INSTALL_FPCPACKAGE'#010+
  616. 'INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(P','ACKAGE_NAME)'#010+
  617. 'else'#010+
  618. 'INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples'#010+
  619. 'endif'#010+
  620. 'endif'#010+
  621. 'endif'#010+
  622. #010+
  623. '# Where the some extra (data)files will be stored'#010+
  624. 'ifndef INSTALL_DATADIR'#010+
  625. 'INSTALL_DATADIR=$(INSTALL_BASEDIR)'#010+
  626. 'endif'#010+
  627. #010+
  628. '########################################','############################'+
  629. '#'#010+
  630. '# Cross compile dirs'#010+
  631. '#####################################################################'#010+
  632. #010+
  633. 'ifdef CROSSCOMPILE'#010+
  634. '# Directory where the cross compile tools are stored.'#010+
  635. '# First check if they are available in FPCDIR','. If no targets/ subdir'+
  636. #010+
  637. '# is found use the targets/ subdir in INSTALL_BASEDIR.'#010+
  638. 'ifndef CROSSBINDIR'#010+
  639. 'CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(FULL_SOURCE))'#010+
  640. 'ifeq ($(CROSSBINDIR),)'#010+
  641. 'CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(FULL_T','ARGET)/bin/'+
  642. '$(FULL_SOURCE))'#010+
  643. 'endif'#010+
  644. 'endif'#010+
  645. 'else'#010+
  646. 'CROSSBINDIR='#010+
  647. 'endif'#010+
  648. #010+
  649. #010+
  650. '[dirlibc]'#010+
  651. '# On linux, try to find where libgcc.a is.'#010+
  652. 'ifdef inUnix'#010+
  653. 'ifndef GCCLIBDIR'#010+
  654. 'GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '#039'{ print'+
  655. ' $$4 } '#039'`)'#010+
  656. 'endif'#010+
  657. 'ifeq ($(O','S_TARGET),linux)'#010+
  658. 'ifndef OTHERLIBDIR'#010+
  659. 'OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '#039'{ ORS=" '+
  660. '"; print $1 }'#039')'#010+
  661. 'endif'#010+
  662. 'endif'#010+
  663. 'ifeq ($(OS_TARGET),netbsd)'#010+
  664. 'OTHERLIBDIR+=/usr/pkg/lib'#010+
  665. 'endif'#010+
  666. 'export GCCLIBDIR OTHERLIB'#010+
  667. 'endif'#010+
  668. #010+
  669. #010+
  670. '[extensions]'#010+
  671. '####','################################################################'+
  672. '#'#010+
  673. '# Default extensions'#010+
  674. '#####################################################################'#010+
  675. #010+
  676. '# Default needed extensions (Go32v2,Linux)'#010+
  677. 'LOADEREXT=.as'#010+
  678. 'EXEEXT=.exe'#010+
  679. 'PPLEXT=.ppl'#010+
  680. 'P','PUEXT=.ppu'#010+
  681. 'OEXT=.o'#010+
  682. 'ASMEXT=.s'#010+
  683. 'SMARTEXT=.sl'#010+
  684. 'STATICLIBEXT=.a'#010+
  685. 'SHAREDLIBEXT=.so'#010+
  686. 'STATICLIBPREFIX=libp'#010+
  687. 'RSTEXT=.rst'#010+
  688. 'FPCMADE=fpcmade'#010+
  689. #010+
  690. #010+
  691. 'ifeq ($(findstring 1.0.,$(FPC_VERSION)),)'#010+
  692. '# Go32v1'#010+
  693. 'ifeq ($(OS_TARGET),go32v1)'#010+
  694. 'PPUEXT=.pp1'#010+
  695. 'OEXT=.o1'#010+
  696. 'ASMEXT=.s1'#010+
  697. 'SMAR','TEXT=.sl1'#010+
  698. 'STATICLIBEXT=.a1'#010+
  699. 'SHAREDLIBEXT=.so1'#010+
  700. 'STATICLIBPREFIX='#010+
  701. 'FPCMADE=fpcmade.v1'#010+
  702. 'PACKAGESUFFIX=v1'#010+
  703. 'endif'#010+
  704. #010+
  705. '# Go32v2'#010+
  706. 'ifeq ($(OS_TARGET),go32v2)'#010+
  707. 'STATICLIBPREFIX='#010+
  708. 'FPCMADE=fpcmade.dos'#010+
  709. 'ZIPSUFFIX=go32'#010+
  710. 'endif'#010+
  711. #010+
  712. '# Linux'#010+
  713. 'ifeq ($(OS_TARGET),linux)'#010+
  714. 'EXEEXT','='#010+
  715. 'HASSHAREDLIB=1'#010+
  716. 'FPCMADE=fpcmade.lnx'#010+
  717. 'ZIPSUFFIX=linux'#010+
  718. 'endif'#010+
  719. #010+
  720. '# FreeBSD'#010+
  721. 'ifeq ($(OS_TARGET),freebsd)'#010+
  722. 'EXEEXT='#010+
  723. 'HASSHAREDLIB=1'#010+
  724. 'FPCMADE=fpcmade.freebsd'#010+
  725. 'ZIPSUFFIX=freebsd'#010+
  726. 'endif'#010+
  727. #010+
  728. '# NetBSD'#010+
  729. 'ifeq ($(OS_TARGET),netbsd)'#010+
  730. 'EXEEXT='#010+
  731. 'HASSHAREDLIB=1'#010+
  732. 'FPCMADE=fpc','made.netbsd'#010+
  733. 'ZIPSUFFIX=netbsd'#010+
  734. 'endif'#010+
  735. #010+
  736. '# OpenBSD'#010+
  737. 'ifeq ($(OS_TARGET),openbsd)'#010+
  738. 'EXEEXT='#010+
  739. 'HASSHAREDLIB=1'#010+
  740. 'FPCMADE=fpcmade.openbsd'#010+
  741. 'ZIPSUFFIX=openbsd'#010+
  742. 'endif'#010+
  743. #010+
  744. '# Win32'#010+
  745. 'ifeq ($(OS_TARGET),win32)'#010+
  746. 'PPUEXT=.ppw'#010+
  747. 'OEXT=.ow'#010+
  748. 'ASMEXT=.sw'#010+
  749. 'SMARTEXT=.slw'#010+
  750. 'STATICLIBEXT=.','aw'#010+
  751. 'SHAREDLIBEXT=.dll'#010+
  752. 'FPCMADE=fpcmade.w32'#010+
  753. 'ZIPSUFFIX=w32'#010+
  754. 'endif'#010+
  755. #010+
  756. '# OS/2'#010+
  757. 'ifeq ($(OS_TARGET),os2)'#010+
  758. 'PPUEXT=.ppo'#010+
  759. 'ASMEXT=.so2'#010+
  760. 'OEXT=.oo2'#010+
  761. 'AOUTEXT=.out'#010+
  762. 'SMARTEXT=.sl2'#010+
  763. 'STATICLIBPREFIX='#010+
  764. 'STATICLIBEXT=.ao2'#010+
  765. 'SHAREDLIBEXT=.dll'#010+
  766. 'FPCMADE=fpcmade.os2'#010+
  767. 'ZIPSUFFIX=emx',#010+
  768. 'ECHO=echo'#010+
  769. 'endif'#010+
  770. #010+
  771. '# Amiga'#010+
  772. 'ifeq ($(OS_TARGET),amiga)'#010+
  773. 'EXEEXT='#010+
  774. 'PPUEXT=.ppu'#010+
  775. 'ASMEXT=.asm'#010+
  776. 'OEXT=.o'#010+
  777. 'SMARTEXT=.sl'#010+
  778. 'STATICLIBEXT=.a'#010+
  779. 'SHAREDLIBEXT=.library'#010+
  780. 'FPCMADE=fpcmade.amg'#010+
  781. 'endif'#010+
  782. #010+
  783. '# Atari'#010+
  784. 'ifeq ($(OS_TARGET),atari)'#010+
  785. 'PPUEXT=.ppu'#010+
  786. 'ASMEXT=.s'#010+
  787. 'OEXT=.o'#010+
  788. 'SMARTE','XT=.sl'#010+
  789. 'STATICLIBEXT=.a'#010+
  790. 'EXEEXT=.ttp'#010+
  791. 'FPCMADE=fpcmade.ata'#010+
  792. 'endif'#010+
  793. #010+
  794. '# BeOS'#010+
  795. 'ifeq ($(OS_TARGET),beos)'#010+
  796. 'PPUEXT=.ppu'#010+
  797. 'ASMEXT=.s'#010+
  798. 'OEXT=.o'#010+
  799. 'SMARTEXT=.sl'#010+
  800. 'STATICLIBEXT=.a'#010+
  801. 'EXEEXT='#010+
  802. 'FPCMADE=fpcmade.be'#010+
  803. 'ZIPSUFFIX=be'#010+
  804. 'endif'#010+
  805. #010+
  806. '# Solaris'#010+
  807. 'ifeq ($(OS_TARGET),sunos)'#010+
  808. 'PPUE','XT=.ppu'#010+
  809. 'ASMEXT=.s'#010+
  810. 'OEXT=.o'#010+
  811. 'SMARTEXT=.sl'#010+
  812. 'STATICLIBEXT=.a'#010+
  813. 'EXEEXT='#010+
  814. 'FPCMADE=fpcmade.sun'#010+
  815. 'ZIPSUFFIX=sun'#010+
  816. 'endif'#010+
  817. #010+
  818. '# QNX'#010+
  819. 'ifeq ($(OS_TARGET),qnx)'#010+
  820. 'PPUEXT=.ppu'#010+
  821. 'ASMEXT=.s'#010+
  822. 'OEXT=.o'#010+
  823. 'SMARTEXT=.sl'#010+
  824. 'STATICLIBEXT=.a'#010+
  825. 'EXEEXT='#010+
  826. 'FPCMADE=fpcmade.qnx'#010+
  827. 'ZIPSUFFIX=qnx'#010+
  828. 'endif',#010+
  829. #010+
  830. '# Netware'#010+
  831. 'ifeq ($(OS_TARGET),netware)'#010+
  832. 'STATICLIBPREFIX='#010+
  833. 'PPUEXT=.ppu'#010+
  834. 'OEXT=.o'#010+
  835. 'ASMEXT=.s'#010+
  836. 'SMARTEXT=.sl'#010+
  837. 'STATICLIBEXT=.a'#010+
  838. 'SHAREDLIBEXT=.nlm'#010+
  839. 'FPCMADE=fpcmade.nw'#010+
  840. 'ZIPSUFFIX=nw'#010+
  841. 'EXEEXT=.nlm'#010+
  842. 'endif'#010+
  843. #010+
  844. '# MacOS'#010+
  845. 'ifeq ($(OS_TARGET),macos)'#010+
  846. 'PPUEXT=.ppu'#010+
  847. 'ASMEXT=.s',#010+
  848. 'OEXT=.o'#010+
  849. 'SMARTEXT=.sl'#010+
  850. 'STATICLIBEXT=.a'#010+
  851. 'EXEEXT='#010+
  852. 'FPCMADE=fpcmade.mcc'#010+
  853. 'endif'#010+
  854. 'else'#010+
  855. '#shorter version for 1.1 and above - no target specific extensions'#010+
  856. '# Go32v1'#010+
  857. 'ifeq ($(OS_TARGET),go32v1)'#010+
  858. 'STATICLIBPREFIX='#010+
  859. 'FPCMADE=fpcmade.v1'#010+
  860. 'PACKAGESUFFIX=v1'#010+
  861. 'endif'#010+
  862. #010,
  863. '# Go32v2'#010+
  864. 'ifeq ($(OS_TARGET),go32v2)'#010+
  865. 'STATICLIBPREFIX='#010+
  866. 'FPCMADE=fpcmade.dos'#010+
  867. 'ZIPSUFFIX=go32'#010+
  868. 'endif'#010+
  869. #010+
  870. '# Linux'#010+
  871. 'ifeq ($(OS_TARGET),linux)'#010+
  872. 'EXEEXT='#010+
  873. 'HASSHAREDLIB=1'#010+
  874. 'FPCMADE=fpcmade.lnx'#010+
  875. 'ZIPSUFFIX=linux'#010+
  876. 'endif'#010+
  877. #010+
  878. '# FreeBSD'#010+
  879. 'ifeq ($(OS_TARGET),freebsd)'#010+
  880. 'EXEEXT=',#010+
  881. 'HASSHAREDLIB=1'#010+
  882. 'FPCMADE=fpcmade.freebsd'#010+
  883. 'ZIPSUFFIX=freebsd'#010+
  884. 'endif'#010+
  885. #010+
  886. '# NetBSD'#010+
  887. 'ifeq ($(OS_TARGET),netbsd)'#010+
  888. 'EXEEXT='#010+
  889. 'HASSHAREDLIB=1'#010+
  890. 'FPCMADE=fpcmade.netbsd'#010+
  891. 'ZIPSUFFIX=netbsd'#010+
  892. 'endif'#010+
  893. #010+
  894. '# OpenBSD'#010+
  895. 'ifeq ($(OS_TARGET),openbsd)'#010+
  896. 'EXEEXT='#010+
  897. 'HASSHAREDLIB=1'#010+
  898. 'FPCMADE=','fpcmade.openbsd'#010+
  899. 'ZIPSUFFIX=openbsd'#010+
  900. 'endif'#010+
  901. #010+
  902. '# Win32'#010+
  903. 'ifeq ($(OS_TARGET),win32)'#010+
  904. 'SHAREDLIBEXT=.dll'#010+
  905. 'FPCMADE=fpcmade.w32'#010+
  906. 'ZIPSUFFIX=w32'#010+
  907. 'endif'#010+
  908. #010+
  909. '# OS/2'#010+
  910. 'ifeq ($(OS_TARGET),os2)'#010+
  911. 'AOUTEXT=.out'#010+
  912. 'STATICLIBPREFIX='#010+
  913. 'SHAREDLIBEXT=.dll'#010+
  914. 'FPCMADE=fpcmade.os2'#010+
  915. 'ZIPSUFF','IX=os2'#010+
  916. 'ECHO=echo'#010+
  917. 'endif'#010+
  918. #010+
  919. '# EMX'#010+
  920. 'ifeq ($(OS_TARGET),emx)'#010+
  921. 'AOUTEXT=.out'#010+
  922. 'STATICLIBPREFIX='#010+
  923. 'SHAREDLIBEXT=.dll'#010+
  924. 'FPCMADE=fpcmade.emx'#010+
  925. 'ZIPSUFFIX=emx'#010+
  926. 'ECHO=echo'#010+
  927. 'endif'#010+
  928. #010+
  929. '# Amiga'#010+
  930. 'ifeq ($(OS_TARGET),amiga)'#010+
  931. 'EXEEXT='#010+
  932. 'SHAREDLIBEXT=.library'#010+
  933. 'FPCMADE=fpcmade.amg'#010+
  934. 'end','if'#010+
  935. #010+
  936. '# Atari'#010+
  937. 'ifeq ($(OS_TARGET),atari)'#010+
  938. 'EXEEXT=.ttp'#010+
  939. 'FPCMADE=fpcmade.ata'#010+
  940. 'endif'#010+
  941. #010+
  942. '# BeOS'#010+
  943. 'ifeq ($(OS_TARGET),beos)'#010+
  944. 'EXEEXT='#010+
  945. 'FPCMADE=fpcmade.be'#010+
  946. 'ZIPSUFFIX=be'#010+
  947. 'endif'#010+
  948. #010+
  949. '# Solaris'#010+
  950. 'ifeq ($(OS_TARGET),sunos)'#010+
  951. 'EXEEXT='#010+
  952. 'FPCMADE=fpcmade.sun'#010+
  953. 'ZIPSUFFIX=sun'#010+
  954. 'endif'#010,
  955. #010+
  956. '# QNX'#010+
  957. 'ifeq ($(OS_TARGET),qnx)'#010+
  958. 'EXEEXT='#010+
  959. 'FPCMADE=fpcmade.qnx'#010+
  960. 'ZIPSUFFIX=qnx'#010+
  961. 'endif'#010+
  962. #010+
  963. '# Netware'#010+
  964. 'ifeq ($(OS_TARGET),netware)'#010+
  965. 'EXEEXT=.nlm'#010+
  966. 'STATICLIBPREFIX='#010+
  967. 'FPCMADE=fpcmade.nw'#010+
  968. 'ZIPSUFFIX=nw'#010+
  969. 'endif'#010+
  970. #010+
  971. '# MacOS'#010+
  972. 'ifeq ($(OS_TARGET),macos)'#010+
  973. 'EXEEXT='#010+
  974. 'FPCMADE=fpcm','ade.mcc'#010+
  975. 'endif'#010+
  976. #010+
  977. '#end of target specific settings'#010+
  978. 'endif'#010+
  979. #010+
  980. '[defaulttools]'#010+
  981. '#####################################################################'#010+
  982. '# Default Tools'#010+
  983. '#####################################################################'#010+
  984. #010+
  985. '# Names of th','e binutils tools'#010+
  986. 'ASNAME=as'#010+
  987. 'LDNAME=ld'#010+
  988. 'ARNAME=ar'#010+
  989. 'RCNAME=rc'#010+
  990. 'ifeq ($(OS_TARGET),win32)'#010+
  991. 'ASNAME=asw'#010+
  992. 'LDNAME=ldw'#010+
  993. 'ARNAME=arw'#010+
  994. 'endif'#010+
  995. #010+
  996. '# assembler, redefine it if cross compiling'#010+
  997. 'ifndef ASPROG'#010+
  998. 'ifdef CROSSBINDIR'#010+
  999. 'ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEX','T)'#010+
  1000. 'else'#010+
  1001. 'ASPROG=$(ASNAME)'#010+
  1002. 'endif'#010+
  1003. 'endif'#010+
  1004. #010+
  1005. '# linker, but probably not used'#010+
  1006. 'ifndef LDPROG'#010+
  1007. 'ifdef CROSSBINDIR'#010+
  1008. 'LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)'#010+
  1009. 'else'#010+
  1010. 'LDPROG=$(LDNAME)'#010+
  1011. 'endif'#010+
  1012. 'endif'#010+
  1013. #010+
  1014. '# Resource compiler'#010+
  1015. 'ifndef RCPROG'#010+
  1016. 'ifdef CROSSBINDIR'#010+
  1017. 'RCPROG=','$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)'#010+
  1018. 'else'#010+
  1019. 'RCPROG=$(RCNAME)'#010+
  1020. 'endif'#010+
  1021. 'endif'#010+
  1022. #010+
  1023. '# Archiver'#010+
  1024. 'ifndef ARPROG'#010+
  1025. 'ifdef CROSSBINDIR'#010+
  1026. 'ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)'#010+
  1027. 'else'#010+
  1028. 'ARPROG=$(ARNAME)'#010+
  1029. 'endif'#010+
  1030. 'endif'#010+
  1031. #010+
  1032. '# Override defaults'#010+
  1033. 'AS=$(ASPROG)'#010+
  1034. 'LD=$(LDPROG)'#010,
  1035. 'RC=$(RCPROG)'#010+
  1036. 'AR=$(ARPROG)'#010+
  1037. #010+
  1038. '# ppas.bat / ppas.sh'#010+
  1039. 'PPAS=ppas$(BATCHEXT)'#010+
  1040. #010+
  1041. '# ldconfig to rebuild .so cache'#010+
  1042. 'ifdef inUnix'#010+
  1043. 'LDCONFIG=ldconfig'#010+
  1044. 'else'#010+
  1045. 'LDCONFIG='#010+
  1046. 'endif'#010+
  1047. #010+
  1048. 'ifdef DATE'#010+
  1049. 'DATESTR:=$(shell $(DATE) +%Y%m%d)'#010+
  1050. 'else'#010+
  1051. 'DATESTR='#010+
  1052. 'endif'#010+
  1053. #010+
  1054. '# Look if UPX is fo','und for go32v2 and win32. We can'#039't use $UPX b'+
  1055. 'ecuase'#010+
  1056. '# upx uses that one itself (PFV)'#010+
  1057. 'ifndef UPXPROG'#010+
  1058. 'ifeq ($(OS_TARGET),go32v2)'#010+
  1059. 'UPXPROG:=1'#010+
  1060. 'endif'#010+
  1061. 'ifeq ($(OS_TARGET),win32)'#010+
  1062. 'UPXPROG:=1'#010+
  1063. 'endif'#010+
  1064. 'ifdef UPXPROG'#010+
  1065. 'UPXPROG:=$(strip $(wildcard $(addsuffix',' /upx$(SRCEXEEXT),$(SEARCHPAT'+
  1066. 'H))))'#010+
  1067. 'ifeq ($(UPXPROG),)'#010+
  1068. 'UPXPROG='#010+
  1069. 'else'#010+
  1070. 'UPXPROG:=$(firstword $(UPXPROG))'#010+
  1071. 'endif'#010+
  1072. 'else'#010+
  1073. 'UPXPROG='#010+
  1074. 'endif'#010+
  1075. 'endif'#010+
  1076. 'export UPXPROG'#010+
  1077. #010+
  1078. '# Zip options'#010+
  1079. 'ZIPOPT=-9'#010+
  1080. 'ZIPEXT=.zip'#010+
  1081. #010+
  1082. '# Tar options'#010+
  1083. 'ifeq ($(USETAR),bz2)'#010+
  1084. 'TAROPT=vI'#010+
  1085. 'TAREXT=.t','ar.bz2'#010+
  1086. 'else'#010+
  1087. 'TAROPT=vz'#010+
  1088. 'TAREXT=.tar.gz'#010+
  1089. 'endif'#010+
  1090. #010+
  1091. #010+
  1092. '[command_begin]'#010+
  1093. '#####################################################################'#010+
  1094. '# Compiler Command Line'#010+
  1095. '#####################################################################'#010+
  1096. #010+
  1097. '# Load command','line OPTDEF and add FPC_CPU define, for compiling the'#010+
  1098. '# compiler this needs to be turned off'#010+
  1099. 'ifndef NOCPUDEF'#010+
  1100. 'override FPCOPTDEF=$(CPU_TARGET)'#010+
  1101. 'endif'#010+
  1102. #010+
  1103. '# Load commandline OPT and add target and unit dir to be sure'#010+
  1104. 'ifneq ($(OS_TARGET),$(OS_SOUR','CE))'#010+
  1105. 'override FPCOPT+=-T$(OS_TARGET)'#010+
  1106. 'endif'#010+
  1107. #010+
  1108. 'ifeq ($(OS_SOURCE),openbsd)'#010+
  1109. 'override FPCOPT+=-FD$(NEW_BINUTILS_PATH)'#010+
  1110. 'endif'#010+
  1111. #010+
  1112. '# User dirs should be first, so they are looked at first'#010+
  1113. 'ifdef UNITDIR'#010+
  1114. 'override FPCOPT+=$(addprefix -Fu,$(UNITDIR))'#010+
  1115. 'endi','f'#010+
  1116. 'ifdef LIBDIR'#010+
  1117. 'override FPCOPT+=$(addprefix -Fl,$(LIBDIR))'#010+
  1118. 'endif'#010+
  1119. 'ifdef OBJDIR'#010+
  1120. 'override FPCOPT+=$(addprefix -Fo,$(OBJDIR))'#010+
  1121. 'endif'#010+
  1122. 'ifdef INCDIR'#010+
  1123. 'override FPCOPT+=$(addprefix -Fi,$(INCDIR))'#010+
  1124. 'endif'#010+
  1125. #010+
  1126. '# Smartlinking'#010+
  1127. 'ifdef LINKSMART'#010+
  1128. 'override FPCOPT+=','-XX'#010+
  1129. 'endif'#010+
  1130. #010+
  1131. '# Smartlinking creation'#010+
  1132. 'ifdef CREATESMART'#010+
  1133. 'override FPCOPT+=-CX'#010+
  1134. 'endif'#010+
  1135. #010+
  1136. '# Debug'#010+
  1137. 'ifdef DEBUG'#010+
  1138. 'override FPCOPT+=-gl'#010+
  1139. 'override FPCOPTDEF+=DEBUG'#010+
  1140. 'endif'#010+
  1141. #010+
  1142. '# Release mode (strip, optimize and don'#039't load fpc.cfg)'#010+
  1143. 'ifdef RELEASE'#010+
  1144. 'ifeq ($(CPU_TAR','GET),i386)'#010+
  1145. 'FPCCPUOPT:=-OG2p3'#010+
  1146. 'else'#010+
  1147. 'FPCCPUOPT:='#010+
  1148. 'endif'#010+
  1149. 'override FPCOPT+=-Xs $(FPCCPUOPT) -n'#010+
  1150. 'override FPCOPTDEF+=RELEASE'#010+
  1151. 'endif'#010+
  1152. #010+
  1153. '# Strip'#010+
  1154. 'ifdef STRIP'#010+
  1155. 'override FPCOPT+=-Xs'#010+
  1156. 'endif'#010+
  1157. #010+
  1158. '# Optimizer (i386 only for now)'#010+
  1159. 'ifdef OPTIMIZE'#010+
  1160. 'ifeq ($(CPU_TARGET),i','386)'#010+
  1161. 'override FPCOPT+=-OG2p3'#010+
  1162. 'endif'#010+
  1163. 'endif'#010+
  1164. #010+
  1165. '# Verbose settings (warning,note,info)'#010+
  1166. 'ifdef VERBOSE'#010+
  1167. 'override FPCOPT+=-vwni'#010+
  1168. 'endif'#010+
  1169. #010+
  1170. '# Needed compiler options'#010+
  1171. 'ifdef COMPILER_OPTIONS'#010+
  1172. 'override FPCOPT+=$(COMPILER_OPTIONS)'#010+
  1173. 'endif'#010+
  1174. 'ifdef COMPILER_UNITDIR'#010,
  1175. 'override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))'#010+
  1176. 'endif'#010+
  1177. 'ifdef COMPILER_LIBRARYDIR'#010+
  1178. 'override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))'#010+
  1179. 'endif'#010+
  1180. 'ifdef COMPILER_OBJECTDIR'#010+
  1181. 'override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))'#010+
  1182. 'endif'#010+
  1183. 'ifde','f COMPILER_INCLUDEDIR'#010+
  1184. 'override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))'#010+
  1185. 'endif'#010+
  1186. #010+
  1187. '# Cross compiler utils'#010+
  1188. 'ifdef CROSSBINDIR'#010+
  1189. 'override FPCOPT+=-FD$(CROSSBINDIR)'#010+
  1190. 'endif'#010+
  1191. #010+
  1192. '# Target dirs and the prefix to use for clean/install'#010+
  1193. 'ifdef COMPILER_TA','RGETDIR'#010+
  1194. 'override FPCOPT+=-FE$(COMPILER_TARGETDIR)'#010+
  1195. 'ifeq ($(COMPILER_TARGETDIR),.)'#010+
  1196. 'override TARGETDIRPREFIX='#010+
  1197. 'else'#010+
  1198. 'override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/'#010+
  1199. 'endif'#010+
  1200. 'endif'#010+
  1201. #010+
  1202. '# Unit target dir'#010+
  1203. 'ifdef COMPILER_UNITTARGETDIR'#010+
  1204. 'override FPCOPT+=-FU','$(COMPILER_UNITTARGETDIR)'#010+
  1205. 'ifeq ($(COMPILER_UNITTARGETDIR),.)'#010+
  1206. 'override UNITTARGETDIRPREFIX='#010+
  1207. 'else'#010+
  1208. 'override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/'#010+
  1209. 'endif'#010+
  1210. 'else'#010+
  1211. 'ifdef COMPILER_TARGETDIR'#010+
  1212. 'override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR',')'#010+
  1213. 'override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)'#010+
  1214. 'endif'#010+
  1215. 'endif'#010+
  1216. #010+
  1217. '# Temporary hack to add HASUNIX define for linux 1.0.6 compiler'#010+
  1218. 'ifeq ($(OS_TARGET),linux)'#010+
  1219. 'ifeq ($(FPC_VERSION),1.0.6)'#010+
  1220. 'override FPCOPTDEF+=HASUNIX'#010+
  1221. 'endif'#010+
  1222. 'endif'#010+
  1223. #010+
  1224. '[command_libc]'#010+
  1225. '# A','dd GCC lib path if asked'#010+
  1226. 'ifdef GCCLIBDIR'#010+
  1227. 'override FPCOPT+=-Fl$(GCCLIBDIR)'#010+
  1228. 'endif'#010+
  1229. 'ifdef OTHERLIBDIR'#010+
  1230. 'override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))'#010+
  1231. 'endif'#010+
  1232. #010+
  1233. #010+
  1234. '[command_end]'#010+
  1235. '# Add commandline options last so they can override'#010+
  1236. 'ifdef OPT'#010+
  1237. 'override ','FPCOPT+=$(OPT)'#010+
  1238. 'endif'#010+
  1239. #010+
  1240. '# Add defines from FPCOPTDEF to FPCOPT'#010+
  1241. 'ifdef FPCOPTDEF'#010+
  1242. 'override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))'#010+
  1243. 'endif'#010+
  1244. #010+
  1245. '# Was a config file specified ?'#010+
  1246. 'ifdef CFGFILE'#010+
  1247. 'override FPCOPT+=@$(CFGFILE)'#010+
  1248. 'endif'#010+
  1249. #010+
  1250. '# Use the environment to pas','s commandline options?'#010+
  1251. 'ifdef USEENV'#010+
  1252. 'override FPCEXTCMD:=$(FPCOPT)'#010+
  1253. 'override FPCOPT:=!FPCEXTCMD'#010+
  1254. 'export FPCEXTCMD'#010+
  1255. 'endif'#010+
  1256. #010+
  1257. '# Compiler commandline'#010+
  1258. 'override COMPILER:=$(FPC) $(FPCOPT)'#010+
  1259. #010+
  1260. '# also call ppas if with command option -s'#010+
  1261. '# but only if the O','S_SOURCE and OS_TARGET are equal'#010+
  1262. 'ifeq (,$(findstring -s ,$(COMPILER)))'#010+
  1263. 'EXECPPAS='#010+
  1264. 'else'#010+
  1265. 'ifeq ($(OS_SOURCE),$(OS_TARGET))'#010+
  1266. 'EXECPPAS:=@$(PPAS)'#010+
  1267. 'endif'#010+
  1268. 'endif'#010+
  1269. #010+
  1270. #010+
  1271. '[loaderrules]'#010+
  1272. '#####################################################################'#010+
  1273. '# Lo','aders'#010+
  1274. '#####################################################################'#010+
  1275. #010+
  1276. '.PHONY: fpc_loaders'#010+
  1277. #010+
  1278. 'ifdef TARGET_LOADERS'#010+
  1279. 'override ALLTARGET+=fpc_loaders'#010+
  1280. 'override CLEANTARGET+=fpc_loaders_clean'#010+
  1281. 'override INSTALLTARGET+=fpc_loaders_install'#010+
  1282. #010+
  1283. 'over','ride LOADEROFILES:=$(addsuffix $(OEXT),$(TARGET_LOADERS))'#010+
  1284. 'endif'#010+
  1285. #010+
  1286. '%$(OEXT): %$(LOADEREXT)'#010+
  1287. ' $(AS) -o $*$(OEXT) $<'#010+
  1288. #010+
  1289. 'fpc_loaders: $(LOADEROFILES)'#010+
  1290. #010+
  1291. 'fpc_loaders_clean:'#010+
  1292. ' -$(DEL) $(LOADEROFILES)'#010+
  1293. #010+
  1294. 'fpc_loaders_install:'#010+
  1295. ' $(MKDIR) ','$(INSTALL_UNITDIR)'#010+
  1296. ' $(INSTALL) $(LOADEROFILES) $(INSTALL_UNITDIR)'#010+
  1297. #010+
  1298. #010+
  1299. '[unitrules]'#010+
  1300. '#####################################################################'#010+
  1301. '# Units'#010+
  1302. '#####################################################################'#010+
  1303. #010+
  1304. '.PHO','NY: fpc_units'#010+
  1305. #010+
  1306. 'ifdef TARGET_UNITS'#010+
  1307. 'override ALLTARGET+=fpc_units'#010+
  1308. #010+
  1309. 'override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))'#010+
  1310. 'override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITU'+
  1311. 'NITS))'#010+
  1312. 'override INSTALLPPUFILES+=$(UNITPPUFI','LES) $(IMPLICITUNITPPUFILES)'#010+
  1313. 'override CLEANPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)'#010+
  1314. 'endif'#010+
  1315. #010+
  1316. 'fpc_units: $(UNITPPUFILES)'#010+
  1317. #010+
  1318. #010+
  1319. '[exerules]'#010+
  1320. '#####################################################################'#010+
  1321. '# Exes'#010+
  1322. '#######################','#############################################'+
  1323. '#'#010+
  1324. #010+
  1325. '.PHONY: fpc_exes'#010+
  1326. #010+
  1327. 'ifdef TARGET_PROGRAMS'#010+
  1328. 'override EXEFILES=$(addsuffix $(EXEEXT),$(TARGET_PROGRAMS))'#010+
  1329. 'override EXEOFILES:=$(addsuffix $(OEXT),$(TARGET_PROGRAMS)) $(addprefi'+
  1330. 'x $(STATICLIBPREFIX),$','(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS))'+
  1331. ')'#010+
  1332. #010+
  1333. 'override ALLTARGET+=fpc_exes'#010+
  1334. 'override INSTALLEXEFILES+=$(EXEFILES)'#010+
  1335. 'override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)'#010+
  1336. 'ifeq ($(OS_TARGET),os2)'#010+
  1337. 'override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TA','RGET_PROGRAMS))'#010+
  1338. 'endif'#010+
  1339. 'ifeq ($(OS_TARGET),emx)'#010+
  1340. 'override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))'#010+
  1341. 'endif'#010+
  1342. 'endif'#010+
  1343. #010+
  1344. 'fpc_exes: $(EXEFILES)'#010+
  1345. #010+
  1346. #010+
  1347. '[rstrules]'#010+
  1348. '#####################################################################'#010+
  1349. '# Resourc','e strings'#010+
  1350. '#####################################################################'#010+
  1351. #010+
  1352. 'ifdef TARGET_RSTS'#010+
  1353. 'override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))'#010+
  1354. #010+
  1355. 'override CLEANRSTFILES+=$(RSTFILES)'#010+
  1356. 'endif'#010+
  1357. #010+
  1358. #010+
  1359. '[examplerules]'#010+
  1360. '#########################','###########################################'+
  1361. '#'#010+
  1362. '# Examples'#010+
  1363. '#####################################################################'#010+
  1364. #010+
  1365. '.PHONY: fpc_examples'#010+
  1366. #010+
  1367. 'ifdef TARGET_EXAMPLES'#010+
  1368. 'HASEXAMPLES=1'#010+
  1369. 'override EXAMPLESOURCEFILES:=$(wildcard $(addsuffix .pp',',$(TARGET_EXA'+
  1370. 'MPLES)) $(addsuffix .pas,$(TARGET_EXAMPLES)))'#010+
  1371. 'override EXAMPLEFILES:=$(addsuffix $(EXEEXT),$(TARGET_EXAMPLES))'#010+
  1372. 'override EXAMPLEOFILES:=$(addsuffix $(OEXT),$(TARGET_EXAMPLES)) $(addp'+
  1373. 'refix $(STATICLIBPREFIX),$(addsuffix $(STATICL','IBEXT),$(TARGET_EXAMPL'+
  1374. 'ES)))'#010+
  1375. #010+
  1376. 'override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)'#010+
  1377. 'ifeq ($(OS_TARGET),os2)'#010+
  1378. 'override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_EXAMPLES))'#010+
  1379. 'endif'#010+
  1380. 'ifeq ($(OS_TARGET),emx)'#010+
  1381. 'override CLEANEXEFILES+=$(addsuff','ix $(AOUTEXT),$(TARGET_EXAMPLES))'#010+
  1382. 'endif'#010+
  1383. 'endif'#010+
  1384. 'ifdef TARGET_EXAMPLEDIRS'#010+
  1385. 'HASEXAMPLES=1'#010+
  1386. 'endif'#010+
  1387. #010+
  1388. 'fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIR'+
  1389. 'S))'#010+
  1390. #010+
  1391. #010+
  1392. '[compilerules]'#010+
  1393. '#########################################################','###########'+
  1394. '#'#010+
  1395. '# General compile rules'#010+
  1396. '#####################################################################'#010+
  1397. #010+
  1398. '.PHONY: fpc_all fpc_smart fpc_debug fpc_release'#010+
  1399. #010+
  1400. '$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)'#010+
  1401. ' @$(ECHOREDIR) Compiled > $(FPCM','ADE)'#010+
  1402. #010+
  1403. 'fpc_all: $(FPCMADE)'#010+
  1404. #010+
  1405. 'fpc_smart:'#010+
  1406. ' $(MAKE) all LINKSMART=1 CREATESMART=1'#010+
  1407. #010+
  1408. 'fpc_debug:'#010+
  1409. ' $(MAKE) all DEBUG=1'#010+
  1410. #010+
  1411. 'fpc_release:'#010+
  1412. ' $(MAKE) all RELEASE=1'#010+
  1413. #010+
  1414. '# General compile rules, available for both possible .pp and .pas exte'+
  1415. 'n','sions'#010+
  1416. #010+
  1417. '.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res'#010+
  1418. #010+
  1419. '%$(PPUEXT): %.pp'#010+
  1420. ' $(COMPILER) $<'#010+
  1421. ' $(EXECPPAS)'#010+
  1422. #010+
  1423. '%$(PPUEXT): %.pas'#010+
  1424. ' $(COMPILER) $<'#010+
  1425. ' $(EXECPPAS)'#010+
  1426. #010+
  1427. '%$(EXEEXT): %.pp'#010+
  1428. ' $(COMPILER) $<'#010+
  1429. ' $(EX','ECPPAS)'#010+
  1430. #010+
  1431. '%$(EXEEXT): %.pas'#010+
  1432. ' $(COMPILER) $<'#010+
  1433. ' $(EXECPPAS)'#010+
  1434. #010+
  1435. '%.res: %.rc'#010+
  1436. ' windres -i $< -o $@'#010+
  1437. #010+
  1438. '# Search paths for .ppu and .pp and .pas'#010+
  1439. 'vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)'#010+
  1440. 'vpath %.pas $(COMPILER_SOURCEDI','R) $(COMPILER_INCLUDEDIR)'#010+
  1441. 'vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)'#010+
  1442. #010+
  1443. #010+
  1444. '[libraryrules]'#010+
  1445. '#####################################################################'#010+
  1446. '# Library'#010+
  1447. '#####################################################################'#010+
  1448. #010+
  1449. '.PH','ONY: fpc_shared'#010+
  1450. #010+
  1451. 'ifndef LIB_FULLNAME'#010+
  1452. 'ifdef LIB_VERSION'#010+
  1453. 'LIB_FULLNAME=$(LIB_NAME).$(LIB_VERSION)'#010+
  1454. 'else'#010+
  1455. 'LIB_FULLNAME=$(LIB_NAME)'#010+
  1456. 'endif'#010+
  1457. 'endif'#010+
  1458. #010+
  1459. '# Default sharedlib units are all unit objects'#010+
  1460. 'ifndef LIB_SHAREDUNITS'#010+
  1461. 'LIB_SHAREDUNITS:=$(TARGET_UNITS)',#010+
  1462. 'endif'#010+
  1463. #010+
  1464. 'fpc_shared: all'#010+
  1465. 'ifdef HASSHAREDLIB'#010+
  1466. ' $(PPUMOVE) $(LIB_SHAREDUNITS) -o$(LIB_FULLNAME)'#010+
  1467. 'else'#010+
  1468. ' @$(ECHO) Shared Libraries not supported'#010+
  1469. 'endif'#010+
  1470. #010+
  1471. #010+
  1472. '[installrules]'#010+
  1473. '#################################################################','###'+
  1474. '#'#010+
  1475. '# Install rules'#010+
  1476. '#####################################################################'#010+
  1477. #010+
  1478. '.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall'#010+
  1479. #010+
  1480. 'ifdef INSTALL_UNITS'#010+
  1481. 'override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))'#010+
  1482. 'endi','f'#010+
  1483. #010+
  1484. 'ifdef INSTALL_BUILDUNIT'#010+
  1485. 'override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$'+
  1486. '(INSTALLPPUFILES))'#010+
  1487. 'endif'#010+
  1488. #010+
  1489. 'ifdef INSTALLPPUFILES'#010+
  1490. 'override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFI'+
  1491. 'LES)) $(addprefix $(STATI','CLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEX'+
  1492. 'T),$(INSTALLPPUFILES)))'#010+
  1493. 'override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALL'+
  1494. 'PPUFILES))'#010+
  1495. 'override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPR'+
  1496. 'EFIX),$(INSTALLPPULINK','FILES)))'#010+
  1497. '# Implicitly install Package.fpc'#010+
  1498. 'override INSTALL_CREATEPACKAGEFPC=1'#010+
  1499. 'endif'#010+
  1500. #010+
  1501. 'ifdef INSTALLEXEFILES'#010+
  1502. 'override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEF'+
  1503. 'ILES))'#010+
  1504. 'endif'#010+
  1505. #010+
  1506. 'fpc_install: all $(INSTALLTARGET)'#010+
  1507. 'ifdef INSTALLEX','EFILES'#010+
  1508. ' $(MKDIR) $(INSTALL_BINDIR)'#010+
  1509. '# Compress the exes if upx is defined'#010+
  1510. 'ifdef UPXPROG'#010+
  1511. ' -$(UPXPROG) $(INSTALLEXEFILES)'#010+
  1512. 'endif'#010+
  1513. ' $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)'#010+
  1514. 'endif'#010+
  1515. 'ifdef INSTALL_CREATEPACKAGEFPC'#010+
  1516. 'ifdef',' FPCMAKE'#010+
  1517. '# If the fpcpackage variable is set then create and install Package.fp'+
  1518. 'c,'#010+
  1519. '# a safety check is done if Makefile.fpc is available'#010+
  1520. 'ifdef PACKAGE_VERSION'#010+
  1521. 'ifneq ($(wildcard Makefile.fpc),)'#010+
  1522. ' $(FPCMAKE) -p -T$(OS_TARGET) Makefile.fp','c'#010+
  1523. ' $(MKDIR) $(INSTALL_UNITDIR)'#010+
  1524. ' $(INSTALL) Package.fpc $(INSTALL_UNITDIR)'#010+
  1525. 'endif'#010+
  1526. 'endif'#010+
  1527. 'endif'#010+
  1528. 'endif'#010+
  1529. 'ifdef INSTALLPPUFILES'#010+
  1530. ' $(MKDIR) $(INSTALL_UNITDIR)'#010+
  1531. ' $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)'#010+
  1532. 'ifneq ($(INST','ALLPPULINKFILES),)'#010+
  1533. ' $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)'#010+
  1534. 'endif'#010+
  1535. 'ifneq ($(wildcard $(LIB_FULLNAME)),)'#010+
  1536. ' $(MKDIR) $(INSTALL_LIBDIR)'#010+
  1537. ' $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)'#010+
  1538. 'ifdef inUnix'#010+
  1539. ' ln -sf $','(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)'#010+
  1540. 'endif'#010+
  1541. 'endif'#010+
  1542. 'endif'#010+
  1543. 'ifdef INSTALL_FILES'#010+
  1544. ' $(MKDIR) $(INSTALL_DATADIR)'#010+
  1545. ' $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)'#010+
  1546. 'endif'#010+
  1547. #010+
  1548. 'fpc_sourceinstall: distclean'#010+
  1549. ' $(MKDIR) $(INSTALL_SOU','RCEDIR)'#010+
  1550. ' $(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)'#010+
  1551. #010+
  1552. 'fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))'#010+
  1553. 'ifdef HASEXAMPLES'#010+
  1554. ' $(MKDIR) $(INSTALL_EXAMPLEDIR)'#010+
  1555. 'endif'#010+
  1556. 'ifdef EXAMPLESOURCEFILES'#010+
  1557. ' $(COPY) $(EXAMP','LESOURCEFILES) $(INSTALL_EXAMPLEDIR)'#010+
  1558. 'endif'#010+
  1559. 'ifdef TARGET_EXAMPLEDIRS'#010+
  1560. ' $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EX'+
  1561. 'AMPLEDIR)'#010+
  1562. 'endif'#010+
  1563. #010+
  1564. '[distinstallrules]'#010+
  1565. '##################################################################','##'+
  1566. '#'#010+
  1567. '# Dist Install'#010+
  1568. '#####################################################################'#010+
  1569. #010+
  1570. '.PHONY: fpc_distinstall'#010+
  1571. #010+
  1572. 'fpc_distinstall: install exampleinstall'#010+
  1573. #010+
  1574. #010+
  1575. '[zipinstallrules]'#010+
  1576. '#################################################################','###'+
  1577. '#'#010+
  1578. '# Zip'#010+
  1579. '#####################################################################'#010+
  1580. #010+
  1581. '.PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall'#010+
  1582. #010+
  1583. '# Temporary path to pack a file, can only use a single deep'#010+
  1584. '# subdir, because the deltree c','an'#039't see the whole tree to remove'+
  1585. #010+
  1586. 'ifndef PACKDIR'#010+
  1587. 'ifndef inUnix'#010+
  1588. 'PACKDIR=$(BASEDIR)/../fpc-pack'#010+
  1589. 'else'#010+
  1590. 'PACKDIR=/tmp/fpc-pack'#010+
  1591. 'endif'#010+
  1592. 'endif'#010+
  1593. #010+
  1594. '# Maybe create default zipname from packagename'#010+
  1595. 'ifndef ZIPNAME'#010+
  1596. 'ifdef DIST_ZIPNAME'#010+
  1597. 'ZIPNAME=$(DIST_ZIPNAME)'#010,
  1598. 'else'#010+
  1599. 'ZIPNAME=$(ZIPPREFIX)$(PACKAGE_NAME)$(ZIPSUFFIX)'#010+
  1600. 'endif'#010+
  1601. 'endif'#010+
  1602. #010+
  1603. '# ZipTarget'#010+
  1604. 'ifndef ZIPTARGET'#010+
  1605. 'ifdef DIST_ZIPTARGET'#010+
  1606. 'ZIPTARGET=DIST_ZIPTARGET'#010+
  1607. 'else'#010+
  1608. 'ZIPTARGET=install'#010+
  1609. 'endif'#010+
  1610. 'endif'#010+
  1611. #010+
  1612. '# Use tar by default under linux'#010+
  1613. 'ifndef USEZIP'#010+
  1614. 'ifdef inUnix'#010+
  1615. 'USE','TAR=1'#010+
  1616. 'endif'#010+
  1617. 'endif'#010+
  1618. #010+
  1619. '# Use a wrapper script by default for Os/2'#010+
  1620. 'ifndef inUnix'#010+
  1621. 'USEZIPWRAPPER=1'#010+
  1622. 'endif'#010+
  1623. #010+
  1624. '# We need to be able to run in the current OS so fix'#010+
  1625. '# the path separator'#010+
  1626. 'ifdef USEZIPWRAPPER'#010+
  1627. 'ZIPPATHSEP=$(PATHSEP)'#010+
  1628. 'ZIPWRAPPER=$(subst /,$(PA','THSEP),$(DIST_DESTDIR)/fpczip$(BATCHEXT))'#010+
  1629. 'else'#010+
  1630. 'ZIPPATHSEP=/'#010+
  1631. 'endif'#010+
  1632. #010+
  1633. '# Create commands to create the zip/tar file'#010+
  1634. 'ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))'#010+
  1635. 'ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))'#010+
  1636. 'ifdef USETAR'#010+
  1637. 'ZIPDEST','FILE:=$(DIST_DESTDIR)/$(ZIPNAME)$(TAREXT)'#010+
  1638. 'ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *'#010+
  1639. 'else'#010+
  1640. 'ZIPDESTFILE:=$(DIST_DESTDIR)/$(ZIPNAME)$(ZIPEXT)'#010+
  1641. 'ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDES'+
  1642. 'TFILE) *'#010+
  1643. 'endif'#010+
  1644. #010+
  1645. 'fpc_zi','pinstall:'#010+
  1646. ' $(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1'#010+
  1647. ' $(MKDIR) $(DIST_DESTDIR)'#010+
  1648. ' $(DEL) $(ZIPDESTFILE)'#010+
  1649. 'ifdef USEZIPWRAPPER'#010+
  1650. '# Handle gecho separate as we need to espace \ with \\'#010+
  1651. 'ifneq ($(ECHOREDIR),echo',')'#010+
  1652. ' $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPE'+
  1653. 'R)'#010+
  1654. ' $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)'+
  1655. #010+
  1656. ' $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPP'+
  1657. 'ER)'#010+
  1658. 'else'#010+
  1659. ' echo $(','ZIPCMD_CDPACK) > $(ZIPWRAPPER)'#010+
  1660. ' echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)'#010+
  1661. ' echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)'#010+
  1662. 'endif'#010+
  1663. 'ifdef inUnix'#010+
  1664. ' /bin/sh $(ZIPWRAPPER)'#010+
  1665. 'else'#010+
  1666. ' $(ZIPWRAPPER)'#010+
  1667. 'endif'#010+
  1668. ' $(DEL) $(ZIPWRAPPER)'#010+
  1669. 'else'#010+
  1670. ' ',' $(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)'#010+
  1671. 'endif'#010+
  1672. ' $(DELTREE) $(PACKDIR)'#010+
  1673. #010+
  1674. 'fpc_zipsourceinstall:'#010+
  1675. ' $(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=src'#010+
  1676. #010+
  1677. 'fpc_zipexampleinstall:'#010+
  1678. 'ifdef HASEXAMPLES'#010+
  1679. ' $(MA','KE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=ex'+
  1680. 'm'#010+
  1681. 'endif'#010+
  1682. #010+
  1683. 'fpc_zipdistinstall:'#010+
  1684. ' $(MAKE) fpc_zipinstall ZIPTARGET=distinstall'#010+
  1685. #010+
  1686. #010+
  1687. '[cleanrules]'#010+
  1688. '#####################################################################'#010+
  1689. '# Clean rules'#010+
  1690. '###','#################################################################'+
  1691. '#'#010+
  1692. #010+
  1693. '.PHONY: fpc_clean fpc_cleanall fpc_distclean'#010+
  1694. #010+
  1695. 'ifdef EXEFILES'#010+
  1696. 'override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES'+
  1697. '))'#010+
  1698. 'endif'#010+
  1699. #010+
  1700. 'ifdef CLEAN_UNITS'#010+
  1701. 'override CLEA','NPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))'#010+
  1702. 'endif'#010+
  1703. #010+
  1704. 'ifdef CLEANPPUFILES'#010+
  1705. 'override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)'+
  1706. ') $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(C'+
  1707. 'LEANPPUFILES)))'#010+
  1708. 'override',' CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPP'+
  1709. 'UFILES))'#010+
  1710. 'override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREF'+
  1711. 'IX),$(CLEANPPULINKFILES)))'#010+
  1712. 'endif'#010+
  1713. #010+
  1714. 'fpc_clean: $(CLEANTARGET)'#010+
  1715. 'ifdef CLEANEXEFILES'#010+
  1716. ' -$(DEL) $(CLE','ANEXEFILES)'#010+
  1717. 'endif'#010+
  1718. 'ifdef CLEANPPUFILES'#010+
  1719. ' -$(DEL) $(CLEANPPUFILES)'#010+
  1720. 'endif'#010+
  1721. 'ifneq ($(CLEANPPULINKFILES),)'#010+
  1722. ' -$(DEL) $(CLEANPPULINKFILES)'#010+
  1723. 'endif'#010+
  1724. 'ifdef CLEANRSTFILES'#010+
  1725. ' -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))'#010+
  1726. 'e','ndif'#010+
  1727. 'ifdef CLEAN_FILES'#010+
  1728. ' -$(DEL) $(CLEAN_FILES)'#010+
  1729. 'endif'#010+
  1730. 'ifdef LIB_NAME'#010+
  1731. ' -$(DEL) $(LIB_NAME) $(LIB_FULLNAME)'#010+
  1732. 'endif'#010+
  1733. ' -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(F'+
  1734. 'PCEXTFILE) $(REDIRFILE)'#010+
  1735. #010+
  1736. 'fpc_distclean: clean',#010+
  1737. #010+
  1738. '# Also run clean first if targetdir is set. Unittargetdir is always'#010+
  1739. '# set if targetdir or unittargetdir is specified'#010+
  1740. 'ifdef COMPILER_UNITTARGETDIR'#010+
  1741. 'TARGETDIRCLEAN=fpc_clean'#010+
  1742. 'endif'#010+
  1743. #010+
  1744. 'fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)'#010+
  1745. 'ifdef CLEANEX','EFILES'#010+
  1746. ' -$(DEL) $(CLEANEXEFILES)'#010+
  1747. 'endif'#010+
  1748. ' -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIB'+
  1749. 'EXT) *$(SHAREDLIBEXT) *$(PPLEXT)'#010+
  1750. ' -$(DELTREE) *$(SMARTEXT)'#010+
  1751. ' -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res ','link.res $'+
  1752. '(FPCEXTFILE) $(REDIRFILE)'#010+
  1753. 'ifdef AOUTEXT'#010+
  1754. ' -$(DEL) *$(AOUTEXT)'#010+
  1755. 'endif'#010+
  1756. #010+
  1757. #010+
  1758. '[baseinforules]'#010+
  1759. '#####################################################################'#010+
  1760. '# Base info rules'#010+
  1761. '##################################################','##################'+
  1762. '#'#010+
  1763. #010+
  1764. '.PHONY: fpc_baseinfo'#010+
  1765. #010+
  1766. 'override INFORULES+=fpc_baseinfo'#010+
  1767. #010+
  1768. 'fpc_baseinfo:'#010+
  1769. ' @$(ECHO)'#010+
  1770. ' @$(ECHO) == Package info =='#010+
  1771. ' @$(ECHO) Package Name..... $(PACKAGE_NAME)'#010+
  1772. ' @$(ECHO) Package Version.. $(PACKA','GE_VERSION)'#010+
  1773. ' @$(ECHO)'#010+
  1774. ' @$(ECHO) == Configuration info =='#010+
  1775. ' @$(ECHO)'#010+
  1776. ' @$(ECHO) FPC.......... $(FPC)'#010+
  1777. ' @$(ECHO) FPC Version.. $(FPC_VERSION)'#010+
  1778. ' @$(ECHO) Source CPU... $(CPU_SOURCE)'#010+
  1779. ' @$(ECHO) T','arget CPU... $(CPU_TARGET)'#010+
  1780. ' @$(ECHO) Source OS.... $(OS_SOURCE)'#010+
  1781. ' @$(ECHO) Target OS.... $(OS_TARGET)'#010+
  1782. ' @$(ECHO) Full Source.. $(FULL_SOURCE)'#010+
  1783. ' @$(ECHO) Full Target.. $(FULL_TARGET)'#010+
  1784. ' @$(ECHO)'#010+
  1785. ' @$(E','CHO) == Directory info =='#010+
  1786. ' @$(ECHO)'#010+
  1787. ' @$(ECHO) Required pkgs... $(REQUIRE_PACKAGES)'#010+
  1788. ' @$(ECHO)'#010+
  1789. ' @$(ECHO) Basedir......... $(BASEDIR)'#010+
  1790. ' @$(ECHO) FPCDir.......... $(FPCDIR)'#010+
  1791. ' @$(ECHO) CrossBinDir....','. $(CROSSBINDIR)'#010+
  1792. ' @$(ECHO) UnitsDir........ $(UNITSDIR)'#010+
  1793. ' @$(ECHO) PackagesDir..... $(PACKAGESDIR)'#010+
  1794. ' @$(ECHO)'#010+
  1795. ' @$(ECHO) GCC library..... $(GCCLIBDIR)'#010+
  1796. ' @$(ECHO) Other library... $(OTHERLIBDIR)'#010+
  1797. ' @$(','ECHO)'#010+
  1798. ' @$(ECHO) == Tools info =='#010+
  1799. ' @$(ECHO)'#010+
  1800. ' @$(ECHO) As........ $(AS)'#010+
  1801. ' @$(ECHO) Ld........ $(LD)'#010+
  1802. ' @$(ECHO) Ar........ $(AR)'#010+
  1803. ' @$(ECHO) Rc........ $(RC)'#010+
  1804. ' @$(ECHO)'#010+
  1805. ' @$(ECHO) Mv.....','... $(MVPROG)'#010+
  1806. ' @$(ECHO) Cp........ $(CPPROG)'#010+
  1807. ' @$(ECHO) Rm........ $(RMPROG)'#010+
  1808. ' @$(ECHO) GInstall.. $(GINSTALL)'#010+
  1809. ' @$(ECHO) Echo...... $(ECHO)'#010+
  1810. ' @$(ECHO) Shell..... $(SHELL)'#010+
  1811. ' @$(ECHO) Date...... $(D','ATE)'#010+
  1812. ' @$(ECHO) FPCMake... $(FPCMAKE)'#010+
  1813. ' @$(ECHO) PPUMove... $(PPUMOVE)'#010+
  1814. ' @$(ECHO) Upx....... $(UPXPROG)'#010+
  1815. ' @$(ECHO) Zip....... $(ZIPPROG)'#010+
  1816. ' @$(ECHO)'#010+
  1817. ' @$(ECHO) == Object info =='#010+
  1818. ' @$(ECHO)'#010+
  1819. ' ',' @$(ECHO) Target Loaders........ $(TARGET_LOADERS)'#010+
  1820. ' @$(ECHO) Target Units.......... $(TARGET_UNITS)'#010+
  1821. ' @$(ECHO) Target Implicit Units. $(TARGET_IMPLICITUNITS)'#010+
  1822. ' @$(ECHO) Target Programs....... $(TARGET_PROGRAMS)'#010+
  1823. ' ',' @$(ECHO) Target Dirs........... $(TARGET_DIRS)'#010+
  1824. ' @$(ECHO) Target Examples....... $(TARGET_EXAMPLES)'#010+
  1825. ' @$(ECHO) Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)'#010+
  1826. ' @$(ECHO)'#010+
  1827. ' @$(ECHO) Clean Units......... $(CLEAN_U','NITS)'#010+
  1828. ' @$(ECHO) Clean Files......... $(CLEAN_FILES)'#010+
  1829. ' @$(ECHO)'#010+
  1830. ' @$(ECHO) Install Units....... $(INSTALL_UNITS)'#010+
  1831. ' @$(ECHO) Install Files....... $(INSTALL_FILES)'#010+
  1832. ' @$(ECHO)'#010+
  1833. ' @$(ECHO) == Install info ','=='#010+
  1834. ' @$(ECHO)'#010+
  1835. ' @$(ECHO) DateStr.............. $(DATESTR)'#010+
  1836. ' @$(ECHO) ZipPrefix............ $(ZIPPREFIX)'#010+
  1837. ' @$(ECHO) ZipSuffix............ $(ZIPSUFFIX)'#010+
  1838. ' @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE)'#010+
  1839. ' ',' @$(ECHO)'#010+
  1840. ' @$(ECHO) Install base dir..... $(INSTALL_BASEDIR)'#010+
  1841. ' @$(ECHO) Install binary dir... $(INSTALL_BINDIR)'#010+
  1842. ' @$(ECHO) Install library dir.. $(INSTALL_LIBDIR)'#010+
  1843. ' @$(ECHO) Install units dir.... $(INSTALL','_UNITDIR)'#010+
  1844. ' @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR)'#010+
  1845. ' @$(ECHO) Install doc dir...... $(INSTALL_DOCDIR)'#010+
  1846. ' @$(ECHO) Install example dir.. $(INSTALL_EXAMPLEDIR)'#010+
  1847. ' @$(ECHO) Install data dir..... $(INSTALL','_DATADIR)'#010+
  1848. ' @$(ECHO)'#010+
  1849. ' @$(ECHO) Dist destination dir. $(DIST_DESTDIR)'#010+
  1850. ' @$(ECHO) Dist zip name........ $(DIST_ZIPNAME)'#010+
  1851. ' @$(ECHO)'#010+
  1852. #010+
  1853. '[inforules]'#010+
  1854. '#####################################################################'#010+
  1855. '#',' Info rules'#010+
  1856. '#####################################################################'#010+
  1857. #010+
  1858. '.PHONY: fpc_info'#010+
  1859. #010+
  1860. 'fpc_info: $(INFORULES)'#010+
  1861. #010+
  1862. '[makefilerules]'#010+
  1863. '#####################################################################'#010+
  1864. '# Rebuild Makefile'#010+
  1865. '##########','##########################################################'+
  1866. '#'#010+
  1867. #010+
  1868. '.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2'+
  1869. ' \'#010+
  1870. ' fpc_makefile_dirs'#010+
  1871. #010+
  1872. 'fpc_makefile:'#010+
  1873. ' $(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc'#010+
  1874. #010+
  1875. 'fpc_makefile_s','ub1:'#010+
  1876. 'ifdef TARGET_DIRS'#010+
  1877. ' $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGE'+
  1878. 'T_DIRS))'#010+
  1879. 'endif'#010+
  1880. 'ifdef TARGET_EXAMPLEDIRS'#010+
  1881. ' $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGE'+
  1882. 'T_EXAMPLEDIRS))'#010+
  1883. 'endif'#010+
  1884. #010+
  1885. 'fpc_makefile_s','ub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGE'+
  1886. 'T_EXAMPLEDIRS))'#010+
  1887. #010+
  1888. 'fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2'#010+
  1889. #010+
  1890. 'fpc_makefiles: fpc_makefile fpc_makefile_dirs'#010+
  1891. #010+
  1892. '[localmakefile]'#010+
  1893. '##################################################','##################'+
  1894. '#'#010+
  1895. '# Local Makefile'#010+
  1896. '#####################################################################'#010+
  1897. #010+
  1898. 'ifneq ($(wildcard fpcmake.loc),)'#010+
  1899. 'include fpcmake.loc'#010+
  1900. 'endif'#010+
  1901. #010+
  1902. #010+
  1903. '[userrules]'#010+
  1904. '###########################################################','#########'+
  1905. '#'#010+
  1906. '# Users rules'#010+
  1907. '#####################################################################'#010+
  1908. #010+
  1909. '[lclrules]'#010+
  1910. '#####################################################################'#010+
  1911. '# LCL Rules'#010+
  1912. '###################################################','#################'+
  1913. '#'#010+
  1914. #010+
  1915. '# LCL Platform'#010+
  1916. 'ifndef LCL_PLATFORM'#010+
  1917. 'ifeq ($(OS_TARGET),win32)'#010+
  1918. 'LCL_PLATFORM=win32'#010+
  1919. 'else'#010+
  1920. 'LCL_PLATFORM=gtk'#010+
  1921. 'endif'#010+
  1922. 'endif'#010+
  1923. 'export LCL_PLATFORM'#010+
  1924. #010+
  1925. '# Check if the specified LCLDIR is correct'#010+
  1926. 'ifdef LCLDIR'#010+
  1927. 'override LCLDIR:=$(subst \,/,','$(LCLDIR))'#010+
  1928. 'ifeq ($(wildcard $(LCLDIR)/units/$(LCL_PLATFORM)),)'#010+
  1929. 'override LCLDIR=wrong'#010+
  1930. 'endif'#010+
  1931. 'else'#010+
  1932. 'override LCLDIR=wrong'#010+
  1933. 'endif'#010+
  1934. #010+
  1935. '# Check if the default LCLDIR is correct'#010+
  1936. 'ifdef DEFAULT_LCLDIR'#010+
  1937. 'override LCLDIR:=$(subst \,/,$(DEFAULT_LCLDIR))'#010+
  1938. 'ifeq ','($(wildcard $(LCLDIR)/units/$(LCL_PLATFORM)),)'#010+
  1939. 'override LCLDIR=wrong'#010+
  1940. 'endif'#010+
  1941. 'endif'#010+
  1942. #010+
  1943. '# Check for development version'#010+
  1944. 'ifeq ($(LCLDIR),wrong)'#010+
  1945. 'override LCLDIR=$(subst /units/$(LCL_PLATFORM),,$(firstword $(wildcard'+
  1946. ' $(addsuffix /units/$(LCL_PLATFOR','M),$(BASEDIR)/lcl $(BASEDIR)))))'#010+
  1947. 'ifeq ($(LCLDIR),)'#010+
  1948. 'override LCLDIR=wrong'#010+
  1949. 'endif'#010+
  1950. 'endif'#010+
  1951. #010+
  1952. '# Check for release version'#010+
  1953. 'ifeq ($(LCLDIR),wrong)'#010+
  1954. 'override LCLDIR=$(subst /units/$(LCL_PLATFORM),,$(firstword $(wildcard'+
  1955. ' $(addsuffix /lib/lazarus/units/$','(LCL_PLATFORM),/usr/local /usr))))'#010+
  1956. 'ifeq ($(LCLDIR),)'#010+
  1957. 'override LCLDIR=wrong'#010+
  1958. 'endif'#010+
  1959. 'endif'#010+
  1960. #010+
  1961. '# Generate dirs'#010+
  1962. 'override LCLUNITDIR:=$(wildcard $(LCLDIR)/units/$(LCL_PLATFORM) $(LCLD'+
  1963. 'IR)/units)'#010+
  1964. 'override LCLCOMPONENTDIR:=$(wildcard $(LCLDIR)/.. $(LCL','DIR)/../compo'+
  1965. 'nents $(LCLDIR)/components)'#010+
  1966. 'export LCLDIR LCLUNITDIR LCLCOMPONENTDIR'#010+
  1967. #010+
  1968. '# Add LCL dirs to paths'#010+
  1969. 'override REQUIRE_PACKAGESDIR+=$(LCLCOMPONENTDIR)'#010+
  1970. 'override COMPILER_UNITDIR+=$(LCLUNITDIR)'#010+
  1971. #010+
  1972. '[lclinforules]'#010+
  1973. '###########################','#########################################'+
  1974. '#'#010+
  1975. '# LCL Info rules'#010+
  1976. '#####################################################################'#010+
  1977. 'override INFORULES+=lclinfo'#010+
  1978. #010+
  1979. '.PHONY: lclinfo'#010+
  1980. #010+
  1981. 'lclinfo:'#010+
  1982. ' @$(ECHO) == LCL info =='#010+
  1983. ' @$(ECHO)'#010+
  1984. ' ',' @$(ECHO) Platform............. $(LCL_PLATFORM)'#010+
  1985. ' @$(ECHO) LCLDIR............... $(LCLDIR)'#010+
  1986. ' @$(ECHO) LCL Unit dir......... $(LCLUNITDIR)'#010+
  1987. ' @$(ECHO) LCL Component dir.... $(LCLCOMPONENTDIR)'#010+
  1988. ' @$(ECHO)'#010
  1989. );