Skip to content

Commit 4b7f591

Browse files
committed
Fix the makefile template
- Corrects a python barf when something in features is None - Corrects makefile to prevent barf when using make -f
1 parent 1794463 commit 4b7f591

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tools/export/gcc_arm_common.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ endif
1313
ifeq (,$(filter .build,$(notdir $(CURDIR))))
1414
.SUFFIXES:
1515
OBJDIR := .build
16-
MAKETARGET = $(MAKE) --no-print-directory -C $(OBJDIR) -f $(CURDIR)/Makefile \
16+
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
17+
MAKETARGET = $(MAKE) --no-print-directory -C $(OBJDIR) -f $(mkfile_path) \
1718
SRCDIR=$(CURDIR) $(MAKECMDGOALS)
1819
.PHONY: $(OBJDIR) clean
1920
all:

tools/toolchains/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def relative_to(self, base, dot=False):
147147
v = [rel_path(f, base, dot) for f in getattr(self, field)]
148148
setattr(self, field, v)
149149

150-
self.features = {k: f.relative_to(base, dot) for k, f in self.features.iteritems()}
150+
self.features = {k: f.relative_to(base, dot) for k, f in self.features.iteritems() if f}
151151

152152
if self.linker_script is not None:
153153
self.linker_script = rel_path(self.linker_script, base, dot)
@@ -160,7 +160,7 @@ def win_to_unix(self):
160160
v = [f.replace('\\', '/') for f in getattr(self, field)]
161161
setattr(self, field, v)
162162

163-
self.features = {k: f.win_to_unix() for k, f in self.features.iteritems()}
163+
self.features = {k: f.win_to_unix() for k, f in self.features.iteritems() if f}
164164

165165
if self.linker_script is not None:
166166
self.linker_script = self.linker_script.replace('\\', '/')

0 commit comments

Comments
 (0)