Makefile: Clean up empty redirected file on failure
If the preprocessor fails for any reason then an empty or partially processed watch.py file is created which will satisfy the dependency checks in any later invocation of make which can silently break the build. Cleaning up on failure prevents this from happening. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This commit is contained in:
parent
c74d9e296b
commit
58fb5d630b
1 changed files with 2 additions and 1 deletions
3
Makefile
3
Makefile
|
@ -5,7 +5,8 @@ all : bootloader reloader micropython
|
|||
ifdef BOARD
|
||||
WASP_WATCH_PY = wasp/boards/$(BOARD)/watch.py
|
||||
$(WASP_WATCH_PY) : $(WASP_WATCH_PY).in
|
||||
(cd wasp; ../tools/preprocess.py ../$(WASP_WATCH_PY).in > ../$(WASP_WATCH_PY))
|
||||
(cd wasp; ../tools/preprocess.py ../$(WASP_WATCH_PY).in > ../$(WASP_WATCH_PY)) \
|
||||
|| ($(RM) $(WASP_WATCH_PY); false)
|
||||
else
|
||||
BOARD ?= $(error Please set BOARD=)
|
||||
endif
|
||||
|
|
Loading…
Reference in a new issue