Harmonize building of tools from within an example dir

This commit is contained in:
George Oikonomou 2018-05-12 17:34:29 +01:00
parent 8c347f96d7
commit 37f14efad5
4 changed files with 19 additions and 10 deletions

View File

@ -10,6 +10,9 @@ WERROR ?= 1
include $(CONTIKI)/Makefile.identify-target 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 CONTIKI_NG_TARGET_LIB = contiki-ng-$(TARGET).a
ifeq ($(DEFINES),) ifeq ($(DEFINES),)

11
Makefile.tools Normal file
View File

@ -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

View File

@ -299,9 +299,6 @@ serialdumpall:
UART_BAUDRATE ?= 1000000 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 $(SERIALDUMP): $(CONTIKI)/tools/jn516x/serialdump.c
(cd $(CONTIKI)/tools/jn516x; ${MAKE} $(notdir $(SERIALDUMP))) (cd $(CONTIKI)/tools/jn516x; ${MAKE} $(notdir $(SERIALDUMP)))

View File

@ -1,9 +1,7 @@
$(CONTIKI)/tools/tunslip6: $(CONTIKI)/tools/tunslip6.c
(cd $(CONTIKI)/tools && $(MAKE) tunslip6)
PREFIX ?= fd00::1/64 PREFIX ?= fd00::1/64
connect-router: $(CONTIKI)/tools/tunslip6
sudo $(CONTIKI)/tools/tunslip6 $(PREFIX)
connect-router-cooja: $(CONTIKI)/tools/tunslip6 connect-router: $(TUNSLIP6)
sudo $(CONTIKI)/tools/tunslip6 -a 127.0.0.1 $(PREFIX) sudo $(TUNSLIP6) $(PREFIX)
connect-router-cooja: $(TUNSLIP6)
sudo $(TUNSLIP6) -a 127.0.0.1 $(PREFIX)