1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #6300 from kaspar030/improve_bindist

examples/bindist: some improvements
This commit is contained in:
Cenk Gündoğan 2017-08-29 20:09:22 +02:00 committed by GitHub
commit c9644d58c3
3 changed files with 18 additions and 11 deletions

View File

@ -18,13 +18,14 @@ QUIET ?= 1
# bindist specific stuff: # bindist specific stuff:
# #
# build and use module "abc". # build and use module "abc".
# use BINARY_DIRS instead of DIRS # use BIN_DIRS instead of DIRS, BIN_USEMODULE instead of USEMODULE,
BINARY_DIRS += abc # to flag that the directory should only be included when doing a normal build,
USEMODULE += abc # and that the resulting .a should be saved when doing "make bindist"
BIN_DIRS += abc
BIN_USEMODULE += abc # include "abc" module
BIN_USEMODULE += bindist # include application module (named $APPLICATION)
# list of files to include in binary distribution # list of extra files to include in binary distribution
# "bin/$(BOARD)/$(APPLICATION).elf" will automatically be added
DIST_FILES += Makefile DIST_FILES += Makefile
DIST_FILES += bin/$(BOARD)/abc.a
include $(RIOTBASE)/Makefile.include include $(RIOTBASE)/Makefile.include

View File

@ -10,6 +10,8 @@ This application serves as simple example for "make bindist".
It consists of an application module (bindist.a) and another example module It consists of an application module (bindist.a) and another example module
(abc.a). (abc.a).
See https://github.com/RIOT-OS/RIOT/wiki/LGPL-guide for background information.
## Instructions ## Instructions
Calling "make bindist" creates a folder "bindist", which only contains the Calling "make bindist" creates a folder "bindist", which only contains the

View File

@ -1,9 +1,13 @@
DIST_FILES += bin/$(BOARD)/$(APPLICATION).a USEMODULE += $(BIN_USEMODULE)
ifneq (, $(filter check_bindist, $(MAKECMDGOALS))) DIST_FILES += $(BIN_USEMODULE:%=bin/$(BOARD)/%.a)
# if the file Makefile.distcheck exists, we're executing from within a folder
# generated by "make bindist".
ifneq (, $(wildcard Makefile.distcheck))
include Makefile.distcheck include Makefile.distcheck
else else
DIRS+=$(BINARY_DIRS) DIRS+=$(BIN_DIRS)
endif endif
bindist: all bindist: all
@ -15,12 +19,12 @@ bindist: all
@cp -a bin/$(BOARD)/$(APPLICATION).elf bindist @cp -a bin/$(BOARD)/$(APPLICATION).elf bindist
@echo "BINDIST_RIOT_VERSION=$(RIOT_VERSION)" > bindist/Makefile.distcheck @echo "BINDIST_RIOT_VERSION=$(RIOT_VERSION)" > bindist/Makefile.distcheck
@echo "BINDIST_GIT_HEAD=$$(git --work-tree=$(RIOTBASE) describe)" >> bindist/Makefile.distcheck @echo "BINDIST_GIT_HEAD=$$(git -C $(RIOTBASE) describe)" >> bindist/Makefile.distcheck
prepare_check_bindist: prepare_check_bindist:
@[ "$(BINDIST_RIOT_VERSION)" = "$(RIOT_VERSION)" ] || \ @[ "$(BINDIST_RIOT_VERSION)" = "$(RIOT_VERSION)" ] || \
echo "Warning! RIOT_VERSION doesn't match!" echo "Warning! RIOT_VERSION doesn't match!"
@[ "$(BINDIST_GIT_HEAD)" = "$$(git --work-tree=$(RIOTBASE) describe)" ] || \ @[ "$(BINDIST_GIT_HEAD)" = "$$(git -C $(RIOTBASE) describe)" ] || \
echo "Warning! git describe doesn't match!" echo "Warning! git describe doesn't match!"
check_bindist: prepare_check_bindist all check_bindist: prepare_check_bindist all