2018-03-13 11:58:21 +01:00
|
|
|
# Avoid including APPLICATION_MODULE twice to prevent multiple definition errors
|
|
|
|
USEMODULE += $(filter-out $(APPLICATION_MODULE),$(BIN_USEMODULE))
|
2015-01-27 17:25:16 +01:00
|
|
|
|
2020-08-12 15:37:49 +02:00
|
|
|
DIST_FILES += $(BIN_USEMODULE:%=bin/$(BOARD)/%/*.o)
|
2017-01-08 14:52:26 +01:00
|
|
|
|
|
|
|
# if the file Makefile.distcheck exists, we're executing from within a folder
|
|
|
|
# generated by "make bindist".
|
|
|
|
ifneq (, $(wildcard Makefile.distcheck))
|
2017-09-28 21:29:08 +02:00
|
|
|
include Makefile.distcheck
|
2015-01-27 17:25:16 +01:00
|
|
|
else
|
2017-09-28 21:29:08 +02:00
|
|
|
DIRS+=$(BIN_DIRS)
|
2015-01-27 17:25:16 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
bindist: all
|
|
|
|
@mkdir -p bindist
|
|
|
|
@for i in $(DIST_FILES) ; do \
|
|
|
|
echo Copying $$i to bindist. ; \
|
|
|
|
cp -a --parents $$i bindist ; \
|
|
|
|
done
|
2020-08-12 15:37:49 +02:00
|
|
|
@cp -a bin/$(BOARD)/$(APPLICATION).bin bindist
|
2015-01-27 17:25:16 +01:00
|
|
|
|
|
|
|
@echo "BINDIST_RIOT_VERSION=$(RIOT_VERSION)" > bindist/Makefile.distcheck
|
2017-01-08 14:52:26 +01:00
|
|
|
@echo "BINDIST_GIT_HEAD=$$(git -C $(RIOTBASE) describe)" >> bindist/Makefile.distcheck
|
2015-01-27 17:25:16 +01:00
|
|
|
|
|
|
|
prepare_check_bindist:
|
|
|
|
@[ "$(BINDIST_RIOT_VERSION)" = "$(RIOT_VERSION)" ] || \
|
|
|
|
echo "Warning! RIOT_VERSION doesn't match!"
|
2017-01-08 14:52:26 +01:00
|
|
|
@[ "$(BINDIST_GIT_HEAD)" = "$$(git -C $(RIOTBASE) describe)" ] || \
|
2015-01-27 17:25:16 +01:00
|
|
|
echo "Warning! git describe doesn't match!"
|
|
|
|
|
|
|
|
check_bindist: prepare_check_bindist all
|
2020-08-12 15:37:49 +02:00
|
|
|
@test $(shell md5sum bin/$(BOARD)/$(APPLICATION).bin | cut -f1 -d\ ) \
|
|
|
|
= $(shell md5sum $(APPLICATION).bin | cut -f1 -d\ ) \
|
|
|
|
&& echo "bin/$(BOARD)/$(APPLICATION).bin matches $(APPLICATION).bin." \
|
|
|
|
|| echo "bin/$(BOARD)/$(APPLICATION).bin and $(APPLICATION).bin don't match!"
|