You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by na...@apache.org on 2018/11/05 09:57:59 UTC
[mynewt-nimble] branch master updated: porting: Fix Tinycrypt port
build
This is an automated email from the ASF dual-hosted git repository.
naraj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new 3358930 porting: Fix Tinycrypt port build
3358930 is described below
commit 3358930f36b525e384e836bba6e47f83ae1b48e0
Author: MichaĆ Narajowski <mi...@codecoup.pl>
AuthorDate: Mon Oct 29 11:43:06 2018 +0100
porting: Fix Tinycrypt port build
Tinycrypt requires -std=c99 flag to build.
---
porting/examples/dummy/Makefile | 8 +++++++-
porting/examples/linux/Makefile | 8 +++++++-
porting/nimble/Makefile.tinycrypt | 6 ++++--
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/porting/examples/dummy/Makefile b/porting/examples/dummy/Makefile
index 144c9b9..3495235 100644
--- a/porting/examples/dummy/Makefile
+++ b/porting/examples/dummy/Makefile
@@ -39,14 +39,18 @@ SRC = \
$(NIMBLE_ROOT)/porting/npl/dummy/src/npl_os_dummy.c \
$(NIMBLE_ROOT)/porting/npl/dummy/src/hci_dummy.c \
$(NIMBLE_SRC) \
+ $(TINYCRYPT_SRC) \
main.c \
# Add dummy NPL and all NimBLE directories to include paths
INC = \
$(NIMBLE_ROOT)/porting/npl/dummy/include \
$(NIMBLE_INCLUDE) \
+ $(TINYCRYPT_INCLUDE) \
+ $(INCLUDE) \
OBJ := $(SRC:.c=.o)
+TINYCRYPT_OBJ := $(TINYCRYPT_SRC:.c=.o)
CFLAGS := $(NIMBLE_CFLAGS)
@@ -59,8 +63,10 @@ clean:
rm $(OBJ) -f
rm dummy -f
+$(TINYCRYPT_OBJ): CFLAGS+=$(TINYCRYPT_CFLAGS)
+
%.o: %.c
$(CC) -c $(addprefix -I, $(INC)) $(CFLAGS) -o $@ $<
-dummy: $(OBJ)
+dummy: $(OBJ) $(TINYCRYPT_OBJ)
$(CC) -o $@ $^
diff --git a/porting/examples/linux/Makefile b/porting/examples/linux/Makefile
index adf4b91..936094d 100644
--- a/porting/examples/linux/Makefile
+++ b/porting/examples/linux/Makefile
@@ -27,6 +27,7 @@ SRC += \
$(NIMBLE_ROOT)/porting/npl/linux/src/os_task.c \
$(NIMBLE_ROOT)/porting/npl/linux/src/os_time.c \
$(NIMBLE_ROOT)/nimble/transport/socket/src/ble_hci_socket.c \
+ $(TINYCRYPT_SRC) \
$(NULL)
# Source files for demo app
@@ -42,6 +43,7 @@ INC = \
$(NIMBLE_ROOT)/porting/npl/linux/src \
$(NIMBLE_ROOT)/nimble/transport/socket/include \
$(NIMBLE_INCLUDE) \
+ $(TINYCRYPT_INCLUDE) \
$(NULL)
INCLUDES := $(addprefix -I, $(INC))
@@ -52,6 +54,8 @@ SRC_CC = $(filter %.cc, $(SRC))
OBJ := $(SRC_C:.c=.o)
OBJ += $(SRC_CC:.cc=.o)
+TINYCRYPT_OBJ := $(TINYCRYPT_SRC:.c=.o)
+
CFLAGS = \
$(NIMBLE_CFLAGS) \
$(INCLUDES) \
@@ -70,12 +74,14 @@ clean:
rm $(OBJ) -f
rm dummy -f
+$(TINYCRYPT_OBJ): CFLAGS+=$(TINYCRYPT_CFLAGS)
+
%.o: %.c
$(CC) -c $(INCLUDES) $(CFLAGS) -o $@ $<
%.o: %.cc
$(CXX) -c $(INCLUDES) $(CFLAGS) -o $@ $<
-nimble-linux: $(OBJ)
+nimble-linux: $(OBJ) $(TINYCRYPT_OBJ)
$(LD) -o $@ $^ $(LIBS)
$(SIZE) $@
diff --git a/porting/nimble/Makefile.tinycrypt b/porting/nimble/Makefile.tinycrypt
index c9ae029..d074748 100644
--- a/porting/nimble/Makefile.tinycrypt
+++ b/porting/nimble/Makefile.tinycrypt
@@ -15,10 +15,12 @@
# under the License.
#
-NIMBLE_INCLUDE += \
+TINYCRYPT_CFLAGS := -std=c99
+
+TINYCRYPT_INCLUDE := \
$(NIMBLE_ROOT)/ext/tinycrypt/include \
-NIMBLE_SRC += \
+TINYCRYPT_SRC := \
$(NIMBLE_ROOT)/ext/tinycrypt/src/aes_decrypt.c \
$(NIMBLE_ROOT)/ext/tinycrypt/src/aes_encrypt.c \
$(NIMBLE_ROOT)/ext/tinycrypt/src/cmac_mode.c \