fpcmake.inc 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417
  1. {$ifdef Delphi}
  2. const fpcmakeini : array[0..132] of string[240]=(
  3. {$else Delphi}
  4. const fpcmakeini : array[0..132,1..240] of char=(
  5. {$endif Delphi}
  6. ';'#013#010+
  7. '; Templates used by fpcmake to create a Makefile from Makefile.fpc'#013+
  8. #010+
  9. ';'#013#010+
  10. #013#010+
  11. '[osdetect]'#013#010+
  12. '#####################################################################'#013+
  13. #010+
  14. '# Autodetect OS (Linux or Dos or Windows NT or OS/2)'#013#010+
  15. '# define inUnix when runnin','g under Unix like environment'#013#010+
  16. '# (Linux,FreeBSD,NetBSD,Cygwin)'#013#010+
  17. '# define inWinNT when running under WinNT'#013#010+
  18. '# define inOS2 when running under OS/2'#013#010+
  19. '# define inCygwin when running under Cygwin32'#013#010+
  20. '################################','####################################'+
  21. '#'#013#010+
  22. #013#010+
  23. '# We need only / in the path also remove the current dir'#013#010+
  24. 'override PATH:=$(subst \,/,$(PATH))'#013#010+
  25. #013#010+
  26. '# Determine if we'#039've a unix searchpath using : by looking for a ;'#013+
  27. #010+
  28. '# that normally doesn'#039't exists in p','ath names.'#013#010+
  29. 'ifeq ($(findstring ;,$(PATH)),)'#013#010+
  30. 'inUnix=1'#013#010+
  31. 'SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))'#013#010+
  32. 'else'#013#010+
  33. 'SEARCHPATH:=$(subst ;, ,$(PATH))'#013#010+
  34. 'endif'#013#010+
  35. #013#010+
  36. '# Search for PWD and determine also if we are under linux'#013#010+
  37. 'PWD:=$(strip $(wildcard $(a','ddsuffix /pwd.exe,$(SEARCHPATH))))'#013#010+
  38. 'ifeq ($(PWD),)'#013#010+
  39. 'PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))'#013#010+
  40. 'ifeq ($(PWD),)'#013#010+
  41. 'nopwd:'#013#010+
  42. ' @echo You need the GNU utils package to use this Makefile!'#013+
  43. #010+
  44. ' @echo Get ftp://ftp.freepasca','l.org/pub/fpc/dist/go32v2/utilg'+
  45. 'o32.zip'#013#010+
  46. ' @exit'#013#010+
  47. 'else'#013#010+
  48. 'PWD:=$(firstword $(PWD))'#013#010+
  49. 'SRCEXEEXT='#013#010+
  50. 'endif'#013#010+
  51. 'else'#013#010+
  52. 'PWD:=$(firstword $(PWD))'#013#010+
  53. 'SRCEXEEXT=.exe'#013#010+
  54. 'endif'#013#010+
  55. #013#010+
  56. '# Detect NT - NT sets OS to Windows_NT'#013#010+
  57. '# Detect OS/2 - OS/2 has OS2_SHELL de','fined'#013#010+
  58. 'ifndef inUnix'#013#010+
  59. 'ifeq ($(OS),Windows_NT)'#013#010+
  60. 'inWinNT=1'#013#010+
  61. 'else'#013#010+
  62. 'ifdef OS2_SHELL'#013#010+
  63. 'inOS2=1'#013#010+
  64. 'endif'#013#010+
  65. 'endif'#013#010+
  66. 'else'#013#010+
  67. 'ifneq ($(findstring cygwin,$(MACHTYPE)),)'#013#010+
  68. 'inCygWin=1'#013#010+
  69. 'endif'#013#010+
  70. 'endif'#013#010+
  71. #013#010+
  72. '# The extension of batch files / scripts'#013#010+
  73. 'ifdef inUnix'#013#010+
  74. 'BAT','CHEXT=.sh'#013#010+
  75. 'else'#013#010+
  76. 'ifdef inOS2'#013#010+
  77. 'BATCHEXT=.cmd'#013#010+
  78. 'else'#013#010+
  79. 'BATCHEXT=.bat'#013#010+
  80. 'endif'#013#010+
  81. 'endif'#013#010+
  82. #013#010+
  83. '# Path Separator, the subst trick is necessary for the \ that can'#039't'+
  84. ' exists'#013#010+
  85. '# at the end of a line'#013#010+
  86. 'ifdef inUnix'#013#010+
  87. 'PATHSEP=/'#013#010+
  88. 'else'#013#010+
  89. 'PATHSEP:=$(subst /,\,/)'#013#010+
  90. 'en','dif'#013#010+
  91. #013#010+
  92. '# Base dir'#013#010+
  93. 'ifdef PWD'#013#010+
  94. 'BASEDIR:=$(subst \,/,$(shell $(PWD)))'#013#010+
  95. '# For Cygwin we need to replace /cygdrive/c/ with c:/'#013#010+
  96. 'ifdef inCygWin'#013#010+
  97. 'ifneq ($(findstring /cygdrive/,$(BASEDIR)),)'#013#010+
  98. 'BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))'#013#010+
  99. 'BASEDR','IVE:=$(firstword $(subst /, ,$(BASENODIR)))'#013#010+
  100. 'BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))'#013+
  101. #010+
  102. 'endif'#013#010+
  103. 'endif'#013#010+
  104. 'else'#013#010+
  105. 'BASEDIR=.'#013#010+
  106. 'endif'#013#010+
  107. #013#010+
  108. '[fpcdetect]'#013#010+
  109. '#####################################################################'#013+
  110. #010+
  111. '# ','FPC version/target Detection'#013#010+
  112. '#####################################################################'#013+
  113. #010+
  114. #013#010+
  115. '# What compiler to use ?'#013#010+
  116. 'ifndef FPC'#013#010+
  117. '# Compatibility with old makefiles'#013#010+
  118. 'ifdef PP'#013#010+
  119. 'FPC=$(PP)'#013#010+
  120. 'else'#013#010+
  121. 'ifdef inUnix'#013#010+
  122. 'CPU_SOURCE=$(shell una','me -m)'#013#010+
  123. 'ifeq (m68k,$(CPU_SOURCE))'#013#010+
  124. 'FPC=ppc68k'#013#010+
  125. 'else'#013#010+
  126. 'FPC=ppc386'#013#010+
  127. 'endif'#013#010+
  128. 'else'#013#010+
  129. 'FPC=ppc386'#013#010+
  130. 'endif'#013#010+
  131. 'endif'#013#010+
  132. 'endif'#013#010+
  133. 'override FPC:=$(subst $(SRCEXEEXT),,$(FPC))'#013#010+
  134. 'override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)'#013#010+
  135. #013#010+
  136. '# Target OS'#013#010+
  137. 'ifndef OS_TARGET'#013#010+
  138. 'OS_T','ARGET:=$(shell $(FPC) -iTO)'#013#010+
  139. 'endif'#013#010+
  140. #013#010+
  141. '# Source OS'#013#010+
  142. 'ifndef OS_SOURCE'#013#010+
  143. 'OS_SOURCE:=$(shell $(FPC) -iSO)'#013#010+
  144. 'endif'#013#010+
  145. #013#010+
  146. '# Target CPU'#013#010+
  147. 'ifndef CPU_TARGET'#013#010+
  148. 'CPU_TARGET:=$(shell $(FPC) -iTP)'#013#010+
  149. 'endif'#013#010+
  150. #013#010+
  151. '# Source CPU'#013#010+
  152. 'ifndef CPU_SOURCE'#013#010+
  153. 'CPU_SOURCE:=$(shell ','$(FPC) -iSP)'#013#010+
  154. 'endif'#013#010+
  155. #013#010+
  156. '# FPC version'#013#010+
  157. 'ifndef FPC_VERSION'#013#010+
  158. 'FPC_VERSION:=$(shell $(FPC) -iV)'#013#010+
  159. 'endif'#013#010+
  160. #013#010+
  161. 'export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION'#013#010+
  162. #013#010+
  163. #013#010+
  164. '[fpcdircheckenv]'#013#010+
  165. '###################################################','#################'+
  166. '#'#013#010+
  167. '# FPCDIR Setting'#013#010+
  168. '#####################################################################'#013+
  169. #010+
  170. #013#010+
  171. '# Test FPCDIR to look if the RTL dir exists'#013#010+
  172. 'ifdef FPCDIR'#013#010+
  173. 'override FPCDIR:=$(subst \,/,$(FPCDIR))'#013#010+
  174. 'ifeq ($(wildcard $(addprefix ','$(FPCDIR)/,rtl units)),)'#013#010+
  175. 'override FPCDIR=wrong'#013#010+
  176. 'endif'#013#010+
  177. 'else'#013#010+
  178. 'override FPCDIR=wrong'#013#010+
  179. 'endif'#013#010+
  180. #013#010+
  181. #013#010+
  182. '[fpcdirdetect]'#013#010+
  183. '# Detect FPCDIR'#013#010+
  184. 'ifeq ($(FPCDIR),wrong)'#013#010+
  185. 'ifdef inUnix'#013#010+
  186. 'override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)'#013#010+
  187. 'ifeq ($(wildcard $(FPC','DIR)/units),)'#013#010+
  188. 'override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)'#013#010+
  189. 'endif'#013#010+
  190. 'else'#013#010+
  191. 'override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(add'+
  192. 'suffix /$(FPC),$(SEARCHPATH))))))'#013#010+
  193. 'override FPCDIR:=$(FPCDIR)/..'#013#010+
  194. 'ifeq ($(wildcard $(addprefix $(','FPCDIR)/,rtl units)),)'#013#010+
  195. 'override FPCDIR:=$(FPCDIR)/..'#013#010+
  196. 'ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)'#013#010+
  197. 'override FPCDIR=c:/pp'#013#010+
  198. 'endif'#013#010+
  199. 'endif'#013#010+
  200. 'endif'#013#010+
  201. 'endif'#013#010+
  202. #013#010+
  203. '# Units dir'#013#010+
  204. 'UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))'#013#010+
  205. #013#010+
  206. '# Packages',' dir'#013#010+
  207. 'PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages)'#013#010+
  208. #013#010+
  209. #013#010+
  210. '[shelltools]'#013#010+
  211. '#####################################################################'#013+
  212. #010+
  213. '# Shell tools'#013#010+
  214. '#####################################################################'#013+
  215. #010+
  216. #013#010+
  217. '# ','Echo that can redir (must be able run in the default OS shell)'#013+
  218. #010+
  219. 'ifndef ECHOREDIR'#013#010+
  220. 'ECHOREDIR:=$(subst /,$(PATHSEP),$(ECHO))'#013#010+
  221. 'endif'#013#010+
  222. #013#010+
  223. '# To copy pograms'#013#010+
  224. 'ifndef COPY'#013#010+
  225. 'COPY:=$(CPPROG) -fp'#013#010+
  226. 'endif'#013#010+
  227. #013#010+
  228. '# Copy a whole tree'#013#010+
  229. 'ifndef COPYTREE'#013#010+
  230. 'COPYTRE','E:=$(CPPROG) -rfp'#013#010+
  231. 'endif'#013#010+
  232. #013#010+
  233. '# To move pograms'#013#010+
  234. 'ifndef MOVE'#013#010+
  235. 'MOVE:=$(MVPROG) -f'#013#010+
  236. 'endif'#013#010+
  237. #013#010+
  238. '# Check delete program'#013#010+
  239. 'ifndef DEL'#013#010+
  240. 'DEL:=$(RMPROG) -f'#013#010+
  241. 'endif'#013#010+
  242. #013#010+
  243. '# Check deltree program'#013#010+
  244. 'ifndef DELTREE'#013#010+
  245. 'DELTREE:=$(RMPROG) -rf'#013#010+
  246. 'endif'#013#010+
  247. #013#010+
  248. '# To install ','files'#013#010+
  249. 'ifndef INSTALL'#013#010+
  250. 'ifdef inUnix'#013#010+
  251. 'INSTALL:=$(GINSTALL) -c -m 644'#013#010+
  252. 'else'#013#010+
  253. 'INSTALL:=$(COPY)'#013#010+
  254. 'endif'#013#010+
  255. 'endif'#013#010+
  256. #013#010+
  257. '# To install programs'#013#010+
  258. 'ifndef INSTALLEXE'#013#010+
  259. 'ifdef inUnix'#013#010+
  260. 'INSTALLEXE:=$(GINSTALL) -c -m 755'#013#010+
  261. 'else'#013#010+
  262. 'INSTALLEXE:=$(COPY)'#013#010+
  263. 'endif'#013#010+
  264. 'endif'#013,#010+
  265. #013#010+
  266. '# To make a directory.'#013#010+
  267. 'ifndef MKDIR'#013#010+
  268. 'MKDIR:=$(GINSTALL) -m 755 -d'#013#010+
  269. 'endif'#013#010+
  270. #013#010+
  271. 'export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKD'+
  272. 'IR'#013#010+
  273. #013#010+
  274. #013#010+
  275. '[defaulttools]'#013#010+
  276. '##################################################################','##'+
  277. '#'#013#010+
  278. '# Default Tools'#013#010+
  279. '#####################################################################'#013+
  280. #010+
  281. #013#010+
  282. '# assembler, redefine it if cross compiling'#013#010+
  283. 'ifndef AS'#013#010+
  284. 'AS=as'#013#010+
  285. 'endif'#013#010+
  286. #013#010+
  287. '# linker, but probably not used'#013#010+
  288. 'ifndef LD'#013#010+
  289. 'LD=ld'#013#010+
  290. 'endif'#013#010+
  291. #013#010+
  292. '# Resource co','mpiler'#013#010+
  293. 'ifndef RC'#013#010+
  294. 'RC=rc'#013#010+
  295. 'endif'#013#010+
  296. #013#010+
  297. '# ppas.bat / ppas.sh'#013#010+
  298. 'PPAS=ppas$(BATCHEXT)'#013#010+
  299. #013#010+
  300. '# ldconfig to rebuild .so cache'#013#010+
  301. 'ifdef inUnix'#013#010+
  302. 'LDCONFIG=ldconfig'#013#010+
  303. 'else'#013#010+
  304. 'LDCONFIG='#013#010+
  305. 'endif'#013#010+
  306. #013#010+
  307. 'ifdef DATE'#013#010+
  308. 'DATESTR:=$(shell $(DATE) +%Y%m%d)'#013#010+
  309. 'else'#013#010+
  310. 'DATESTR='#013#010+
  311. 'endi','f'#013#010+
  312. #013#010+
  313. '# Look if UPX is found for go32v2 and win32. We can'#039't use $UPX bec'+
  314. 'uase'#013#010+
  315. '# upx uses that one itself (PFV)'#013#010+
  316. 'ifndef UPXPROG'#013#010+
  317. 'ifeq ($(OS_TARGET),go32v2)'#013#010+
  318. 'UPXPROG:=1'#013#010+
  319. 'endif'#013#010+
  320. 'ifeq ($(OS_TARGET),win32)'#013#010+
  321. 'UPXPROG:=1'#013#010+
  322. 'endif'#013#010+
  323. 'ifdef UPXPROG'#013#010+
  324. 'UPXPR','OG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPAT'+
  325. 'H))))'#013#010+
  326. 'ifeq ($(UPXPROG),)'#013#010+
  327. 'UPXPROG='#013#010+
  328. 'else'#013#010+
  329. 'UPXPROG:=$(firstword $(UPXPROG))'#013#010+
  330. 'endif'#013#010+
  331. 'else'#013#010+
  332. 'UPXPROG='#013#010+
  333. 'endif'#013#010+
  334. 'endif'#013#010+
  335. 'export UPXPROG'#013#010+
  336. #013#010+
  337. '# Zip options'#013#010+
  338. 'ZIPOPT=-9'#013#010+
  339. 'ZIPEXT=.zip'#013#010+
  340. #013#010+
  341. '# Ta','r options'#013#010+
  342. 'ifeq ($(USETAR),bz2)'#013#010+
  343. 'TAROPT=vI'#013#010+
  344. 'TAREXT=.tar.bz2'#013#010+
  345. 'else'#013#010+
  346. 'TAROPT=vz'#013#010+
  347. 'TAREXT=.tar.gz'#013#010+
  348. 'endif'#013#010+
  349. #013#010+
  350. #013#010+
  351. '[extensions]'#013#010+
  352. '#####################################################################'#013+
  353. #010+
  354. '# Default extensions'#013#010+
  355. '############################','########################################'+
  356. '#'#013#010+
  357. #013#010+
  358. '# Default needed extensions (Go32v2,Linux)'#013#010+
  359. 'LOADEREXT=.as'#013#010+
  360. 'EXEEXT=.exe'#013#010+
  361. 'PPLEXT=.ppl'#013#010+
  362. 'PPUEXT=.ppu'#013#010+
  363. 'OEXT=.o'#013#010+
  364. 'ASMEXT=.s'#013#010+
  365. 'SMARTEXT=.sl'#013#010+
  366. 'STATICLIBEXT=.a'#013#010+
  367. 'SHAREDLIBEXT=.so'#013#010+
  368. 'STATICLIBPREFIX=libp'#013#010+
  369. 'RSTEXT','=.rst'#013#010+
  370. 'FPCMADE=fpcmade'#013#010+
  371. #013#010+
  372. #013#010+
  373. '# Go32v1'#013#010+
  374. 'ifeq ($(OS_TARGET),go32v1)'#013#010+
  375. 'PPUEXT=.pp1'#013#010+
  376. 'OEXT=.o1'#013#010+
  377. 'ASMEXT=.s1'#013#010+
  378. 'SMARTEXT=.sl1'#013#010+
  379. 'STATICLIBEXT=.a1'#013#010+
  380. 'SHAREDLIBEXT=.so1'#013#010+
  381. 'STATICLIBPREFIX='#013#010+
  382. 'FPCMADE=fpcmade.v1'#013#010+
  383. 'PACKAGESUFFIX=v1'#013#010+
  384. 'endif'#013#010+
  385. #013#010+
  386. '# Go32v2'#013#010+
  387. 'ifeq ($(OS_T','ARGET),go32v2)'#013#010+
  388. 'STATICLIBPREFIX='#013#010+
  389. 'FPCMADE=fpcmade.dos'#013#010+
  390. 'ZIPSUFFIX=go32'#013#010+
  391. 'endif'#013#010+
  392. #013#010+
  393. '# Linux'#013#010+
  394. 'ifeq ($(OS_TARGET),linux)'#013#010+
  395. 'EXEEXT='#013#010+
  396. 'HASSHAREDLIB=1'#013#010+
  397. 'FPCMADE=fpcmade.lnx'#013#010+
  398. 'ZIPSUFFIX=linux'#013#010+
  399. 'endif'#013#010+
  400. #013#010+
  401. '# FreeBSD'#013#010+
  402. 'ifeq ($(OS_TARGET),freebsd)'#013#010+
  403. 'EXEEXT='#013#010+
  404. 'HAS','SHAREDLIB=1'#013#010+
  405. 'FPCMADE=fpcmade.freebsd'#013#010+
  406. 'ZIPSUFFIX=freebsd'#013#010+
  407. 'endif'#013#010+
  408. #013#010+
  409. '# NetBSD'#013#010+
  410. 'ifeq ($(OS_TARGET),netbsd)'#013#010+
  411. 'EXEEXT='#013#010+
  412. 'HASSHAREDLIB=1'#013#010+
  413. 'FPCMADE=fpcmade.netbsd'#013#010+
  414. 'ZIPSUFFIX=netbsd'#013#010+
  415. 'endif'#013#010+
  416. #013#010+
  417. '# Win32'#013#010+
  418. 'ifeq ($(OS_TARGET),win32)'#013#010+
  419. 'PPUEXT=.ppw'#013#010+
  420. 'OEXT=.ow'#013#010+
  421. 'A','SMEXT=.sw'#013#010+
  422. 'SMARTEXT=.slw'#013#010+
  423. 'STATICLIBEXT=.aw'#013#010+
  424. 'SHAREDLIBEXT=.dll'#013#010+
  425. 'FPCMADE=fpcmade.w32'#013#010+
  426. 'ZIPSUFFIX=w32'#013#010+
  427. 'endif'#013#010+
  428. #013#010+
  429. '# OS/2'#013#010+
  430. 'ifeq ($(OS_TARGET),os2)'#013#010+
  431. 'PPUEXT=.ppo'#013#010+
  432. 'ASMEXT=.so2'#013#010+
  433. 'OEXT=.oo2'#013#010+
  434. 'AOUTEXT=.out'#013#010+
  435. 'SMARTEXT=.so'#013#010+
  436. 'STATICLIBEXT=.ao2'#013#010+
  437. 'SHAREDLIBEXT=.d','ll'#013#010+
  438. 'FPCMADE=fpcmade.os2'#013#010+
  439. 'ZIPSUFFIX=emx'#013#010+
  440. 'endif'#013#010+
  441. #013#010+
  442. '# Amiga'#013#010+
  443. 'ifeq ($(OS_TARGET),amiga)'#013#010+
  444. 'EXEEXT='#013#010+
  445. 'PPUEXT=.ppa'#013#010+
  446. 'ASMEXT=.asm'#013#010+
  447. 'OEXT=.o'#013#010+
  448. 'SMARTEXT=.sl'#013#010+
  449. 'STATICLIBEXT=.a'#013#010+
  450. 'SHAREDLIBEXT=.library'#013#010+
  451. 'FPCMADE=fpcmade.amg'#013#010+
  452. 'endif'#013#010+
  453. #013#010+
  454. '# Atari'#013#010+
  455. 'ifeq ($(OS_TARGET)',',atari)'#013#010+
  456. 'PPUEXT=.ppt'#013#010+
  457. 'ASMEXT=.s'#013#010+
  458. 'OEXT=.o'#013#010+
  459. 'SMARTEXT=.sl'#013#010+
  460. 'STATICLIBEXT=.a'#013#010+
  461. 'EXEEXT=.ttp'#013#010+
  462. 'FPCMADE=fpcmade.ata'#013#010+
  463. 'endif'#013#010+
  464. #013#010+
  465. '[defaultdirs]'#013#010+
  466. '#####################################################################'#013+
  467. #010+
  468. '# Default Directories'#013#010+
  469. '###############','#####################################################'+
  470. '#'#013#010+
  471. #013#010+
  472. '# Units dir'#013#010+
  473. 'ifdef REQUIRE_UNITSDIR'#013#010+
  474. 'override UNITSDIR+=$(REQUIRE_UNITSDIR)'#013#010+
  475. 'endif'#013#010+
  476. #013#010+
  477. '# Units dir'#013#010+
  478. 'ifdef REQUIRE_PACKAGESDIR'#013#010+
  479. 'override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)'#013#010+
  480. 'endif'#013#010+
  481. #013#010+
  482. #013,#010+
  483. '# Linux, netbsd and freebsd use unix dirs with /usr/bin, /usr/lib'#013#010+
  484. '# When zipping use the target as default, when normal install then'#013+
  485. #010+
  486. '# use the source os as default'#013#010+
  487. 'ifdef ZIPINSTALL'#013#010+
  488. '# Zipinstall'#013#010+
  489. 'ifeq ($(OS_TARGET),linux)'#013#010+
  490. 'UNIXINSTALLDI','R=1'#013#010+
  491. 'endif'#013#010+
  492. 'ifeq ($(OS_TARGET),freebsd)'#013#010+
  493. 'UNIXINSTALLDIR=1'#013#010+
  494. 'endif'#013#010+
  495. 'ifeq ($(OS_TARGET),netbsd)'#013#010+
  496. 'UNIXINSTALLDIR=1'#013#010+
  497. 'endif'#013#010+
  498. 'else'#013#010+
  499. '# Normal install'#013#010+
  500. 'ifeq ($(OS_SOURCE),linux)'#013#010+
  501. 'UNIXINSTALLDIR=1'#013#010+
  502. 'endif'#013#010+
  503. 'ifeq ($(OS_SOURCE),freebsd)'#013#010+
  504. 'UNIXINSTALLDIR=1',#013#010+
  505. 'endif'#013#010+
  506. 'ifeq ($(OS_SOURCE),netbsd)'#013#010+
  507. 'UNIXINSTALLDIR=1'#013#010+
  508. 'endif'#013#010+
  509. 'endif'#013#010+
  510. #013#010+
  511. '# set the prefix directory where to install everything'#013#010+
  512. 'ifndef INSTALL_PREFIX'#013#010+
  513. 'ifdef UNIXINSTALLDIR'#013#010+
  514. 'INSTALL_PREFIX=/usr/local'#013#010+
  515. 'else'#013#010+
  516. 'ifdef INSTALL_FPCPACKAGE'#013#010+
  517. 'INSTALL_B','ASEDIR:=/pp'#013#010+
  518. 'else'#013#010+
  519. 'INSTALL_BASEDIR:=/$(PACKAGE_NAME)'#013#010+
  520. 'endif'#013#010+
  521. 'endif'#013#010+
  522. 'endif'#013#010+
  523. 'export INSTALL_PREFIX'#013#010+
  524. #013#010+
  525. '# Where to place the resulting zip files'#013#010+
  526. 'ifndef DIST_DESTDIR'#013#010+
  527. 'DIST_DESTDIR:=$(BASEDIR)'#013#010+
  528. 'endif'#013#010+
  529. 'export DIST_DESTDIR'#013#010+
  530. #013#010+
  531. #013#010+
  532. '###################','#################################################'+
  533. '#'#013#010+
  534. '# Install Directories'#013#010+
  535. '#####################################################################'#013+
  536. #010+
  537. #013#010+
  538. '# set the base directory where to install everything'#013#010+
  539. 'ifndef INSTALL_BASEDIR'#013#010+
  540. 'ifdef UNIXINST','ALLDIR'#013#010+
  541. 'ifdef INSTALL_FPCPACKAGE'#013#010+
  542. 'INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)'#013#010+
  543. 'else'#013#010+
  544. 'INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)'#013#010+
  545. 'endif'#013#010+
  546. 'else'#013#010+
  547. 'INSTALL_BASEDIR:=$(INSTALL_PREFIX)'#013#010+
  548. 'endif'#013#010+
  549. 'endif'#013#010+
  550. #013#010+
  551. '# set the directory ','where to install the binaries'#013#010+
  552. 'ifndef INSTALL_BINDIR'#013#010+
  553. 'ifdef UNIXINSTALLDIR'#013#010+
  554. 'INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin'#013#010+
  555. 'else'#013#010+
  556. 'INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin'#013#010+
  557. '# for FPC packages install the binaries under their os target subdir'#013+
  558. #010+
  559. 'ifdef INS','TALL_FPCPACKAGE'#013#010+
  560. 'INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)'#013#010+
  561. 'endif'#013#010+
  562. 'endif'#013#010+
  563. 'endif'#013#010+
  564. #013#010+
  565. '# set the directory where to install the units.'#013#010+
  566. 'ifndef INSTALL_UNITDIR'#013#010+
  567. 'INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(OS_TARGET)'#013#010+
  568. 'ifdef INSTALL_FPCPACKAG','E'#013#010+
  569. 'ifdef PACKAGE_NAME'#013#010+
  570. 'INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)'#013#010+
  571. 'endif'#013#010+
  572. 'endif'#013#010+
  573. 'endif'#013#010+
  574. #013#010+
  575. '# Where to install shared libraries'#013#010+
  576. 'ifndef INSTALL_LIBDIR'#013#010+
  577. 'ifdef UNIXINSTALLDIR'#013#010+
  578. 'INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib'#013#010+
  579. 'else'#013#010+
  580. 'INSTALL_LIBDIR',':=$(INSTALL_UNITDIR)'#013#010+
  581. 'endif'#013#010+
  582. 'endif'#013#010+
  583. #013#010+
  584. '# Where the source files will be stored'#013#010+
  585. 'ifndef INSTALL_SOURCEDIR'#013#010+
  586. 'ifdef UNIXINSTALLDIR'#013#010+
  587. 'ifdef INSTALL_FPCPACKAGE'#013#010+
  588. 'INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/fpc-$(FPC_VERSION)/$(PACKAGE_'+
  589. 'NAME)'#013#010+
  590. 'else'#013#010+
  591. 'INST','ALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/$(PACKAGE_NAME)-$(PACKAGE_V'+
  592. 'ERSION)'#013#010+
  593. 'endif'#013#010+
  594. 'else'#013#010+
  595. 'ifdef INSTALL_FPCPACKAGE'#013#010+
  596. 'INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)'#013#010+
  597. 'else'#013#010+
  598. 'INSTALL_SOURCEDIRL:=$(INSTALL_BASEDIR)/source'#013#010+
  599. 'endif'#013#010+
  600. 'endif'#013,#010+
  601. 'endif'#013#010+
  602. #013#010+
  603. '# Where the doc files will be stored'#013#010+
  604. 'ifndef INSTALL_DOCDIR'#013#010+
  605. 'ifdef UNIXINSTALLDIR'#013#010+
  606. 'ifdef INSTALL_FPCPACKAGE'#013#010+
  607. 'INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/$(PACKAGE_NAM'+
  608. 'E)'#013#010+
  609. 'else'#013#010+
  610. 'INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/$(P','ACKAGE_NAME)-$(PACKAGE_VERS'+
  611. 'ION)'#013#010+
  612. 'endif'#013#010+
  613. 'else'#013#010+
  614. 'ifdef INSTALL_FPCPACKAGE'#013#010+
  615. 'INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)'#013#010+
  616. 'else'#013#010+
  617. 'INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc'#013#010+
  618. 'endif'#013#010+
  619. 'endif'#013#010+
  620. 'endif'#013#010+
  621. #013#010+
  622. '# Where to install the examples, under linu','x we use the doc dir'#013#010+
  623. '# because the copytree command will create a subdir itself'#013#010+
  624. 'ifndef INSTALL_EXAMPLEDIR'#013#010+
  625. 'ifdef UNIXINSTALLDIR'#013#010+
  626. 'ifdef INSTALL_FPCPACKAGE'#013#010+
  627. 'INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/'+
  628. '$(PACKAGE_NAM','E)'#013#010+
  629. 'else'#013#010+
  630. 'INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VE'+
  631. 'RSION)'#013#010+
  632. 'endif'#013#010+
  633. 'else'#013#010+
  634. 'ifdef INSTALL_FPCPACKAGE'#013#010+
  635. 'INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)'#013#010+
  636. 'else'#013#010+
  637. 'INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/exa','mples'#013#010+
  638. 'endif'#013#010+
  639. 'endif'#013#010+
  640. 'endif'#013#010+
  641. #013#010+
  642. '# Where the some extra (data)files will be stored'#013#010+
  643. 'ifndef INSTALL_DATADIR'#013#010+
  644. 'INSTALL_DATADIR=$(INSTALL_BASEDIR)'#013#010+
  645. 'endif'#013#010+
  646. #013#010+
  647. #013#010+
  648. '[dirlibc]'#013#010+
  649. '# On linux, try to find where libgcc.a is.'#013#010+
  650. 'ifdef inUnix'#013#010+
  651. 'ifndef GCCLIBDIR'#013#010+
  652. 'G','CCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '#039'{ pri'+
  653. 'nt $$4 } '#039'`)'#013#010+
  654. 'endif'#013#010+
  655. 'ifndef OTHERLIBDIR'#013#010+
  656. 'OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '#039'{ ORS=" '+
  657. '"; print $1 }'#039')'#013#010+
  658. 'endif'#013#010+
  659. 'export GCCLIBDIR OTHERLIB'#013#010+
  660. 'endif'#013#010+
  661. #013#010+
  662. #013#010+
  663. '[command','_begin]'#013#010+
  664. '#####################################################################'#013+
  665. #010+
  666. '# Compiler Command Line'#013#010+
  667. '#####################################################################'#013+
  668. #010+
  669. #013#010+
  670. '# Load commandline OPTDEF and add FPC_CPU define'#013#010+
  671. 'override FPC','OPTDEF=$(CPU_TARGET)'#013#010+
  672. #013#010+
  673. '# Load commandline OPT and add target and unit dir to be sure'#013#010+
  674. 'ifneq ($(OS_TARGET),$(OS_SOURCE))'#013#010+
  675. 'override FPCOPT+=-T$(OS_TARGET)'#013#010+
  676. 'endif'#013#010+
  677. #013#010+
  678. '# User dirs should be first, so they are looked at first'#013#010+
  679. 'ifdef UNITDIR'#013#010+
  680. 'ove','rride FPCOPT+=$(addprefix -Fu,$(UNITDIR))'#013#010+
  681. 'endif'#013#010+
  682. 'ifdef LIBDIR'#013#010+
  683. 'override FPCOPT+=$(addprefix -Fl,$(LIBDIR))'#013#010+
  684. 'endif'#013#010+
  685. 'ifdef OBJDIR'#013#010+
  686. 'override FPCOPT+=$(addprefix -Fo,$(OBJDIR))'#013#010+
  687. 'endif'#013#010+
  688. 'ifdef INCDIR'#013#010+
  689. 'override FPCOPT+=$(addprefix -Fi,$(INCDIR))'#013,#010+
  690. 'endif'#013#010+
  691. #013#010+
  692. '# Smartlinking'#013#010+
  693. 'ifdef LINKSMART'#013#010+
  694. 'override FPCOPT+=-XX'#013#010+
  695. 'endif'#013#010+
  696. #013#010+
  697. '# Smartlinking creation'#013#010+
  698. 'ifdef CREATESMART'#013#010+
  699. 'override FPCOPT+=-CX'#013#010+
  700. 'endif'#013#010+
  701. #013#010+
  702. '# Debug'#013#010+
  703. 'ifdef DEBUG'#013#010+
  704. 'override FPCOPT+=-gl'#013#010+
  705. 'override FPCOPTDEF+=DEBUG'#013#010+
  706. 'endif'#013#010+
  707. #013#010+
  708. '# Release m','ode (strip, optimize and don'#039't load ppc386.cfg)'#013#010+
  709. 'ifdef RELEASE'#013#010+
  710. 'ifeq (CPU_TARGET,i386)'#013#010+
  711. 'FPCCPUOPT:=-OG2p3'#013#010+
  712. 'else'#013#010+
  713. 'FPCCPUOPT:='#013#010+
  714. 'endif'#013#010+
  715. 'override FPCOPT+=-Xs $(FPCCPUOPT) -n'#013#010+
  716. 'override FPCOPTDEF+=RELEASE'#013#010+
  717. 'endif'#013#010+
  718. #013#010+
  719. '# Strip'#013#010+
  720. 'ifdef STRIP'#013#010+
  721. 'override ','FPCOPT+=-Xs'#013#010+
  722. 'endif'#013#010+
  723. #013#010+
  724. '# Optimizer'#013#010+
  725. 'ifdef OPTIMIZE'#013#010+
  726. 'override FPCOPT+=-OG2p3'#013#010+
  727. 'endif'#013#010+
  728. #013#010+
  729. '# Verbose settings (warning,note,info)'#013#010+
  730. 'ifdef VERBOSE'#013#010+
  731. 'override FPCOPT+=-vwni'#013#010+
  732. 'endif'#013#010+
  733. #013#010+
  734. '# Needed compiler options'#013#010+
  735. 'ifdef COMPILER_OPTIONS'#013#010+
  736. 'override FPCOPT+','=$(COMPILER_OPTIONS)'#013#010+
  737. 'endif'#013#010+
  738. 'ifdef COMPILER_UNITDIR'#013#010+
  739. 'override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))'#013#010+
  740. 'endif'#013#010+
  741. 'ifdef COMPILER_LIBRARYDIR'#013#010+
  742. 'override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))'#013#010+
  743. 'endif'#013#010+
  744. 'ifdef COMPILER_OBJECTDIR'#013#010+
  745. 'overrid','e FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))'#013#010+
  746. 'endif'#013#010+
  747. 'ifdef COMPILER_INCLUDEDIR'#013#010+
  748. 'override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))'#013#010+
  749. 'endif'#013#010+
  750. #013#010+
  751. '# Target dirs and the prefix to use for clean/install'#013#010+
  752. 'ifdef COMPILER_TARGETDIR'#013#010+
  753. 'override',' FPCOPT+=-FE$(COMPILER_TARGETDIR)'#013#010+
  754. 'ifeq ($(COMPILER_TARGETDIR),.)'#013#010+
  755. 'override TARGETDIRPREFIX='#013#010+
  756. 'else'#013#010+
  757. 'override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/'#013#010+
  758. 'endif'#013#010+
  759. 'endif'#013#010+
  760. #013#010+
  761. '# Unit target dir'#013#010+
  762. 'ifdef COMPILER_UNITTARGETDIR'#013#010+
  763. 'override FPCOPT+=-FU$(COMP','ILER_UNITTARGETDIR)'#013#010+
  764. 'ifeq ($(COMPILER_UNITTARGETDIR),.)'#013#010+
  765. 'override UNITTARGETDIRPREFIX='#013#010+
  766. 'else'#013#010+
  767. 'override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/'#013#010+
  768. 'endif'#013#010+
  769. 'else'#013#010+
  770. 'ifdef COMPILER_TARGETDIR'#013#010+
  771. 'override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETD','IR)'#013#010+
  772. 'override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)'#013#010+
  773. 'endif'#013#010+
  774. 'endif'#013#010+
  775. #013#010+
  776. '[command_libc]'#013#010+
  777. '# Add GCC lib path if asked'#013#010+
  778. 'ifdef GCCLIBDIR'#013#010+
  779. 'override FPCOPT+=-Fl$(GCCLIBDIR)'#013#010+
  780. 'endif'#013#010+
  781. 'ifdef OTHERLIBDIR'#013#010+
  782. 'override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))',#013#010+
  783. 'endif'#013#010+
  784. #013#010+
  785. #013#010+
  786. '[command_end]'#013#010+
  787. '# Add commandline options last so they can override'#013#010+
  788. 'ifdef OPT'#013#010+
  789. 'override FPCOPT+=$(OPT)'#013#010+
  790. 'endif'#013#010+
  791. #013#010+
  792. '# Add defines from FPCOPTDEF to FPCOPT'#013#010+
  793. 'ifdef FPCOPTDEF'#013#010+
  794. 'override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))'#013#010+
  795. 'endif'#013#010+
  796. #013#010+
  797. '#',' Was a config file specified ?'#013#010+
  798. 'ifdef CFGFILE'#013#010+
  799. 'override FPCOPT+=@$(CFGFILE)'#013#010+
  800. 'endif'#013#010+
  801. #013#010+
  802. '# Use the environment to pass commandline options?'#013#010+
  803. 'ifdef USEENV'#013#010+
  804. 'override FPCEXTCMD:=$(FPCOPT)'#013#010+
  805. 'override FPCOPT:=!FPCEXTCMD'#013#010+
  806. 'export FPCEXTCMD'#013#010+
  807. 'endif'#013#010+
  808. #013#010+
  809. '#',' Compiler commandline'#013#010+
  810. 'override COMPILER:=$(FPC) $(FPCOPT)'#013#010+
  811. #013#010+
  812. '# also call ppas if with command option -s'#013#010+
  813. '# but only if the OS_SOURCE and OS_TARGET are equal'#013#010+
  814. 'ifeq (,$(findstring -s ,$(COMPILER)))'#013#010+
  815. 'EXECPPAS='#013#010+
  816. 'else'#013#010+
  817. 'ifeq ($(OS_SOURCE),$(OS_T','ARGET))'#013#010+
  818. 'EXECPPAS:=@$(PPAS)'#013#010+
  819. 'endif'#013#010+
  820. 'endif'#013#010+
  821. #013#010+
  822. #013#010+
  823. '[loaderrules]'#013#010+
  824. '#####################################################################'#013+
  825. #010+
  826. '# Loaders'#013#010+
  827. '#####################################################################'#013+
  828. #010+
  829. #013#010+
  830. '.PHONY: fpc_loaders'#013#010+
  831. #013#010,
  832. 'ifdef TARGET_LOADERS'#013#010+
  833. 'override ALLTARGET+=fpc_loaders'#013#010+
  834. 'override CLEANTARGET+=fpc_loaders_clean'#013#010+
  835. 'override INSTALLTARGET+=fpc_loaders_install'#013#010+
  836. #013#010+
  837. 'override LOADEROFILES:=$(addsuffix $(OEXT),$(TARGET_LOADERS))'#013#010+
  838. 'endif'#013#010+
  839. #013#010+
  840. '%$(OEXT): %$(LOADEREXT)'#013#010,
  841. ' $(AS) -o $*$(OEXT) $<'#013#010+
  842. #013#010+
  843. 'fpc_loaders: $(LOADEROFILES)'#013#010+
  844. #013#010+
  845. 'fpc_loaders_clean:'#013#010+
  846. ' -$(DEL) $(LOADEROFILES)'#013#010+
  847. #013#010+
  848. 'fpc_loaders_install:'#013#010+
  849. ' $(MKDIR) $(INSTALL_UNITDIR)'#013#010+
  850. ' $(INSTALL) $(LOADEROFILES) $(INSTALL_UNITDIR)'#013#010+
  851. #013#010+
  852. #013#010+
  853. '[u','nitrules]'#013#010+
  854. '#####################################################################'#013+
  855. #010+
  856. '# Units'#013#010+
  857. '#####################################################################'#013+
  858. #010+
  859. #013#010+
  860. '.PHONY: fpc_units'#013#010+
  861. #013#010+
  862. 'ifdef TARGET_UNITS'#013#010+
  863. 'override ALLTARGET+=fpc_units'#013#010+
  864. #013#010+
  865. 'ov','erride UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))'#013#010+
  866. 'override INSTALLPPUFILES+=$(UNITPPUFILES)'#013#010+
  867. 'override CLEANPPUFILES+=$(UNITPPUFILES)'#013#010+
  868. 'endif'#013#010+
  869. #013#010+
  870. 'fpc_units: $(UNITPPUFILES)'#013#010+
  871. #013#010+
  872. #013#010+
  873. '[exerules]'#013#010+
  874. '###########################################','#########################'+
  875. '#'#013#010+
  876. '# Exes'#013#010+
  877. '#####################################################################'#013+
  878. #010+
  879. #013#010+
  880. '.PHONY: fpc_exes'#013#010+
  881. #013#010+
  882. 'ifdef TARGET_PROGRAMS'#013#010+
  883. 'override EXEFILES=$(addsuffix $(EXEEXT),$(TARGET_PROGRAMS))'#013#010+
  884. 'override EXEOFILES:=$(addsu','ffix $(OEXT),$(TARGET_PROGRAMS)) $(addpre'+
  885. 'fix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS))'+
  886. ')'#013#010+
  887. #013#010+
  888. 'override ALLTARGET+=fpc_exes'#013#010+
  889. 'override INSTALLEXEFILES+=$(EXEFILES)'#013#010+
  890. 'override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)'#013#010+
  891. 'ifeq ','($(OS_TARGET),os2)'#013#010+
  892. 'override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))'#013+
  893. #010+
  894. 'endif'#013#010+
  895. 'endif'#013#010+
  896. #013#010+
  897. 'fpc_exes: $(EXEFILES)'#013#010+
  898. #013#010+
  899. #013#010+
  900. '[rstrules]'#013#010+
  901. '#####################################################################'#013+
  902. #010+
  903. '# Resource strings'#013#010+
  904. '######','##############################################################'+
  905. '#'#013#010+
  906. #013#010+
  907. 'ifdef TARGET_RSTS'#013#010+
  908. 'override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))'#013#010+
  909. #013#010+
  910. 'override CLEANRSTFILES+=$(RSTFILES)'#013#010+
  911. 'endif'#013#010+
  912. #013#010+
  913. #013#010+
  914. '[examplerules]'#013#010+
  915. '###############################','#####################################'+
  916. '#'#013#010+
  917. '# Examples'#013#010+
  918. '#####################################################################'#013+
  919. #010+
  920. #013#010+
  921. '.PHONY: fpc_examples'#013#010+
  922. #013#010+
  923. 'ifdef TARGET_EXAMPLES'#013#010+
  924. 'HASEXAMPLES=1'#013#010+
  925. 'override EXAMPLESOURCEFILES:=$(wildcard $(addsuffix .','pp,$(TARGET_EXA'+
  926. 'MPLES)) $(addsuffix .pas,$(TARGET_EXAMPLES)))'#013#010+
  927. 'override EXAMPLEFILES:=$(addsuffix $(EXEEXT),$(TARGET_EXAMPLES))'#013#010+
  928. 'override EXAMPLEOFILES:=$(addsuffix $(OEXT),$(TARGET_EXAMPLES)) $(addp'+
  929. 'refix $(STATICLIBPREFIX),$(addsuffix $(STA','TICLIBEXT),$(TARGET_EXAMPL'+
  930. 'ES)))'#013#010+
  931. #013#010+
  932. 'override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)'#013#010+
  933. 'ifeq ($(OS_TARGET),os2)'#013#010+
  934. 'override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_EXAMPLES))'#013+
  935. #010+
  936. 'endif'#013#010+
  937. 'endif'#013#010+
  938. 'ifdef TARGET_EXAMPLEDIRS'#013#010+
  939. 'HASEXAMPLES=1'#013,#010+
  940. 'endif'#013#010+
  941. #013#010+
  942. 'fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIR'+
  943. 'S))'#013#010+
  944. #013#010+
  945. #013#010+
  946. '[compilerules]'#013#010+
  947. '#####################################################################'#013+
  948. #010+
  949. '# General compile rules'#013#010+
  950. '#######################################','#############################'+
  951. '#'#013#010+
  952. #013#010+
  953. '.PHONY: fpc_packages fpc_all fpc_smart fpc_debug'#013#010+
  954. #013#010+
  955. '$(FPCMADE): $(ALLTARGET)'#013#010+
  956. ' @$(ECHOREDIR) Compiled > $(FPCMADE)'#013#010+
  957. #013#010+
  958. 'fpc_packages: $(COMPILEPACKAGES)'#013#010+
  959. #013#010+
  960. 'fpc_all: fpc_packages $(FPCMADE)'#013#010+
  961. #013#010+
  962. 'fpc_smart',':'#013#010+
  963. ' $(MAKE) all LINKSMART=1 CREATESMART=1'#013#010+
  964. #013#010+
  965. 'fpc_debug:'#013#010+
  966. ' $(MAKE) all DEBUG=1'#013#010+
  967. #013#010+
  968. '# General compile rules, available for both possible .pp and .pas exte'+
  969. 'nsions'#013#010+
  970. #013#010+
  971. '.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp'#013#010+
  972. #013#010+
  973. '%$(PPUEXT): %.','pp'#013#010+
  974. ' $(COMPILER) $<'#013#010+
  975. ' $(EXECPPAS)'#013#010+
  976. #013#010+
  977. '%$(PPUEXT): %.pas'#013#010+
  978. ' $(COMPILER) $<'#013#010+
  979. ' $(EXECPPAS)'#013#010+
  980. #013#010+
  981. '%$(EXEEXT): %.pp'#013#010+
  982. ' $(COMPILER) $<'#013#010+
  983. ' $(EXECPPAS)'#013#010+
  984. #013#010+
  985. '%$(EXEEXT): %.pas'#013#010+
  986. ' $(COMPILER) $<'#013#010+
  987. ' $(EXECP','PAS)'#013#010+
  988. #013#010+
  989. '# Search paths for .ppu and .pp and .pas'#013#010+
  990. 'vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)'#013#010+
  991. 'vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)'#013#010+
  992. 'vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)'#013#010+
  993. #013#010+
  994. #013#010+
  995. '[libraryrules]'#013#010+
  996. '###########','#########################################################'+
  997. '#'#013#010+
  998. '# Library'#013#010+
  999. '#####################################################################'#013+
  1000. #010+
  1001. #013#010+
  1002. '.PHONY: fpc_shared'#013#010+
  1003. #013#010+
  1004. 'ifndef LIB_FULLNAME'#013#010+
  1005. 'ifdef LIB_VERSION'#013#010+
  1006. 'LIB_FULLNAME=$(LIB_NAME).$(LIB_VER','SION)'#013#010+
  1007. 'else'#013#010+
  1008. 'LIB_FULLNAME=$(LIB_NAME)'#013#010+
  1009. 'endif'#013#010+
  1010. 'endif'#013#010+
  1011. #013#010+
  1012. '# Default sharedlib units are all unit objects'#013#010+
  1013. 'ifndef LIB_SHAREDUNITS'#013#010+
  1014. 'LIB_SHAREDUNITS:=$(TARGET_UNITS)'#013#010+
  1015. 'endif'#013#010+
  1016. #013#010+
  1017. 'fpc_shared: all'#013#010+
  1018. 'ifdef HASSHAREDLIB'#013#010+
  1019. ' $(PPUMOVE) $(LIB_SHAREDUN','ITS) -o$(LIB_FULLNAME)'#013#010+
  1020. 'else'#013#010+
  1021. ' @$(ECHO) Shared Libraries not supported'#013#010+
  1022. 'endif'#013#010+
  1023. #013#010+
  1024. #013#010+
  1025. '[installrules]'#013#010+
  1026. '#####################################################################'#013+
  1027. #010+
  1028. '# Install rules'#013#010+
  1029. '##############################################','######################'+
  1030. '#'#013#010+
  1031. #013#010+
  1032. '.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall'#013#010+
  1033. #013#010+
  1034. 'ifdef INSTALL_UNITS'#013#010+
  1035. 'override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))'#013#010+
  1036. 'endif'#013#010+
  1037. #013#010+
  1038. 'ifdef INSTALLPPUFILES'#013#010+
  1039. 'override INSTALLPPULINKFILES:=$(s','ubst $(PPUEXT),$(OEXT),$(INSTALLPPU'+
  1040. 'FILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEX'+
  1041. 'T),$(INSTALLPPUFILES)))'#013#010+
  1042. 'override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALL'+
  1043. 'PPUFILES))'#013#010+
  1044. 'override INSTALLPPULINKFILES',':=$(wildcard $(addprefix $(UNITTARGETDIR'+
  1045. 'PREFIX),$(INSTALLPPULINKFILES)))'#013#010+
  1046. '# Implicitly install Package.fpc'#013#010+
  1047. 'override INSTALL_CREATEPACKAGEFPC=1'#013#010+
  1048. 'endif'#013#010+
  1049. #013#010+
  1050. 'ifdef INSTALLEXEFILES'#013#010+
  1051. 'override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INST','ALLEX'+
  1052. 'EFILES))'#013#010+
  1053. 'endif'#013#010+
  1054. #013#010+
  1055. 'fpc_install: all $(INSTALLTARGET)'#013#010+
  1056. 'ifdef INSTALLEXEFILES'#013#010+
  1057. ' $(MKDIR) $(INSTALL_BINDIR)'#013#010+
  1058. '# Compress the exes if upx is defined'#013#010+
  1059. 'ifdef UPXPROG'#013#010+
  1060. ' -$(UPXPROG) $(INSTALLEXEFILES)'#013#010+
  1061. 'endif'#013#010+
  1062. ' $(INSTALLEXE)',' $(INSTALLEXEFILES) $(INSTALL_BINDIR)'#013#010+
  1063. 'endif'#013#010+
  1064. 'ifdef INSTALL_CREATEPACKAGEFPC'#013#010+
  1065. 'ifdef FPCMAKE'#013#010+
  1066. '# If the fpcpackage variable is set then create and install Package.fp'+
  1067. 'c,'#013#010+
  1068. '# a safety check is done if Makefile.fpc is available'#013#010+
  1069. 'ifdef PACKAGE_VERS','ION'#013#010+
  1070. 'ifneq ($(wildcard Makefile.fpc),)'#013#010+
  1071. ' $(FPCMAKE) -p -T$(OS_TARGET) Makefile.fpc'#013#010+
  1072. ' $(MKDIR) $(INSTALL_UNITDIR)'#013#010+
  1073. ' $(INSTALL) Package.fpc $(INSTALL_UNITDIR)'#013#010+
  1074. 'endif'#013#010+
  1075. 'endif'#013#010+
  1076. 'endif'#013#010+
  1077. 'endif'#013#010+
  1078. 'ifdef INSTALLPPUFILES'#013#010+
  1079. ' $(','MKDIR) $(INSTALL_UNITDIR)'#013#010+
  1080. ' $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)'#013#010+
  1081. 'ifneq ($(INSTALLPPULINKFILES),)'#013#010+
  1082. ' $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)'#013#010+
  1083. 'endif'#013#010+
  1084. 'ifneq ($(wildcard $(LIB_FULLNAME)),)'#013#010+
  1085. ' $(MKDIR',') $(INSTALL_LIBDIR)'#013#010+
  1086. ' $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)'#013#010+
  1087. 'ifdef inUnix'#013#010+
  1088. ' ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)'#013#010+
  1089. 'endif'#013#010+
  1090. 'endif'#013#010+
  1091. 'endif'#013#010+
  1092. 'ifdef INSTALL_FILES'#013#010+
  1093. ' $(MKDIR) $(INSTALL_DATADIR)'#013#010+
  1094. ' $(','INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)'#013#010+
  1095. 'endif'#013#010+
  1096. #013#010+
  1097. 'fpc_sourceinstall: distclean'#013#010+
  1098. ' $(MKDIR) $(INSTALL_SOURCEDIR)'#013#010+
  1099. ' $(COPYTREE) $(BASEDIR) $(INSTALL_SOURCEDIR)'#013#010+
  1100. #013#010+
  1101. 'fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDI','RS))'#013+
  1102. #010+
  1103. 'ifdef HASEXAMPLES'#013#010+
  1104. ' $(MKDIR) $(INSTALL_EXAMPLEDIR)'#013#010+
  1105. 'endif'#013#010+
  1106. 'ifdef EXAMPLESOURCEFILES'#013#010+
  1107. ' $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)'#013#010+
  1108. 'endif'#013#010+
  1109. 'ifdef TARGET_EXAMPLEDIRS'#013#010+
  1110. ' $(COPYTREE) $(addsuffix /*,$(TARGET_EXAM','PLEDIRS)) $(INSTALL_'+
  1111. 'EXAMPLEDIR)'#013#010+
  1112. 'endif'#013#010+
  1113. #013#010+
  1114. '[distinstallrules]'#013#010+
  1115. '#####################################################################'#013+
  1116. #010+
  1117. '# Dist Install'#013#010+
  1118. '#####################################################################'#013+
  1119. #010+
  1120. #013#010+
  1121. '.PHONY: fpc_distin','stall'#013#010+
  1122. #013#010+
  1123. 'fpc_distinstall: install exampleinstall'#013#010+
  1124. #013#010+
  1125. #013#010+
  1126. '[zipinstallrules]'#013#010+
  1127. '#####################################################################'#013+
  1128. #010+
  1129. '# Zip'#013#010+
  1130. '#####################################################################'#013+
  1131. #010+
  1132. #013#010+
  1133. '.PHONY: fpc_zipi','nstall fpc_zipsourceinstall fpc_zipexampleinstall'#013+
  1134. #010+
  1135. #013#010+
  1136. '# Temporary path to pack a file, can only use a single deep'#013#010+
  1137. '# subdir, because the deltree can'#039't see the whole tree to remove'#013+
  1138. #010+
  1139. 'ifndef PACKDIR'#013#010+
  1140. 'ifndef inUnix'#013#010+
  1141. 'PACKDIR=$(BASEDIR)/../fpc-pac','k'#013#010+
  1142. 'else'#013#010+
  1143. 'PACKDIR=/tmp/fpc-pack'#013#010+
  1144. 'endif'#013#010+
  1145. 'endif'#013#010+
  1146. #013#010+
  1147. '# Maybe create default zipname from packagename'#013#010+
  1148. 'ifndef ZIPNAME'#013#010+
  1149. 'ifdef DIST_ZIPNAME'#013#010+
  1150. 'ZIPNAME=$(DIST_ZIPNAME)'#013#010+
  1151. 'else'#013#010+
  1152. 'ZIPNAME=$(ZIPPREFIX)$(PACKAGE_NAME)$(ZIPSUFFIX)'#013#010+
  1153. 'endif'#013#010+
  1154. 'endif'#013#010+
  1155. #013#010+
  1156. '# ZipTarget',#013#010+
  1157. 'ifndef ZIPTARGET'#013#010+
  1158. 'ifdef DIST_ZIPTARGET'#013#010+
  1159. 'ZIPTARGET=DIST_ZIPTARGET'#013#010+
  1160. 'else'#013#010+
  1161. 'ZIPTARGET=install'#013#010+
  1162. 'endif'#013#010+
  1163. 'endif'#013#010+
  1164. #013#010+
  1165. '# Use tar by default under linux'#013#010+
  1166. 'ifndef USEZIP'#013#010+
  1167. 'ifdef inUnix'#013#010+
  1168. 'USETAR=1'#013#010+
  1169. 'endif'#013#010+
  1170. 'endif'#013#010+
  1171. #013#010+
  1172. '# Use a wrapper script by default for Os/2',#013#010+
  1173. 'ifndef inUnix'#013#010+
  1174. 'USEZIPWRAPPER=1'#013#010+
  1175. 'endif'#013#010+
  1176. #013#010+
  1177. '# We need to be able to run in the current OS so fix'#013#010+
  1178. '# the path separator'#013#010+
  1179. 'ifdef USEZIPWRAPPER'#013#010+
  1180. 'ZIPPATHSEP=$(PATHSEP)'#013#010+
  1181. 'ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(BATCHEXT))'#013+
  1182. #010+
  1183. 'else'#013#010+
  1184. 'ZIP','PATHSEP=/'#013#010+
  1185. 'endif'#013#010+
  1186. #013#010+
  1187. '# Create commands to create the zip/tar file'#013#010+
  1188. 'ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))'#013#010+
  1189. 'ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))'#013#010+
  1190. 'ifdef USETAR'#013#010+
  1191. 'ZIPDESTFILE:=$(DIST_DESTDIR)/$(ZIPNAME)$(TAREXT)'#013#010,
  1192. 'ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *'#013#010+
  1193. 'else'#013#010+
  1194. 'ZIPDESTFILE:=$(DIST_DESTDIR)/$(ZIPNAME)$(ZIPEXT)'#013#010+
  1195. 'ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDES'+
  1196. 'TFILE) *'#013#010+
  1197. 'endif'#013#010+
  1198. #013#010+
  1199. 'fpc_zipinstall:'#013#010+
  1200. ' $(MAKE) $(ZIPTARG','ET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1'#013+
  1201. #010+
  1202. ' $(MKDIR) $(DIST_DESTDIR)'#013#010+
  1203. ' $(DEL) $(ZIPDESTFILE)'#013#010+
  1204. 'ifdef USEZIPWRAPPER'#013#010+
  1205. '# Handle gecho separate as we need to espace \ with \\'#013#010+
  1206. 'ifneq ($(ECHOREDIR),echo)'#013#010+
  1207. ' $(ECHOREDIR) -e "$(','subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAP'+
  1208. 'PER)'#013#010+
  1209. ' $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)'+
  1210. #013#010+
  1211. ' $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPP'+
  1212. 'ER)'#013#010+
  1213. 'else'#013#010+
  1214. ' echo $(ZIPCMD_CDPACK) > $(ZIPWRA','PPER)'#013#010+
  1215. ' echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)'#013#010+
  1216. ' echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)'#013#010+
  1217. 'endif'#013#010+
  1218. 'ifdef inUnix'#013#010+
  1219. ' /bin/sh $(ZIPWRAPPER)'#013#010+
  1220. 'else'#013#010+
  1221. ' $(ZIPWRAPPER)'#013#010+
  1222. 'endif'#013#010+
  1223. ' $(DEL) $(ZIPWRAPPER)'#013#010+
  1224. 'else'#013#010+
  1225. ' $(ZIPCMD','_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)'#013#010+
  1226. 'endif'#013#010+
  1227. ' $(DELTREE) $(PACKDIR)'#013#010+
  1228. #013#010+
  1229. 'fpc_zipsourceinstall:'#013#010+
  1230. ' $(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=src'#013+
  1231. #010+
  1232. #013#010+
  1233. 'fpc_zipexampleinstall:'#013#010+
  1234. 'ifdef HASEXAMPLES'#013#010+
  1235. ' $(MAKE) f','pc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=ex'+
  1236. 'm'#013#010+
  1237. 'endif'#013#010+
  1238. #013#010+
  1239. 'fpc_zipdistinstall:'#013#010+
  1240. ' $(MAKE) fpc_zipinstall ZIPTARGET=distinstall'#013#010+
  1241. #013#010+
  1242. #013#010+
  1243. '[cleanrules]'#013#010+
  1244. '#####################################################################'#013+
  1245. #010+
  1246. '# Clean rules',#013#010+
  1247. '#####################################################################'#013+
  1248. #010+
  1249. #013#010+
  1250. '.PHONY: fpc_clean fpc_cleanall fpc_distclean'#013#010+
  1251. #013#010+
  1252. 'ifdef EXEFILES'#013#010+
  1253. 'override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES'+
  1254. '))'#013#010+
  1255. 'endif'#013#010+
  1256. #013#010+
  1257. 'ifdef CLEAN_UNITS'#013,#010+
  1258. 'override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))'#013#010+
  1259. 'endif'#013#010+
  1260. #013#010+
  1261. 'ifdef CLEANPPUFILES'#013#010+
  1262. 'override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)'+
  1263. ') $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(C'+
  1264. 'LEANPP','UFILES)))'#013#010+
  1265. 'override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUF'+
  1266. 'ILES))'#013#010+
  1267. 'override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREF'+
  1268. 'IX),$(CLEANPPULINKFILES)))'#013#010+
  1269. 'endif'#013#010+
  1270. #013#010+
  1271. 'fpc_clean: $(CLEANTARGET)'#013#010+
  1272. 'ifdef CLEANEXEFIL','ES'#013#010+
  1273. ' -$(DEL) $(CLEANEXEFILES)'#013#010+
  1274. 'endif'#013#010+
  1275. 'ifdef CLEANPPUFILES'#013#010+
  1276. ' -$(DEL) $(CLEANPPUFILES)'#013#010+
  1277. 'endif'#013#010+
  1278. 'ifneq ($(CLEANPPULINKFILES),)'#013#010+
  1279. ' -$(DEL) $(CLEANPPULINKFILES)'#013#010+
  1280. 'endif'#013#010+
  1281. 'ifdef CLEANRSTFILES'#013#010+
  1282. ' -$(DEL) $(addprefix $(UNITTA','RGETDIRPREFIX),$(CLEANRSTFILES))'+
  1283. #013#010+
  1284. 'endif'#013#010+
  1285. 'ifdef CLEAN_FILES'#013#010+
  1286. ' -$(DEL) $(CLEAN_FILES)'#013#010+
  1287. 'endif'#013#010+
  1288. 'ifdef LIB_NAME'#013#010+
  1289. ' -$(DEL) $(LIB_NAME) $(LIB_FULLNAME)'#013#010+
  1290. 'endif'#013#010+
  1291. ' -$(DEL) $(FPCMADE) Package.fpc $(PPAS) link.res $(FPCEXTFILE) '+
  1292. '$(R','EDIRFILE)'#013#010+
  1293. #013#010+
  1294. 'fpc_distclean: clean'#013#010+
  1295. #013#010+
  1296. '# Also run clean first if targetdir is set. Unittargetdir is always'#013+
  1297. #010+
  1298. '# set if targetdir or unittargetdir is specified'#013#010+
  1299. 'ifdef COMPILER_UNITTARGETDIR'#013#010+
  1300. 'TARGETDIRCLEAN=fpc_clean'#013#010+
  1301. 'endif'#013#010+
  1302. #013#010+
  1303. 'fpc_cleanall: $(CLE','ANTARGET) $(TARGETDIRCLEAN)'#013#010+
  1304. 'ifdef CLEANEXEFILES'#013#010+
  1305. ' -$(DEL) $(CLEANEXEFILES)'#013#010+
  1306. 'endif'#013#010+
  1307. ' -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIB'+
  1308. 'EXT) *$(SHAREDLIBEXT) *$(PPLEXT)'#013#010+
  1309. ' -$(DELTREE) *$(SMARTEXT)'#013#010+
  1310. ' -$(','DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFIL'+
  1311. 'E)'#013#010+
  1312. 'ifdef AOUTEXT'#013#010+
  1313. ' -$(DEL) *$(AOUTEXT)'#013#010+
  1314. 'endif'#013#010+
  1315. #013#010+
  1316. #013#010+
  1317. '[inforules]'#013#010+
  1318. '#####################################################################'#013+
  1319. #010+
  1320. '# Info rules'#013#010+
  1321. '##########################','##########################################'+
  1322. '#'#013#010+
  1323. #013#010+
  1324. '.PHONY: fpc_info'#013#010+
  1325. #013#010+
  1326. 'fpc_info:'#013#010+
  1327. ' @$(ECHO)'#013#010+
  1328. ' @$(ECHO) == Package info =='#013#010+
  1329. ' @$(ECHO) Package Name..... $(PACKAGE_NAME)'#013#010+
  1330. ' @$(ECHO) Package Version.. $(PACKAGE_VERSION',')'#013#010+
  1331. ' @$(ECHO)'#013#010+
  1332. ' @$(ECHO) == Configuration info =='#013#010+
  1333. ' @$(ECHO)'#013#010+
  1334. ' @$(ECHO) FPC.......... $(FPC)'#013#010+
  1335. ' @$(ECHO) FPC Version.. $(FPC_VERSION)'#013#010+
  1336. ' @$(ECHO) Source CPU... $(CPU_SOURCE)'#013#010+
  1337. ' @$(ECHO) Targ','et CPU... $(CPU_TARGET)'#013#010+
  1338. ' @$(ECHO) Source OS.... $(OS_SOURCE)'#013#010+
  1339. ' @$(ECHO) Target OS.... $(OS_TARGET)'#013#010+
  1340. ' @$(ECHO)'#013#010+
  1341. ' @$(ECHO) == Directory info =='#013#010+
  1342. ' @$(ECHO)'#013#010+
  1343. ' @$(ECHO) Basedir......... $(BASEDIR)'#013#010,
  1344. ' @$(ECHO) FPCDir.......... $(FPCDIR)'#013#010+
  1345. ' @$(ECHO) UnitsDir........ $(UNITSDIR)'#013#010+
  1346. ' @$(ECHO) PackagesDir..... $(PACKAGESDIR)'#013#010+
  1347. ' @$(ECHO)'#013#010+
  1348. ' @$(ECHO) GCC library..... $(GCCLIBDIR)'#013#010+
  1349. ' @$(ECHO) Other libr','ary... $(OTHERLIBDIR)'#013#010+
  1350. ' @$(ECHO)'#013#010+
  1351. ' @$(ECHO) == Tools info =='#013#010+
  1352. ' @$(ECHO)'#013#010+
  1353. ' @$(ECHO) Pwd....... $(PWD)'#013#010+
  1354. ' @$(ECHO) Mv........ $(MVPROG)'#013#010+
  1355. ' @$(ECHO) Cp........ $(CPPROG)'#013#010+
  1356. ' @$(ECHO) Rm........',' $(RMPROG)'#013#010+
  1357. ' @$(ECHO) GInstall.. $(GINSTALL)'#013#010+
  1358. ' @$(ECHO) Echo...... $(ECHO)'#013#010+
  1359. ' @$(ECHO) Date...... $(DATE)'#013#010+
  1360. ' @$(ECHO) FPCMake... $(FPCMAKE)'#013#010+
  1361. ' @$(ECHO) PPUMove... $(PPUMOVE)'#013#010+
  1362. ' @$(ECHO) Upx.......',' $(UPXPROG)'#013#010+
  1363. ' @$(ECHO) Zip....... $(ZIPPROG)'#013#010+
  1364. ' @$(ECHO)'#013#010+
  1365. ' @$(ECHO) == Object info =='#013#010+
  1366. ' @$(ECHO)'#013#010+
  1367. ' @$(ECHO) Target Loaders...... $(TARGET_LOADERS)'#013#010+
  1368. ' @$(ECHO) Target Units........ $(TARGET_UNITS)'#013,#010+
  1369. ' @$(ECHO) Target Programs..... $(TARGET_PROGRAMS)'#013#010+
  1370. ' @$(ECHO) Target Dirs......... $(TARGET_DIRS)'#013#010+
  1371. ' @$(ECHO) Target Examples..... $(TARGET_EXAMPLES)'#013#010+
  1372. ' @$(ECHO) Target ExampleDirs.. $(TARGET_EXAMPLEDIRS)'#013#010+
  1373. ' ',' @$(ECHO)'#013#010+
  1374. ' @$(ECHO) Clean Units......... $(CLEAN_UNITS)'#013#010+
  1375. ' @$(ECHO) Clean Files......... $(CLEAN_FILES)'#013#010+
  1376. ' @$(ECHO)'#013#010+
  1377. ' @$(ECHO) Install Units....... $(INSTALL_UNITS)'#013#010+
  1378. ' @$(ECHO) Install Files....... $(','INSTALL_FILES)'#013#010+
  1379. ' @$(ECHO)'#013#010+
  1380. ' @$(ECHO) == Install info =='#013#010+
  1381. ' @$(ECHO)'#013#010+
  1382. ' @$(ECHO) DateStr.............. $(DATESTR)'#013#010+
  1383. ' @$(ECHO) ZipPrefix............ $(ZIPPREFIX)'#013#010+
  1384. ' @$(ECHO) ZipSuffix............ $(ZI','PSUFFIX)'#013#010+
  1385. ' @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE)'#013#010+
  1386. ' @$(ECHO)'#013#010+
  1387. ' @$(ECHO) Install base dir..... $(INSTALL_BASEDIR)'#013#010+
  1388. ' @$(ECHO) Install binary dir... $(INSTALL_BINDIR)'#013#010+
  1389. ' @$(ECHO) Install libr','ary dir.. $(INSTALL_LIBDIR)'#013#010+
  1390. ' @$(ECHO) Install units dir.... $(INSTALL_UNITDIR)'#013#010+
  1391. ' @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR)'#013#010+
  1392. ' @$(ECHO) Install doc dir...... $(INSTALL_DOCDIR)'#013#010+
  1393. ' @$(ECHO) Install exam','ple dir.. $(INSTALL_EXAMPLEDIR)'#013#010+
  1394. ' @$(ECHO) Install data dir..... $(INSTALL_DATADIR)'#013#010+
  1395. ' @$(ECHO)'#013#010+
  1396. ' @$(ECHO) Dist destination dir. $(DIST_DESTDIR)'#013#010+
  1397. ' @$(ECHO) Dist zip name........ $(DIST_ZIPNAME)'#013#010+
  1398. ' @$(ECHO',')'#013#010+
  1399. #013#010+
  1400. '[localmakefile]'#013#010+
  1401. '#####################################################################'#013+
  1402. #010+
  1403. '# Local Makefile'#013#010+
  1404. '#####################################################################'#013+
  1405. #010+
  1406. #013#010+
  1407. 'ifneq ($(wildcard fpcmake.loc),)'#013#010+
  1408. 'include fpcmake.loc'#013#010+
  1409. 'e','ndif'#013#010+
  1410. #013#010+
  1411. '[userrules]'#013#010+
  1412. '#####################################################################'#013+
  1413. #010+
  1414. '# Users rules'#013#010+
  1415. '#####################################################################'#013+
  1416. #010
  1417. );