1
0
Fork 0

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:
Daniel Thompson 2020-08-02 12:10:47 +01:00
parent c74d9e296b
commit 58fb5d630b

View file

@ -5,7 +5,8 @@ all : bootloader reloader micropython
ifdef BOARD ifdef BOARD
WASP_WATCH_PY = wasp/boards/$(BOARD)/watch.py WASP_WATCH_PY = wasp/boards/$(BOARD)/watch.py
$(WASP_WATCH_PY) : $(WASP_WATCH_PY).in $(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 else
BOARD ?= $(error Please set BOARD=) BOARD ?= $(error Please set BOARD=)
endif endif