From 8d183608c25bbc6417594d739b10e184f889c293 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 15 Dec 2015 00:20:34 +0100 Subject: [PATCH] include libopencm3 as submodule --- .gitmodules | 3 +++ Dockerfile | 9 --------- Makefile.include | 8 ++++---- firmware-docker-build.sh | 3 +++ libopencm3 | 1 + 5 files changed, 11 insertions(+), 13 deletions(-) create mode 160000 libopencm3 diff --git a/.gitmodules b/.gitmodules index 97aef8fa1..87453ddb1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "trezor-qrenc"] path = trezor-qrenc url = https://github.com/trezor/trezor-qrenc.git +[submodule "libopencm3"] + path = libopencm3 + url = https://github.com/libopencm3/libopencm3.git diff --git a/Dockerfile b/Dockerfile index adb7f76fb..29efb9314 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,12 +9,3 @@ RUN apt-get update # install build tools and dependencies RUN apt-get install -y build-essential git python gcc-arm-none-eabi - -# clone the source code - -RUN git clone https://github.com/libopencm3/libopencm3 - -# build libopencm3 - -ENV LIBOPENCM3_GITREV 7b29caed1a726b5cef4c269b6a6ef7a1f1dd105c -RUN cd libopencm3 && git checkout $LIBOPENCM3_GITREV && make diff --git a/Makefile.include b/Makefile.include index 8505ffc86..97bc3a604 100644 --- a/Makefile.include +++ b/Makefile.include @@ -1,5 +1,5 @@ TOP_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) -TOOLCHAIN_DIR ?= $(TOP_DIR)/../libopencm3 +TOOLCHAIN_DIR ?= $(TOP_DIR)libopencm3 PREFIX ?= arm-none-eabi- CC = $(PREFIX)gcc @@ -42,9 +42,9 @@ CFLAGS += $(OPTFLAGS) \ -DSTM32F2 \ -I$(TOOLCHAIN_DIR)/include \ -I$(TOP_DIR) \ - -I$(TOP_DIR)/gen \ - -I$(TOP_DIR)/trezor-crypto \ - -I$(TOP_DIR)/trezor-qrenc + -I$(TOP_DIR)gen \ + -I$(TOP_DIR)trezor-crypto \ + -I$(TOP_DIR)trezor-qrenc ifdef APPVER CFLAGS += -DAPPVER=$(APPVER) diff --git a/firmware-docker-build.sh b/firmware-docker-build.sh index f705c8ffb..d571d95e1 100755 --- a/firmware-docker-build.sh +++ b/firmware-docker-build.sh @@ -8,6 +8,9 @@ docker run -t -v $(pwd)/output:/output $IMAGETAG /bin/sh -c "\ cd trezor-mcu && \ git checkout $FIRMWARETAG && \ git submodule update --init && \ + cd libopencm3 && + make && \ + cd .. && \ make && \ cd firmware && \ make && \ diff --git a/libopencm3 b/libopencm3 new file mode 160000 index 000000000..b1049f9a6 --- /dev/null +++ b/libopencm3 @@ -0,0 +1 @@ +Subproject commit b1049f9a6f43882968dcf82ca1df3f1eee67e367