From 5cb81c753dcfa7e69c457623714d9ac7b79fb9a4 Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Wed, 6 Mar 2019 14:05:44 -0500 Subject: [PATCH] Add version/extensions to PC build --- Makefile | 16 ++++++++++++++-- {targets/stm32l432/src => fido2}/version.h | 0 pc/app.h | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) rename {targets/stm32l432/src => fido2}/version.h (100%) diff --git a/Makefile b/Makefile index fe827b8..102ec04 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,9 @@ ecc_platform=2 -src = $(wildcard pc/*.c) $(wildcard fido2/*.c) $(wildcard crypto/sha256/*.c) crypto/tiny-AES-c/aes.c +src = $(wildcard pc/*.c) $(wildcard fido2/*.c) $(wildcard fido2/extensions/*.c) \ + $(wildcard crypto/sha256/*.c) crypto/tiny-AES-c/aes.c + obj = $(src:.c=.o) crypto/micro-ecc/uECC.o LIBCBOR = tinycbor/lib/libtinycbor.a @@ -20,7 +22,17 @@ else export LDFLAGS = -Wl,--gc-sections endif LDFLAGS += $(LIBCBOR) -CFLAGS = -O2 -fdata-sections -ffunction-sections + +VERSION:=$(shell git describe --abbrev=0 ) +VERSION_FULL:=$(shell git describe) +VERSION_MAJ:=$(shell python -c 'print("$(VERSION)".split(".")[0])') +VERSION_MIN:=$(shell python -c 'print("$(VERSION)".split(".")[1])') +VERSION_PAT:=$(shell python -c 'print("$(VERSION)".split(".")[2])') + +VERSION_FLAGS= -DSOLO_VERSION_MAJ=$(VERSION_MAJ) -DSOLO_VERSION_MIN=$(VERSION_MIN) \ + -DSOLO_VERSION_PATCH=$(VERSION_PAT) -DSOLO_VERSION=\"$(VERSION_FULL)\" + +CFLAGS = -O2 -fdata-sections -ffunction-sections $(VERSION_FLAGS) INCLUDES = -I./tinycbor/src -I./crypto/sha256 -I./crypto/micro-ecc/ -Icrypto/tiny-AES-c/ -I./fido2/ -I./pc -I./fido2/extensions INCLUDES += -I./crypto/cifra/src diff --git a/targets/stm32l432/src/version.h b/fido2/version.h similarity index 100% rename from targets/stm32l432/src/version.h rename to fido2/version.h diff --git a/pc/app.h b/pc/app.h index 8dca429..8d15715 100644 --- a/pc/app.h +++ b/pc/app.h @@ -15,7 +15,7 @@ #define DEBUG_LEVEL 1 #define ENABLE_U2F - +#define ENABLE_U2F_EXTENSIONS //#define BRIDGE_TO_WALLET void printing_init();