diff --git a/Makefile.include b/Makefile.include index 0df048e7b..e633fe67b 100644 --- a/Makefile.include +++ b/Makefile.include @@ -85,6 +85,35 @@ else include $(target_makefile) endif +# Decide whether to build or to skip this target for this platform +ifneq ("", "$(PLATFORMS_ONLY)") + ifeq ("","$(filter $(TARGET), $(PLATFORMS_ONLY))") + PLATFORM_ACTION = skip + endif +endif + +ifneq ("", "$(PLATFORMS_EXCLUDE)") + ifneq ("","$(filter $(TARGET), $(PLATFORMS_EXCLUDE))") + PLATFORM_ACTION = skip + endif +endif + +ifneq ($(BOARD),) +ifneq ("", "$(BOARDS_ONLY)") + ifeq ("","$(filter $(BOARD), $(BOARDS_ONLY))") + PLATFORM_ACTION = skip + endif +endif + +ifneq ("", "$(BOARDS_EXCLUDE)") + ifneq ("","$(filter $(BOARD), $(BOARDS_EXCLUDE))") + PLATFORM_ACTION = skip + endif +endif +endif # $(BOARD) not empty + +PLATFORM_ACTION ?= build + # Configure MAC layer # The different options @@ -259,7 +288,7 @@ endef clean: -rm -f *~ *core core *.srec \ - *.lst *.map \ + *.lst *.map *.o \ *.cprg *.bin *.data contiki*.a *.firmware core-labels.S *.ihex *.ini \ rm -rf $(CLEAN) -rm -rf $(OBJECTDIR) @@ -396,8 +425,15 @@ endif # the match-anything rule below instead. %: %.c +ifeq ($(PLATFORM_ACTION),skip) +# Skip this target. +$(CONTIKI_PROJECT): + @echo "Skipping $@: not for the '$(TARGET)/$(BOARD)' platform!" +else +# Build this target. # Match-anything pattern rule to allow the project makefiles to # abstract from the actual binary name. It needs to contain some # command in order to be a rule, not just a prerequisite. %: %.$(TARGET) @ +endif diff --git a/arch/cpu/nrf52832/Makefile.nrf52832 b/arch/cpu/nrf52832/Makefile.nrf52832 index 567270834..c2bdbbf81 100644 --- a/arch/cpu/nrf52832/Makefile.nrf52832 +++ b/arch/cpu/nrf52832/Makefile.nrf52832 @@ -14,12 +14,6 @@ endif # custom MAC: ble_ipsp_mac_driver MAKE_MAC ?= MAKE_MAC_OTHER -# we only support IPv6 -MAKE_NET ?= MAKE_NET_IPV6 -ifneq ($(MAKE_NET),MAKE_NET_IPV6) - $(error Only IPv6 stack is supported!) -endif - $(info SDK: $(NRF52_SDK_ROOT)) ifeq ($(NRF52_DK_REVISION),) @@ -145,7 +139,7 @@ CFLAGS += -ggdb CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 # keep every function in separate section. This will allow linker to dump unused functions -LDFLAGS += -Xlinker -Map=$(LISTING_DIRECTORY)/$(OUTPUT_FILENAME).map +LDFLAGS += -Xlinker -Map=$(@:.elf=-$(TARGET).map) LDFLAGS += -mabi=aapcs -L $(TEMPLATE_PATH) -T$(LINKER_SCRIPT) LDFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 # let linker to dump unused sections diff --git a/arch/cpu/nrf52832/nrf52832-def.h b/arch/cpu/nrf52832/nrf52832-def.h index f31054dda..b5eca1b5e 100644 --- a/arch/cpu/nrf52832/nrf52832-def.h +++ b/arch/cpu/nrf52832/nrf52832-def.h @@ -34,6 +34,11 @@ /*---------------------------------------------------------------------------*/ #include "cm4/cm4-def.h" /*---------------------------------------------------------------------------*/ +#if !NETSTACK_CONF_WITH_IPV6 +/* we only support IPv6 */ +#error "Only IPv6 stack is supported!" +#endif +/*---------------------------------------------------------------------------*/ #define RTIMER_ARCH_SECOND 62500 /*---------------------------------------------------------------------------*/ #endif /* NRF52832_DEF_H_ */ diff --git a/arch/platform/native/Makefile.native b/arch/platform/native/Makefile.native index 24f433796..bee104a6c 100644 --- a/arch/platform/native/Makefile.native +++ b/arch/platform/native/Makefile.native @@ -30,6 +30,8 @@ CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES) # Enable nullmac by default MAKE_MAC ?= MAKE_MAC_NULLMAC +CLEAN += *.native + ### Define the CPU directory CONTIKI_CPU=$(CONTIKI)/arch/cpu/native include $(CONTIKI)/arch/cpu/native/Makefile.native diff --git a/arch/platform/nrf52dk/platform.c b/arch/platform/nrf52dk/platform.c index a2ba55385..e48a3c05d 100644 --- a/arch/platform/nrf52dk/platform.c +++ b/arch/platform/nrf52dk/platform.c @@ -127,7 +127,7 @@ platform_init_stage_two(void) #ifdef UART0_ENABLED uart0_init(); #if SLIP_ARCH_CONF_ENABLE - slip_arch_init(); + #error Platform does not support SLIP #else uart0_set_input(serial_line_input_byte); serial_line_init(); diff --git a/arch/platform/sky/Makefile.sky b/arch/platform/sky/Makefile.sky index 0398486b0..9467603a4 100644 --- a/arch/platform/sky/Makefile.sky +++ b/arch/platform/sky/Makefile.sky @@ -4,6 +4,8 @@ CONTIKI_TARGET_SOURCEFILES += contiki-sky-platform.c \ sht11.c sht11-sensor.c light-sensor.c battery-sensor.c \ button-sensor.c +CLEAN += *.sky + include $(CONTIKI)/arch/platform/sky/Makefile.common MODULES += arch/dev/cc2420 arch/dev/sht11 arch/dev/ds2411 os/storage/cfs diff --git a/arch/platform/zoul/orion/Makefile.orion b/arch/platform/zoul/orion/Makefile.orion index e3ecb601b..ebc1bdad4 100644 --- a/arch/platform/zoul/orion/Makefile.orion +++ b/arch/platform/zoul/orion/Makefile.orion @@ -1,6 +1,7 @@ MOTELIST_ZOLERTIA = orion MODULES += arch/dev/enc28j60 CC2538_ENC28J60_ARCH ?= gpio -WITH_IP64 ?= 1 +ifeq ($(WITH_IP64),1) CFLAGS += -DUIP_FALLBACK_INTERFACE=ip64_uip_fallback_interface -BOARD_SOURCEFILES += board.c enc28j60-arch-$(CC2538_ENC28J60_ARCH).c +endif +BOARD_SOURCEFILES += board.c enc28j60-arch-$(CC2538_ENC28J60_ARCH).c leds-arch.c diff --git a/examples/6tisch/6p-packet/Makefile b/examples/6tisch/6p-packet/Makefile index 7e154f9d3..7dcf9ccd3 100644 --- a/examples/6tisch/6p-packet/Makefile +++ b/examples/6tisch/6p-packet/Makefile @@ -1,10 +1,14 @@ -CONTIKI_PROJECT = sixp-node.c +CONTIKI_PROJECT = sixp-node PROJECT_SOURCEFILES += test-sf.c +PLATFORMS_EXCLUDE = sky nrf52dk native +BOARDS_EXCLUDE = srf06/cc13xx launchpad/cc1310 launchpad/cc1350 sensortag/cc2650 sensortag/cc1350 + CONTIKI = ../../../ MAKE_MAC = MAKE_MAC_TSCH MAKE_ROUTING = MAKE_ROUTING_NULLROUTING MODULES += os/net/mac/tsch/sixtop +all: $(CONTIKI_PROJECT) include $(CONTIKI)/Makefile.include diff --git a/examples/6tisch/etsi-plugtest-2017/Makefile b/examples/6tisch/etsi-plugtest-2017/Makefile index f09edc0a7..3279b6ebc 100644 --- a/examples/6tisch/etsi-plugtest-2017/Makefile +++ b/examples/6tisch/etsi-plugtest-2017/Makefile @@ -1,6 +1,9 @@ CONTIKI_PROJECT = node all: $(CONTIKI_PROJECT) +PLATFORMS_EXCLUDE = sky nrf52dk native +BOARDS_EXCLUDE = srf06/cc13xx launchpad/cc1310 launchpad/cc1350 sensortag/cc2650 sensortag/cc1350 + MAKE_WITH_SECURITY ?= 0 # force Security from command line ifeq ($(MAKE_WITH_SECURITY),1) CFLAGS += -DWITH_SECURITY=1 diff --git a/examples/6tisch/simple-node/Makefile b/examples/6tisch/simple-node/Makefile index fbdeb804a..63ce8ecbd 100644 --- a/examples/6tisch/simple-node/Makefile +++ b/examples/6tisch/simple-node/Makefile @@ -1,6 +1,9 @@ CONTIKI_PROJECT = node all: $(CONTIKI_PROJECT) +PLATFORMS_EXCLUDE = sky nrf52dk native +BOARDS_EXCLUDE = srf06/cc13xx launchpad/cc1310 launchpad/cc1350 sensortag/cc2650 sensortag/cc1350 + CONTIKI=../../.. # force Orchestra from command line diff --git a/examples/6tisch/sixtop/Makefile b/examples/6tisch/sixtop/Makefile index 42360f170..5ca6be853 100644 --- a/examples/6tisch/sixtop/Makefile +++ b/examples/6tisch/sixtop/Makefile @@ -1,6 +1,9 @@ CONTIKI_PROJECT = node-sixtop all: $(CONTIKI_PROJECT) +PLATFORMS_EXCLUDE = sky nrf52dk native +BOARDS_EXCLUDE = srf06/cc13xx launchpad/cc1310 launchpad/cc1350 sensortag/cc2650 sensortag/cc1350 + PROJECT_SOURCEFILES += sf-simple.c CONTIKI=../../.. diff --git a/examples/coap/Makefile b/examples/coap/Makefile index e2c6e4a5d..1195a37a3 100644 --- a/examples/coap/Makefile +++ b/examples/coap/Makefile @@ -1,8 +1,13 @@ -all: coap-example-server coap-example-client +CONTIKI_PROJECT = coap-example-server coap-example-client # use target "plugtest-server" explicitly when required +all: $(CONTIKI_PROJECT) + CONTIKI=../.. +# Do not try to build on Sky because of code size limitation +PLATFORMS_EXCLUDE = sky + # build RESTful resources include $(CONTIKI)/Makefile.identify-target ifeq ($(TARGET),native) diff --git a/examples/dev/gpio-hal/Makefile b/examples/dev/gpio-hal/Makefile index d20495a60..efbdf6e05 100644 --- a/examples/dev/gpio-hal/Makefile +++ b/examples/dev/gpio-hal/Makefile @@ -1,6 +1,8 @@ CONTIKI_PROJECT = gpio-hal-example CONTIKI = ../../.. +PLATFORMS_ONLY = srf06-cc26xx cc2538dk openmote-cc2538 zoul + include $(CONTIKI)/Makefile.identify-target MODULES_REL += $(TARGET) diff --git a/examples/dev/rgb-led/Makefile b/examples/dev/rgb-led/Makefile index 0b3f4b229..e2142cf2d 100644 --- a/examples/dev/rgb-led/Makefile +++ b/examples/dev/rgb-led/Makefile @@ -3,6 +3,8 @@ CONTIKI = ../../.. MODULES_REL += $(TARGET) +PLATFORMS_ONLY = zoul + all: $(CONTIKI_PROJECT) include $(CONTIKI)/Makefile.include diff --git a/examples/http-socket/Makefile b/examples/http-socket/Makefile index e1904d3ab..87d0789c1 100644 --- a/examples/http-socket/Makefile +++ b/examples/http-socket/Makefile @@ -1,5 +1,8 @@ -all: http-example websocket-example +CONTIKI_PROJECT = http-example websocket-example +all: $(CONTIKI_PROJECT) CONTIKI=../.. MODULES += os/net/app-layer/http-socket +PLATFORMS_EXCLUDE = sky + include $(CONTIKI)/Makefile.include diff --git a/examples/http-socket/websocket-node/Makefile b/examples/http-socket/websocket-node/Makefile index cde795492..9dcc1def8 100644 --- a/examples/http-socket/websocket-node/Makefile +++ b/examples/http-socket/websocket-node/Makefile @@ -4,3 +4,10 @@ install: run: nodejs example-server.js + +# Needed by the build all script +all: + true + +clean: + rm -rf node_modules diff --git a/examples/ip64-router/Makefile b/examples/ip64-router/Makefile index a77652cfa..0beea11bd 100644 --- a/examples/ip64-router/Makefile +++ b/examples/ip64-router/Makefile @@ -1,4 +1,11 @@ -all: ip64-router +CONTIKI_PROJECT = ip64-router +all: $(CONTIKI_PROJECT) CONTIKI=../.. +# Currently only supported on Orion, the only platform with 802.15.4 + Ethernet +PLATFORMS_ONLY = zoul +BOARDS_ONLY = orion +BOARD = orion +WITH_IP64 = 1 + include $(CONTIKI)/Makefile.include diff --git a/examples/ipso-objects/Makefile b/examples/ipso-objects/Makefile index d4a1ef503..d77f4200a 100644 --- a/examples/ipso-objects/Makefile +++ b/examples/ipso-objects/Makefile @@ -2,6 +2,8 @@ CONTIKI_PROJECT = example-ipso-objects CONTIKI_SOURCEFILES += serial-protocol.c example-ipso-temperature.c +PLATFORMS_EXCLUDE = sky + all: $(CONTIKI_PROJECT) MODULES += os/net/app-layer/coap diff --git a/examples/ipv6-hooks/Makefile b/examples/ipv6-hooks/Makefile index bbd4b7168..be8cc953e 100644 --- a/examples/ipv6-hooks/Makefile +++ b/examples/ipv6-hooks/Makefile @@ -1,4 +1,5 @@ -all: ipv6-hooks +CONTIKI_PROJECT = ipv6-hooks +all: $(CONTIKI_PROJECT) CONTIKI=../.. include $(CONTIKI)/Makefile.include diff --git a/examples/libs/logging/Makefile b/examples/libs/logging/Makefile index d394c0bc4..eead5bc90 100644 --- a/examples/libs/logging/Makefile +++ b/examples/libs/logging/Makefile @@ -1,5 +1,8 @@ CONTIKI_PROJECT = logging all: $(CONTIKI_PROJECT) +# Does not fit on Sky +PLATFORMS_EXCLUDE = sky + CONTIKI = ../../.. include $(CONTIKI)/Makefile.include diff --git a/examples/libs/stack-check/Makefile b/examples/libs/stack-check/Makefile index 243679d51..02b94cfc0 100644 --- a/examples/libs/stack-check/Makefile +++ b/examples/libs/stack-check/Makefile @@ -1,5 +1,7 @@ CONTIKI_PROJECT = example-stack-check all: $(CONTIKI_PROJECT) +PLATFORMS_EXCLUDE = native cooja + CONTIKI = ../../.. include $(CONTIKI)/Makefile.include diff --git a/examples/multicast/Makefile b/examples/multicast/Makefile index 2337ea60f..6037c8172 100644 --- a/examples/multicast/Makefile +++ b/examples/multicast/Makefile @@ -1,8 +1,14 @@ CONTIKI_PROJECT = root intermediate sink all: $(CONTIKI_PROJECT) +# nrf52dk only supports slave mode, i.e., with no routing +PLATFORMS_EXCLUDE = nrf52dk + CONTIKI = ../.. +include $(CONTIKI)/Makefile.identify-target +MODULES_REL += $(TARGET) + MODULES += os/net/ipv6/multicast MAKE_ROUTING = MAKE_ROUTING_RPL_CLASSIC diff --git a/examples/multicast/zoul/module-macros.h b/examples/multicast/zoul/module-macros.h new file mode 100644 index 000000000..7029c60ea --- /dev/null +++ b/examples/multicast/zoul/module-macros.h @@ -0,0 +1,2 @@ +/* Get some extra RAM */ +#define LPM_CONF_MAX_PM 1 diff --git a/examples/nullnet/Makefile b/examples/nullnet/Makefile index 045a175cb..10a113798 100644 --- a/examples/nullnet/Makefile +++ b/examples/nullnet/Makefile @@ -3,6 +3,8 @@ all: $(CONTIKI_PROJECT) CONTIKI = ../.. +PLATFORMS_EXCLUDE = nrf52dk + #use this to enable TSCH: MAKE_MAC = MAKE_MAC_TSCH MAKE_MAC ?= MAKE_MAC_CSMA MAKE_NET = MAKE_NET_NULLNET diff --git a/examples/platform-specific/cc2538-common/Makefile b/examples/platform-specific/cc2538-common/Makefile index 70ef1bc3f..c55c65eaf 100644 --- a/examples/platform-specific/cc2538-common/Makefile +++ b/examples/platform-specific/cc2538-common/Makefile @@ -2,5 +2,7 @@ CONTIKI_PROJECT = test-pwm timer-test test-uart all: $(CONTIKI_PROJECT) +PLATFORMS_ONLY = cc2538dk openmote-cc2538 zoul + CONTIKI = ../../.. include $(CONTIKI)/Makefile.include diff --git a/examples/platform-specific/cc2538-common/crypto/Makefile b/examples/platform-specific/cc2538-common/crypto/Makefile index b621dac95..2191d44f0 100644 --- a/examples/platform-specific/cc2538-common/crypto/Makefile +++ b/examples/platform-specific/cc2538-common/crypto/Makefile @@ -3,5 +3,7 @@ CONTIKI_PROJECT += sha256-test all: $(CONTIKI_PROJECT) +PLATFORMS_ONLY = cc2538dk openmote-cc2538 zoul + CONTIKI = ../../../.. include $(CONTIKI)/Makefile.include diff --git a/examples/platform-specific/cc2538-common/mqtt-demo/Makefile b/examples/platform-specific/cc2538-common/mqtt-demo/Makefile index 1295da093..ec29183b6 100644 --- a/examples/platform-specific/cc2538-common/mqtt-demo/Makefile +++ b/examples/platform-specific/cc2538-common/mqtt-demo/Makefile @@ -1,5 +1,7 @@ -all: mqtt-demo +CONTIKI_PROJECT = mqtt-demo +all: $(CONTIKI_PROJECT) +PLATFORMS_ONLY = cc2538dk openmote-cc2538 zoul MODULES += os/net/app-layer/mqtt diff --git a/examples/platform-specific/cc2538-common/pka/Makefile b/examples/platform-specific/cc2538-common/pka/Makefile index 488e27db9..01ba6fe62 100644 --- a/examples/platform-specific/cc2538-common/pka/Makefile +++ b/examples/platform-specific/cc2538-common/pka/Makefile @@ -2,5 +2,7 @@ CONTIKI_PROJECT = ecc-ecdh ecc-sign ecc-verify all: $(CONTIKI_PROJECT) +PLATFORMS_ONLY = cc2538dk openmote-cc2538 zoul + CONTIKI = ../../../.. include $(CONTIKI)/Makefile.include diff --git a/examples/platform-specific/cc26xx/Makefile b/examples/platform-specific/cc26xx/Makefile index 80506b26b..40e484bcc 100644 --- a/examples/platform-specific/cc26xx/Makefile +++ b/examples/platform-specific/cc26xx/Makefile @@ -1,5 +1,7 @@ CONTIKI_PROJECT = cc26xx-demo +PLATFORMS_ONLY = srf06-cc26xx + all: $(CONTIKI_PROJECT) CONTIKI = ../../.. diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/Makefile b/examples/platform-specific/cc26xx/cc26xx-web-demo/Makefile index bc024b826..3ddf9671b 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/Makefile +++ b/examples/platform-specific/cc26xx/cc26xx-web-demo/Makefile @@ -1,4 +1,7 @@ -all: cc26xx-web-demo +CONTIKI_PROJECT = cc26xx-web-demo +all: $(CONTIKI_PROJECT) + +PLATFORMS_ONLY = srf06-cc26xx MODULES_REL += ./resources diff --git a/examples/platform-specific/cc26xx/very-sleepy-demo/Makefile b/examples/platform-specific/cc26xx/very-sleepy-demo/Makefile index 21f6acc1d..46da822d3 100644 --- a/examples/platform-specific/cc26xx/very-sleepy-demo/Makefile +++ b/examples/platform-specific/cc26xx/very-sleepy-demo/Makefile @@ -1,5 +1,7 @@ CONTIKI_PROJECT = very-sleepy-demo +PLATFORMS_ONLY = srf06-cc26xx + all: $(CONTIKI_PROJECT) MODULES += os/net/app-layer/coap diff --git a/examples/platform-specific/jn516x/dr1175-sensors/Makefile b/examples/platform-specific/jn516x/dr1175-sensors/Makefile index 90be80149..23b1c50d7 100644 --- a/examples/platform-specific/jn516x/dr1175-sensors/Makefile +++ b/examples/platform-specific/jn516x/dr1175-sensors/Makefile @@ -1,6 +1,8 @@ CONTIKI=../../../.. CONTIKI_PROJECT = node +PLATFORMS_ONLY = jn516x + TARGET ?= jn516x JN516x_WITH_DR1175 = 1 diff --git a/examples/platform-specific/jn516x/rpl/coap-dongle-node/Makefile b/examples/platform-specific/jn516x/rpl/coap-dongle-node/Makefile index 538bacf91..d0437d869 100644 --- a/examples/platform-specific/jn516x/rpl/coap-dongle-node/Makefile +++ b/examples/platform-specific/jn516x/rpl/coap-dongle-node/Makefile @@ -1,6 +1,8 @@ CONTIKI_PROJECT = dongle-node all: $(CONTIKI_PROJECT) +PLATFORMS_ONLY = jn516x + TARGET ?= jn516x JN516x_WITH_DONGLE = 1 diff --git a/examples/platform-specific/jn516x/rpl/coap-dr1175-node/Makefile b/examples/platform-specific/jn516x/rpl/coap-dr1175-node/Makefile index 6fb119351..3670d12c4 100644 --- a/examples/platform-specific/jn516x/rpl/coap-dr1175-node/Makefile +++ b/examples/platform-specific/jn516x/rpl/coap-dr1175-node/Makefile @@ -1,6 +1,8 @@ CONTIKI_PROJECT = dr1175-node all: $(CONTIKI_PROJECT) +PLATFORMS_ONLY = jn516x + TARGET ?= jn516x JN516x_WITH_DR1175 = 1 diff --git a/examples/platform-specific/jn516x/rpl/coap-dr1199-node/Makefile b/examples/platform-specific/jn516x/rpl/coap-dr1199-node/Makefile index bdef1a42a..b2286e272 100644 --- a/examples/platform-specific/jn516x/rpl/coap-dr1199-node/Makefile +++ b/examples/platform-specific/jn516x/rpl/coap-dr1199-node/Makefile @@ -1,6 +1,8 @@ CONTIKI_PROJECT = dr1199-node all: $(CONTIKI_PROJECT) +PLATFORMS_ONLY = jn516x + TARGET ?= jn516x JN516x_WITH_DR1199 = 1 diff --git a/examples/platform-specific/jn516x/rpl/node/Makefile b/examples/platform-specific/jn516x/rpl/node/Makefile index 228287cf8..b5a14023a 100644 --- a/examples/platform-specific/jn516x/rpl/node/Makefile +++ b/examples/platform-specific/jn516x/rpl/node/Makefile @@ -1,6 +1,8 @@ CONTIKI_PROJECT = node all: $(CONTIKI_PROJECT) +PLATFORMS_ONLY = jn516x + TARGET ?= jn516x CONTIKI=../../../../.. diff --git a/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/Makefile b/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/Makefile index 82685c610..2880a76de 100644 --- a/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/Makefile +++ b/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/Makefile @@ -1,5 +1,7 @@ CONTIKI_PROJECT = node +PLATFORMS_ONLY = jn516x + TARGET ?= jn516x JN516x_WITH_DONGLE = 1 diff --git a/examples/platform-specific/jn516x/tsch/tx-power-verification/node/Makefile b/examples/platform-specific/jn516x/tsch/tx-power-verification/node/Makefile index 43a0490ce..d19228f4d 100644 --- a/examples/platform-specific/jn516x/tsch/tx-power-verification/node/Makefile +++ b/examples/platform-specific/jn516x/tsch/tx-power-verification/node/Makefile @@ -1,5 +1,7 @@ CONTIKI_PROJECT = node +PLATFORMS_ONLY = jn516x + TARGET ?= jn516x JN516x_WITH_DONGLE = 1 diff --git a/examples/platform-specific/jn516x/tsch/tx-power-verification/rpl-border-router/Makefile b/examples/platform-specific/jn516x/tsch/tx-power-verification/rpl-border-router/Makefile index edbc2fe19..27454bda2 100644 --- a/examples/platform-specific/jn516x/tsch/tx-power-verification/rpl-border-router/Makefile +++ b/examples/platform-specific/jn516x/tsch/tx-power-verification/rpl-border-router/Makefile @@ -1,5 +1,7 @@ CONTIKI_PROJECT=rpl-border-router +PLATFORMS_ONLY = jn516x + TARGET ?= jn516x JN516x_WITH_DONGLE = 1 diff --git a/examples/platform-specific/jn516x/tsch/uart1-test-node/Makefile b/examples/platform-specific/jn516x/tsch/uart1-test-node/Makefile index 1dd86cc3d..22c5ee216 100644 --- a/examples/platform-specific/jn516x/tsch/uart1-test-node/Makefile +++ b/examples/platform-specific/jn516x/tsch/uart1-test-node/Makefile @@ -1,5 +1,7 @@ CONTIKI_PROJECT = uart1-test-node +PLATFORMS_ONLY = jn516x + TARGET = jn516x JN516x_WITH_DR1174 = 1 TARGET_WITH_UART1 = 1 diff --git a/examples/platform-specific/nrf52dk/blink-hello/Makefile b/examples/platform-specific/nrf52dk/blink-hello/Makefile index 9bc1ee34f..393a385c3 100644 --- a/examples/platform-specific/nrf52dk/blink-hello/Makefile +++ b/examples/platform-specific/nrf52dk/blink-hello/Makefile @@ -6,5 +6,7 @@ NRF52_WITHOUT_SOFTDEVICE=1 all: $(CONTIKI_PROJECT) +PLATFORMS_ONLY = nrf52dk + CONTIKI = ../../../.. include $(CONTIKI)/Makefile.include diff --git a/examples/platform-specific/nrf52dk/coap-demo/Makefile b/examples/platform-specific/nrf52dk/coap-demo/coap-client/Makefile similarity index 53% rename from examples/platform-specific/nrf52dk/coap-demo/Makefile rename to examples/platform-specific/nrf52dk/coap-demo/coap-client/Makefile index 39692524d..b7a5ff778 100644 --- a/examples/platform-specific/nrf52dk/coap-demo/Makefile +++ b/examples/platform-specific/nrf52dk/coap-demo/coap-client/Makefile @@ -1,19 +1,19 @@ -CONTIKI=../../../.. +CONTIKI_PROJECT = coap-client +CONTIKI=../../../../.. -ifeq ($(MAKECMDGOALS),) -$(error Please specify whether coap-client or coap-server should be built) -endif +PLATFORMS_ONLY = nrf52dk -ifneq ($(filter coap-client coap-client.flash, $(MAKECMDGOALS)),) ifeq ($(SERVER_IPV6_EP),) -$(error Please define SERVER_IPV6_EP=) -else +$(warning Please define SERVER_IPV6_EP=) +$(warning Using default SERVER_IPV6_EP=fd00::1) +SERVER_IPV6_EP=fd00::1 +endif + CFLAGS += -DSERVER_IPV6_EP=\"$(SERVER_IPV6_EP)\" + CFLAGS += -DDEVICE_NAME=\"nRF52_DK_CoAP_Client\" -endif -else -CFLAGS += -DDEVICE_NAME=\"nRF52-DK-CoAP-Server\" -endif + +CFLAGS += -DCOAP_OBSERVE_CLIENT=1 # automatically build RESTful resources MODULES_REL += ./resources @@ -23,4 +23,6 @@ MODULES += os/net/app-layer/coap MAKE_ROUTING = MAKE_ROUTING_NULLROUTING +all: $(CONTIKI_PROJECT) + include $(CONTIKI)/Makefile.include diff --git a/examples/platform-specific/nrf52dk/coap-demo/Makefile.target b/examples/platform-specific/nrf52dk/coap-demo/coap-client/Makefile.target similarity index 100% rename from examples/platform-specific/nrf52dk/coap-demo/Makefile.target rename to examples/platform-specific/nrf52dk/coap-demo/coap-client/Makefile.target diff --git a/examples/platform-specific/nrf52dk/coap-demo/coap-client.c b/examples/platform-specific/nrf52dk/coap-demo/coap-client/coap-client.c similarity index 100% rename from examples/platform-specific/nrf52dk/coap-demo/coap-client.c rename to examples/platform-specific/nrf52dk/coap-demo/coap-client/coap-client.c diff --git a/examples/platform-specific/nrf52dk/coap-demo/coap-server/Makefile b/examples/platform-specific/nrf52dk/coap-demo/coap-server/Makefile new file mode 100644 index 000000000..0202f0e92 --- /dev/null +++ b/examples/platform-specific/nrf52dk/coap-demo/coap-server/Makefile @@ -0,0 +1,22 @@ +CONTIKI_PROJECT = coap-server +CONTIKI=../../../../.. + +PLATFORMS_ONLY = nrf52dk + +CFLAGS += -DDEVICE_NAME=\"nRF52-DK-CoAP-Server\" + +# automatically build RESTful resources +REST_RESOURCES_DIR = ../resources +REST_RESOURCES_FILES = $(notdir $(shell find $(REST_RESOURCES_DIR) -name '*.c' ! -name 'res-plugtest*')) + +PROJECTDIRS += $(REST_RESOURCES_DIR) +PROJECT_SOURCEFILES += $(REST_RESOURCES_FILES) + +# REST Engine shall use Erbium CoAP implementation +MODULES += os/net/app-layer/coap + +MAKE_ROUTING = MAKE_ROUTING_NULLROUTING + +all: $(CONTIKI_PROJECT) + +include $(CONTIKI)/Makefile.include diff --git a/examples/platform-specific/nrf52dk/coap-demo/coap-server/Makefile.target b/examples/platform-specific/nrf52dk/coap-demo/coap-server/Makefile.target new file mode 100644 index 000000000..3853b313a --- /dev/null +++ b/examples/platform-specific/nrf52dk/coap-demo/coap-server/Makefile.target @@ -0,0 +1 @@ +TARGET = nrf52dk diff --git a/examples/platform-specific/nrf52dk/coap-demo/coap-server.c b/examples/platform-specific/nrf52dk/coap-demo/coap-server/coap-server.c similarity index 100% rename from examples/platform-specific/nrf52dk/coap-demo/coap-server.c rename to examples/platform-specific/nrf52dk/coap-demo/coap-server/coap-server.c diff --git a/examples/platform-specific/nrf52dk/mqtt-demo/Makefile b/examples/platform-specific/nrf52dk/mqtt-demo/Makefile index d32903531..dc3e23e67 100644 --- a/examples/platform-specific/nrf52dk/mqtt-demo/Makefile +++ b/examples/platform-specific/nrf52dk/mqtt-demo/Makefile @@ -1,4 +1,7 @@ -all: mqtt-demo +CONTIKI_PROJECT = mqtt-demo +all: $(CONTIKI_PROJECT) + +PLATFORMS_ONLY = nrf52dk MAKE_ROUTING = MAKE_ROUTING_NULLROUTING diff --git a/examples/platform-specific/nrf52dk/timer-test/Makefile b/examples/platform-specific/nrf52dk/timer-test/Makefile index c5ddcfbd2..da515a62e 100644 --- a/examples/platform-specific/nrf52dk/timer-test/Makefile +++ b/examples/platform-specific/nrf52dk/timer-test/Makefile @@ -1,5 +1,7 @@ CONTIKI_PROJECT = timer-test +PLATFORMS_ONLY = nrf52dk + MAKE_ROUTING = MAKE_ROUTING_NULLROUTING MAKE_MAC=MAKE_MAC_NULLMAC NRF52_WITHOUT_SOFTDEVICE=1 diff --git a/examples/platform-specific/zoul/Makefile b/examples/platform-specific/zoul/Makefile index 3b8a3a751..88dcb3ce2 100644 --- a/examples/platform-specific/zoul/Makefile +++ b/examples/platform-specific/zoul/Makefile @@ -15,5 +15,7 @@ MODULES += arch/dev/bme280 all: $(CONTIKI_PROJECT) +PLATFORMS_ONLY = zoul + CONTIKI = ../../.. include $(CONTIKI)/Makefile.include diff --git a/examples/platform-specific/zoul/at-test/Makefile b/examples/platform-specific/zoul/at-test/Makefile index 04d282aaa..df8ef9da8 100644 --- a/examples/platform-specific/zoul/at-test/Makefile +++ b/examples/platform-specific/zoul/at-test/Makefile @@ -2,5 +2,7 @@ CONTIKI_PROJECT = at-master-test MODULES = os/services/at-master all: $(CONTIKI_PROJECT) +PLATFORMS_ONLY = zoul + CONTIKI = ../../../.. include $(CONTIKI)/Makefile.include diff --git a/examples/platform-specific/zoul/orion/README.md b/examples/platform-specific/zoul/orion/README.md index bd57b5284..d32cc4bcb 100644 --- a/examples/platform-specific/zoul/orion/README.md +++ b/examples/platform-specific/zoul/orion/README.md @@ -25,7 +25,7 @@ To compile and flash run: ```` cd ip64-router -make TARGET=zoul BOARD=router ip64-router.upload +make TARGET=zoul BOARD=orion ip64-router.upload ```` As default we enable the `DHCP` support for autoconfiguration. Just connect to a DHCP-enabled device to obtain an IPv4 IP address and that's it!. diff --git a/examples/platform-specific/zoul/orion/client/Makefile b/examples/platform-specific/zoul/orion/client/Makefile index de6df0e34..22354dc98 100644 --- a/examples/platform-specific/zoul/orion/client/Makefile +++ b/examples/platform-specific/zoul/orion/client/Makefile @@ -1,4 +1,4 @@ -CONTIKI_PROJECT = client ifttt_client +CONTIKI_PROJECT = client ifttt-client all: $(CONTIKI_PROJECT) BOARD = orion @@ -7,5 +7,8 @@ MODULES += os/net/app-layer/http-socket WITH_IP64 = 1 +PLATFORMS_ONLY = zoul +BOARDS_ONLY = orion + CONTIKI = ../../../../.. include $(CONTIKI)/Makefile.include diff --git a/examples/platform-specific/zoul/orion/client/project-conf.h b/examples/platform-specific/zoul/orion/client/project-conf.h index ca2361f0a..0bc244395 100644 --- a/examples/platform-specific/zoul/orion/client/project-conf.h +++ b/examples/platform-specific/zoul/orion/client/project-conf.h @@ -31,6 +31,10 @@ /*---------------------------------------------------------------------------*/ #ifndef PROJECT_CONF_H_ #define PROJECT_CONF_H_ + +/* Prevent the router from dropping below LPM2 to avoid RAM overflow */ +#define LPM_CONF_MAX_PM 0 + /*---------------------------------------------------------------------------*/ /* Use either the cc1200_driver for sub-1GHz, or cc2538_rf_driver (default) * for 2.4GHz built-in radio interface @@ -40,9 +44,10 @@ /* Alternate between ANTENNA_SW_SELECT_SUBGHZ or ANTENNA_SW_SELECT_2_4GHZ */ #define ANTENNA_SW_SELECT_DEF_CONF ANTENNA_SW_SELECT_2_4GHZ +#define UIP_CONF_TCP 1 #define RESOLV_CONF_SUPPORTS_MDNS 0 #define NETSTCK_ROUTING_STATE_SIZE 3 -#define NBR_TABLE_CONF_MAX_NEIGHBORS 3 +#define NBR_TABLE_CONF_MAX_NEIGHBORS 3 #define HTTP_CLIENT_BUFFER_LEN 256 diff --git a/examples/platform-specific/zoul/orion/ip64-router/Makefile b/examples/platform-specific/zoul/orion/ip64-router/Makefile index 8300617ca..4d532912a 100644 --- a/examples/platform-specific/zoul/orion/ip64-router/Makefile +++ b/examples/platform-specific/zoul/orion/ip64-router/Makefile @@ -1,4 +1,5 @@ -all: ip64-router +CONTIKI_PROJECT = ip64-router +all: $(CONTIKI_PROJECT) BOARD = orion @@ -8,4 +9,7 @@ WITH_IP64 = 1 PROJECT_SOURCEFILES += httpd-simple.c +PLATFORMS_ONLY = zoul +BOARDS_ONLY = orion + include $(CONTIKI)/Makefile.include diff --git a/examples/platform-specific/zoul/rev-b/Makefile b/examples/platform-specific/zoul/rev-b/Makefile index 61d9cf432..43d381c3f 100644 --- a/examples/platform-specific/zoul/rev-b/Makefile +++ b/examples/platform-specific/zoul/rev-b/Makefile @@ -4,5 +4,8 @@ BOARD ?= remote-revb all: $(CONTIKI_PROJECT) +PLATFORMS_ONLY = zoul +BOARDS_ONLY = remote-revb + CONTIKI = ../../../.. include $(CONTIKI)/Makefile.include diff --git a/examples/platform-specific/zoul/rtcc/Makefile b/examples/platform-specific/zoul/rtcc/Makefile index 9aca10bbc..9a3bc0aec 100644 --- a/examples/platform-specific/zoul/rtcc/Makefile +++ b/examples/platform-specific/zoul/rtcc/Makefile @@ -4,5 +4,9 @@ TARGET = zoul all: $(CONTIKI_PROJECT) +PLATFORMS_ONLY = zoul +# Only the Re-Mote is equiped with an RTCC +BOARDS_ONLY = remote-reva remote-revb + CONTIKI = ../../../.. include $(CONTIKI)/Makefile.include diff --git a/examples/rpl-border-router/Makefile b/examples/rpl-border-router/Makefile index d8b14d5bd..4d2db2a85 100644 --- a/examples/rpl-border-router/Makefile +++ b/examples/rpl-border-router/Makefile @@ -2,6 +2,9 @@ CONTIKI_PROJECT = border-router all: $(CONTIKI_PROJECT) CONTIKI = ../.. +# The BR is either native or embedded, and in the latter case must support SLIP +PLATFORMS_EXCLUDE = nrf52dk + # Include RPL BR module MODULES += os/services/rpl-border-router # Include webserver module diff --git a/examples/rpl-udp/Makefile b/examples/rpl-udp/Makefile index e779b1680..26190e839 100644 --- a/examples/rpl-udp/Makefile +++ b/examples/rpl-udp/Makefile @@ -1,4 +1,5 @@ -all: udp-client udp-server +CONTIKI_PROJECT = udp-client udp-server +all: $(CONTIKI_PROJECT) .PHONY: renode renode: all diff --git a/examples/sensniff/Makefile b/examples/sensniff/Makefile index a3c3286f2..e207590bb 100644 --- a/examples/sensniff/Makefile +++ b/examples/sensniff/Makefile @@ -1,6 +1,8 @@ CONTIKI_PROJECT = sensniff CONTIKI = ../.. +PLATFORMS_ONLY = cc2538dk openmote-cc2538 zoul srf06-cc26xx jn516x + PROJECT_SOURCEFILES += sensniff-mac.c netstack.c MODULES_REL += pool $(TARGET) diff --git a/examples/slip-radio/Makefile b/examples/slip-radio/Makefile index 6b30b2d13..877b109f1 100644 --- a/examples/slip-radio/Makefile +++ b/examples/slip-radio/Makefile @@ -2,6 +2,9 @@ CONTIKI_PROJECT=slip-radio all: $(CONTIKI_PROJECT) MODULES += os/services/slip-cmd +# slip-radio is only intended for platforms with SLIP support +PLATFORMS_EXCLUDE = native nrf52dk + CONTIKI=../.. include $(CONTIKI)/Makefile.identify-target diff --git a/examples/storage/antelope-shell/Makefile b/examples/storage/antelope-shell/Makefile index c6ffd276b..3b3f7fd23 100644 --- a/examples/storage/antelope-shell/Makefile +++ b/examples/storage/antelope-shell/Makefile @@ -2,6 +2,10 @@ CONTIKI = ../../.. MODULES += os/storage/antelope os/services/unit-test -all: shell-db +# does not fit on Sky +PLATFORMS_ONLY= cc2538 + +CONTIKI_PROJECT = shell-db +all: $(CONTIKI_PROJECT) include $(CONTIKI)/Makefile.include diff --git a/examples/storage/cfs-coffee/Makefile b/examples/storage/cfs-coffee/Makefile index 31a1aea59..10d6256fa 100644 --- a/examples/storage/cfs-coffee/Makefile +++ b/examples/storage/cfs-coffee/Makefile @@ -1,8 +1,11 @@ CONTIKI = ../../.. +PLATFORMS_ONLY= cc2538 sky + MODULES += os/services/unit-test MODULES += os/storage/cfs -all: test-cfs test-coffee example-coffee +CONTIKI_PROJECT = test-cfs test-coffee example-coffee +all: $(CONTIKI_PROJECT) include $(CONTIKI)/Makefile.include diff --git a/os/net/ipv6/uip6.c b/os/net/ipv6/uip6.c index de14486b9..e913a83e1 100644 --- a/os/net/ipv6/uip6.c +++ b/os/net/ipv6/uip6.c @@ -1256,9 +1256,9 @@ uip_process(uint8_t flag) uip_ext_bitmap = 0; #endif /* UIP_CONF_ROUTER */ -#if UIP_IPV6_MULTICAST +#if UIP_IPV6_MULTICAST && UIP_CONF_ROUTER process: -#endif +#endif /* UIP_IPV6_MULTICAST && UIP_CONF_ROUTER */ while(1) { switch(*uip_next_hdr){ diff --git a/tests/01-compile-base/Makefile b/tests/01-compile-base/Makefile index d043c9d6e..0c7e248e0 100644 --- a/tests/01-compile-base/Makefile +++ b/tests/01-compile-base/Makefile @@ -13,12 +13,14 @@ libs/energest/native \ libs/energest/sky \ libs/data-structures/native \ libs/data-structures/sky \ +libs/stack-check/sky \ ipso-objects/native \ ipso-objects/native:MAKE_WITH_DTLS=1 \ rpl-udp/sky \ rpl-border-router/native \ rpl-border-router/sky \ slip-radio/sky \ +ipv6-hooks/sky \ nullnet/native \ TOOLS= diff --git a/tests/02-compile-arm-ports-01/Makefile b/tests/02-compile-arm-ports-01/Makefile index 3840e2b95..e0369319f 100644 --- a/tests/02-compile-arm-ports-01/Makefile +++ b/tests/02-compile-arm-ports-01/Makefile @@ -47,8 +47,8 @@ hello-world/cc2538dk \ rpl-border-router/cc2538dk \ rpl-border-router/cc2538dk:MAKE_ROUTING=MAKE_ROUTING_RPL_CLASSIC \ hello-world/nrf52dk \ -platform-specific/nrf52dk/coap-demo/nrf52dk:coap-server \ -platform-specific/nrf52dk/coap-demo/nrf52dk:coap-client:SERVER_IPV6_EP=ffff \ +platform-specific/nrf52dk/coap-demo/coap-server/nrf52dk \ +platform-specific/nrf52dk/coap-demo/coap-client/nrf52dk:SERVER_IPV6_EP=ffff \ platform-specific/nrf52dk/mqtt-demo/nrf52dk \ platform-specific/nrf52dk/blink-hello/nrf52dk \ platform-specific/nrf52dk/timer-test/nrf52dk \ diff --git a/tests/03-compile-arm-ports-02/Makefile b/tests/03-compile-arm-ports-02/Makefile index 01aab98b6..c0f1b7704 100644 --- a/tests/03-compile-arm-ports-02/Makefile +++ b/tests/03-compile-arm-ports-02/Makefile @@ -8,11 +8,13 @@ platform-specific/cc2538-common/mqtt-demo/zoul \ platform-specific/cc2538-common/crypto/zoul \ platform-specific/cc2538-common/pka/zoul \ platform-specific/zoul/orion/ip64-router/zoul:BOARD=orion \ +platform-specific/zoul/orion/client/zoul:BOARD=orion \ platform-specific/zoul/rev-b/zoul:BOARD=remote-revb \ platform-specific/zoul/at-test/zoul \ platform-specific/zoul/rtcc/zoul \ platform-specific/zoul/zoul \ coap/zoul \ +multicast/zoul \ ipso-objects/zoul \ ipso-objects/zoul:MAKE_WITH_DTLS=1 \ hello-world/zoul \ @@ -55,7 +57,8 @@ hello-world/openmote-cc2538 \ rpl-udp/openmote-cc2538 \ dev/gpio-hal/openmote-cc2538 \ dev/leds/openmote-cc2538 \ -rpl-border-router/openmote-cc2538 +rpl-border-router/openmote-cc2538 \ +ipv6-hooks/openmote-cc2538 \ TOOLS= diff --git a/tests/compile-all/Makefile b/tests/compile-all/Makefile new file mode 100644 index 000000000..1bd79315c --- /dev/null +++ b/tests/compile-all/Makefile @@ -0,0 +1,5 @@ +all: + ./build.sh all + +clean: + ./build.sh clean diff --git a/tests/compile-all/build.sh b/tests/compile-all/build.sh new file mode 100755 index 000000000..795343eeb --- /dev/null +++ b/tests/compile-all/build.sh @@ -0,0 +1,157 @@ +#!/bin/bash + +# Copyright (c) 2018, University of Bristol +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# Author: Atis Elsts + +# +# This file builds all examples for all platforms, excluding just those +# example and platform combinations that are marked as impossible in the Makefiles +# by using PLATFORMS_EXCLUDE and PLATFORMS_ONLY variables. +# +# This script can also clean all targets. To do that, run: +# ./build.sh clean +# +# To invoke the building for a specific platform, run: +# $ PLATFORMS=zoul ./build.sh +# + +if [[ "$PLATFORMS" == "" ]] +then + PLATFORMS=`ls ../../arch/platform` +fi + +if [[ "$MAKEFILES" == "" ]] +then + MAKEFILES=`find ../../examples/ -name Makefile` +fi + +# Set the make goal the first argument of the script or to "all" if called w/o arguments +if [[ $# -gt 0 ]] +then + GOAL=$1 +else + GOAL="all" +fi + +# Logging level: +# 0 - quiet +# 1 - normal; prints compilation and link messages only on errors +# 2 - print all compilation and link messages +LOG_LEVEL=1 + +if [[ $LOG_LEVEL -ge 1 ]] +then + LOG_INFO=echo + CAT_INFO=cat +else + LOG_INFO=true + CAT_INFO=true +fi + +if [[ $LOG_LEVEL -ge 2 ]] +then + LOG_DEBUG=echo + CAT_DEBUG=cat +else + LOG_DEBUG=true + CAT_DEBUG=true +fi + +NUM_SUCCESS=0 +NUM_FAILED=0 + +FAILED= + +for platform in $PLATFORMS +do + # Cooja is not very friendly for command line builds at the moment + if [[ "$platform" == "cooja" ]] + then + $LOG_INFO "Skipping the Cooja platform" + continue + fi + + if [[ "$platform" == "srf06-cc26xx" ]] + then + # srf06-cc26xx has multiple boards + BOARDS="srf06/cc26xx srf06/cc13xx launchpad/cc2650 launchpad/cc1350 sensortag/cc2650 sensortag/cc1350" + elif [[ "$platform" == "zoul" ]] + then + # Zoul has multiple boards + BOARDS="remote-reva remote-revb firefly-reva firefly orion" + else + # Other platforms have just a single board + BOARDS="default" + fi + + $LOG_INFO "=====================================================" + $LOG_INFO "Going through all examples for platform \"$platform\"" + $LOG_INFO "=====================================================" + for example in $MAKEFILES + do + + for board in $BOARDS + do + example_dir=`dirname "$example"` + + # Clean it before building + make -C "$example_dir" TARGET=$platform BOARD=$board clean 2>&1 >/dev/null + if [[ "$GOAL" == "clean" ]] + then + # do this just for the first board + break + fi + + # Build the goal + $LOG_INFO "make -C \"$example_dir\" -j TARGET=$platform BOARD=$board $GOAL" + if make -C "$example_dir" -j TARGET=$platform BOARD=$board $GOAL 2>&1 >build.log + then + $LOG_INFO "..done" + $CAT_DEBUG build.log + NUM_SUCCESS=$(($NUM_SUCCESS + 1)) + else + $LOG_INFO "Failed to build $example_dir for $platform ($board)" + $CAT_DEBUG build.log + NUM_FAILED=$(($NUM_FAILED + 1)) + FAILED="$FAILED; $example_dir for $platform ($board)" + fi + + # Clean it after building + make -C "$example_dir" TARGET=$platform BOARD=$board clean 2>&1 >/dev/null + done + done +done + +# If building, not cleaning, print so statistics +if [[ "$GOAL" == "all" ]] +then + $LOG_INFO "Number of examples skipped or built successfully: $NUM_SUCCESS" + $LOG_INFO "Number of examples that failed to build: $NUM_FAILED" + $LOG_INFO "Failed examples: $FAILED" +fi