Makefile 54 KB

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