mirror of https://github.com/ARMmbed/mbed-os.git
Use internal class variable for resolving templates in makefiles
This allows other exporters to inherit from make and change the name of the exporter without breaking.pull/3187/head
parent
fe80efe1bb
commit
c2470e9710
|
@ -88,12 +88,12 @@ class Makefile(Exporter):
|
||||||
ctx.update(self.flags)
|
ctx.update(self.flags)
|
||||||
|
|
||||||
for templatefile in \
|
for templatefile in \
|
||||||
['makefile/%s_%s.tmpl' % (self.NAME.lower(),
|
['makefile/%s_%s.tmpl' % (self.TEMPLATE,
|
||||||
self.target.lower())] + \
|
self.target.lower())] + \
|
||||||
['makefile/%s_%s.tmpl' % (self.NAME.lower(),
|
['makefile/%s_%s.tmpl' % (self.TEMPLATE,
|
||||||
label.lower()) for label
|
label.lower()) for label
|
||||||
in self.toolchain.target.extra_labels] +\
|
in self.toolchain.target.extra_labels] +\
|
||||||
['makefile/%s.tmpl' % self.NAME.lower()]:
|
['makefile/%s.tmpl' % self.TEMPLATE]:
|
||||||
try:
|
try:
|
||||||
self.gen_file(templatefile, ctx, 'Makefile')
|
self.gen_file(templatefile, ctx, 'Makefile')
|
||||||
break
|
break
|
||||||
|
@ -108,6 +108,7 @@ class GccArm(Makefile):
|
||||||
TARGETS = [target for target, obj in TARGET_MAP.iteritems()
|
TARGETS = [target for target, obj in TARGET_MAP.iteritems()
|
||||||
if "GCC_ARM" in obj.supported_toolchains]
|
if "GCC_ARM" in obj.supported_toolchains]
|
||||||
NAME = 'Make-GCC-ARM'
|
NAME = 'Make-GCC-ARM'
|
||||||
|
TEMPLATE = 'make-gcc-arm'
|
||||||
TOOLCHAIN = "GCC_ARM"
|
TOOLCHAIN = "GCC_ARM"
|
||||||
LINK_SCRIPT_OPTION = "-T"
|
LINK_SCRIPT_OPTION = "-T"
|
||||||
USER_LIBRARY_FLAG = "-L"
|
USER_LIBRARY_FLAG = "-L"
|
||||||
|
@ -122,6 +123,7 @@ class Armc5(Makefile):
|
||||||
TARGETS = [target for target, obj in TARGET_MAP.iteritems()
|
TARGETS = [target for target, obj in TARGET_MAP.iteritems()
|
||||||
if "ARM" in obj.supported_toolchains]
|
if "ARM" in obj.supported_toolchains]
|
||||||
NAME = 'Make-ARMc5'
|
NAME = 'Make-ARMc5'
|
||||||
|
TEMPLATE = 'make-armc5'
|
||||||
TOOLCHAIN = "ARM"
|
TOOLCHAIN = "ARM"
|
||||||
LINK_SCRIPT_OPTION = "--scatter"
|
LINK_SCRIPT_OPTION = "--scatter"
|
||||||
USER_LIBRARY_FLAG = "--userlibpath "
|
USER_LIBRARY_FLAG = "--userlibpath "
|
||||||
|
@ -136,6 +138,7 @@ class IAR(Makefile):
|
||||||
TARGETS = [target for target, obj in TARGET_MAP.iteritems()
|
TARGETS = [target for target, obj in TARGET_MAP.iteritems()
|
||||||
if "IAR" in obj.supported_toolchains]
|
if "IAR" in obj.supported_toolchains]
|
||||||
NAME = 'Make-IAR'
|
NAME = 'Make-IAR'
|
||||||
|
TEMPLATE = 'make-iar'
|
||||||
TOOLCHAIN = "IAR"
|
TOOLCHAIN = "IAR"
|
||||||
LINK_SCRIPT_OPTION = "--config"
|
LINK_SCRIPT_OPTION = "--config"
|
||||||
USER_LIBRARY_FLAG = "-L"
|
USER_LIBRARY_FLAG = "-L"
|
||||||
|
|
Loading…
Reference in New Issue