You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/11/05 09:57:56 UTC

[GitHub] michal-narajowski closed pull request #235: porting: Fix Tinycrypt port build

michal-narajowski closed pull request #235: porting: Fix Tinycrypt port build
URL: https://github.com/apache/mynewt-nimble/pull/235
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/porting/examples/dummy/Makefile b/porting/examples/dummy/Makefile
index 144c9b9e..34952353 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 adf4b919..936094dd 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 c9ae0298..d0747480 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 \


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services