From 37f14efad503de8563ef25167cc24ff0c7a0da1c Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Sat, 12 May 2018 17:34:29 +0100 Subject: [PATCH] Harmonize building of tools from within an example dir --- Makefile.include | 3 +++ Makefile.tools | 11 +++++++++++ arch/platform/jn516x/Makefile.jn516x | 3 --- .../rpl-border-router/embedded/Makefile.embedded | 12 +++++------- 4 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 Makefile.tools diff --git a/Makefile.include b/Makefile.include index de0606ad4..105459d4d 100644 --- a/Makefile.include +++ b/Makefile.include @@ -10,6 +10,9 @@ WERROR ?= 1 include $(CONTIKI)/Makefile.identify-target +### Include Makefile.tools to pull in targets that allow us to build tools dir +include $(CONTIKI)/Makefile.tools + CONTIKI_NG_TARGET_LIB = contiki-ng-$(TARGET).a ifeq ($(DEFINES),) diff --git a/Makefile.tools b/Makefile.tools new file mode 100644 index 000000000..6dd978ee1 --- /dev/null +++ b/Makefile.tools @@ -0,0 +1,11 @@ +TOOLS_DIR = $(CONTIKI)/tools +TOOL_DEPS = $(TOOLS_DIR)/tools-utils.c $(TOOLS_DIR)/tools-utils.h + +TUNSLIP6 = $(TOOLS_DIR)/tunslip6 +SERIAL_DUMP_BIN = $(TOOLS_DIR)/serialdump + +$(SERIAL_DUMP_BIN): $(TOOLS_DIR)/serialdump.c $(TOOL_DEPS) + make -C $(TOOLS_DIR) serialdump + +$(TUNSLIP6): $(TOOLS_DIR)/tunslip6.c $(TOOL_DEPS) + make -C $(TOOLS_DIR) tunslip6 diff --git a/arch/platform/jn516x/Makefile.jn516x b/arch/platform/jn516x/Makefile.jn516x index 93ba5f296..2dbe0cdef 100644 --- a/arch/platform/jn516x/Makefile.jn516x +++ b/arch/platform/jn516x/Makefile.jn516x @@ -299,9 +299,6 @@ serialdumpall: UART_BAUDRATE ?= 1000000 -$(CONTIKI)/tools/tunslip6: $(CONTIKI)/tools/tunslip6.c - ($(MAKE) -C $(CONTIKI)/tools tunslip6 CFLAGS= LDFLAGS= LDLIBS= INCFLAGS=) - $(SERIALDUMP): $(CONTIKI)/tools/jn516x/serialdump.c (cd $(CONTIKI)/tools/jn516x; ${MAKE} $(notdir $(SERIALDUMP))) diff --git a/os/services/rpl-border-router/embedded/Makefile.embedded b/os/services/rpl-border-router/embedded/Makefile.embedded index c62f7df54..8324722fc 100644 --- a/os/services/rpl-border-router/embedded/Makefile.embedded +++ b/os/services/rpl-border-router/embedded/Makefile.embedded @@ -1,9 +1,7 @@ -$(CONTIKI)/tools/tunslip6: $(CONTIKI)/tools/tunslip6.c - (cd $(CONTIKI)/tools && $(MAKE) tunslip6) - PREFIX ?= fd00::1/64 -connect-router: $(CONTIKI)/tools/tunslip6 - sudo $(CONTIKI)/tools/tunslip6 $(PREFIX) -connect-router-cooja: $(CONTIKI)/tools/tunslip6 - sudo $(CONTIKI)/tools/tunslip6 -a 127.0.0.1 $(PREFIX) +connect-router: $(TUNSLIP6) + sudo $(TUNSLIP6) $(PREFIX) + +connect-router-cooja: $(TUNSLIP6) + sudo $(TUNSLIP6) -a 127.0.0.1 $(PREFIX)