1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-25 07:48:10 +00:00

Generate the protobuf files at build time (#219)

Improve the build reliability by ensuring protobuf files are
generated at build time.
This commit is contained in:
Jason Zavaglia 2017-09-28 21:10:32 +10:00 committed by Pavol Rusnak
parent 30367bfad1
commit 5cc299facd
5 changed files with 9 additions and 2 deletions

3
.gitmodules vendored
View File

@ -10,3 +10,6 @@
[submodule "libopencm3"]
path = vendor/libopencm3
url = https://github.com/libopencm3/libopencm3.git
[submodule "vendor/nanopb"]
path = vendor/nanopb
url = https://github.com/nanopb/nanopb.git

View File

@ -8,4 +8,5 @@ RUN apt-get update
# install build tools and dependencies
RUN apt-get install -y build-essential git python python-ecdsa gcc-arm-none-eabi
RUN apt-get install -y build-essential git python python-ecdsa gcc-arm-none-eabi protobuf-compiler \
libprotobuf-dev python-protobuf python3-protobuf

View File

@ -13,6 +13,8 @@ docker run -t -v $(pwd)/build:/build:z $IMAGE /bin/sh -c "\
git checkout $TAG && \
git submodule update --init && \
make -C vendor/libopencm3 && \
make -C vendor/nanopb/generator/proto && \
make -C firmware/protob && \
make && \
make -C firmware sign && \
cp firmware/trezor.bin /$BINFILE && \

View File

@ -1,7 +1,7 @@
all: messages.pb.c storage.pb.c types.pb.c messages_map.h
%.pb.c: %.pb %.options
nanopb_generator.py $< -L '#include "%s"' -T
../../vendor/nanopb/generator/nanopb_generator.py $< -L '#include "%s"' -T
%.pb: %.proto
protoc -I/usr/include -I. $< -o $@

1
vendor/nanopb vendored Submodule

@ -0,0 +1 @@
Subproject commit 54c34a9fda152937d4cd0c7fd85c067fca23af75