2012-11-12 22:26:17 +00:00
|
|
|
|
## Makefile.CI
|
|
|
|
|
#
|
|
|
|
|
# This is for use on [Travis CI](http://travis-ci.org), which is
|
|
|
|
|
# a free distributed continuous integration service with unique
|
|
|
|
|
# set of features:
|
|
|
|
|
# * uses clean ephemeral virtual machines for every build
|
2012-11-13 18:30:10 +00:00
|
|
|
|
# * integrates with GitHub - triggers builds on push and pull-request
|
2012-11-12 22:26:17 +00:00
|
|
|
|
# * it is open source and free for public repositories
|
|
|
|
|
# * features great web UI and bunch of other stuff
|
|
|
|
|
|
|
|
|
|
JOBS ?= 2
|
|
|
|
|
TAIL ?= tail -n 15
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EXAMPLES_ALL = hello-world
|
|
|
|
|
|
|
|
|
|
EXAMPLES_native = ipv6/native-border-router
|
|
|
|
|
|
2012-11-12 22:26:38 +00:00
|
|
|
|
EXAMPLES_most_non_native = \
|
|
|
|
|
er-rest-example \
|
|
|
|
|
ipv6/rpl-border-router \
|
|
|
|
|
ipv6/rpl-collect \
|
|
|
|
|
ipv6/rpl-udp \
|
|
|
|
|
ipv6/simple-udp-rpl \
|
|
|
|
|
ipv6/slip-radio \
|
|
|
|
|
webserver-ipv6
|
|
|
|
|
|
2012-11-20 17:12:55 +00:00
|
|
|
|
EXAMPLES_econotag = $(EXAMPLES_most_non_native)
|
2012-11-12 22:26:38 +00:00
|
|
|
|
|
2012-11-13 13:39:36 +00:00
|
|
|
|
EXAMPLES_most_avr = $(EXAMPLES_most_non_native)
|
2012-11-13 18:30:10 +00:00
|
|
|
|
|
2012-11-13 13:39:36 +00:00
|
|
|
|
EXAMPLES_micaz = $(EXAMPLES_most_avr)
|
|
|
|
|
EXAMPLES_avr_raven = $(EXAMPLES_most_avr)
|
|
|
|
|
|
2012-11-13 18:30:10 +00:00
|
|
|
|
## MARK_EXAMPLES_$(TARGET) provides the mechanism to
|
|
|
|
|
## build the examples which are known to fail but
|
|
|
|
|
## shouldn't be counted as failing for some reason
|
|
|
|
|
MARK_EXAMPLES_micaz = \
|
|
|
|
|
er-rest-example \
|
|
|
|
|
ipv6/rpl-border-router \
|
|
|
|
|
ipv6/rpl-collect \
|
|
|
|
|
ipv6/rpl-udp \
|
|
|
|
|
ipv6/simple-udp-rpl \
|
|
|
|
|
ipv6/slip-radio \
|
|
|
|
|
webserver-ipv6
|
|
|
|
|
|
|
|
|
|
## EXCLUDE_$(TARGETS) provides the mechanism to
|
|
|
|
|
## not build the examples which are known to fail
|
|
|
|
|
EXCLUDE_avr_raven = ipv6/rpl-collect
|
|
|
|
|
|
2012-11-12 22:26:44 +00:00
|
|
|
|
EXAMPLES_sky = $(EXAMPLES_most_non_native) sky-shell
|
|
|
|
|
|
2012-11-16 10:51:01 +00:00
|
|
|
|
COOJA_TESTS_DIR = tools/cooja/contiki_tests
|
2012-11-19 12:52:28 +00:00
|
|
|
|
COOJA_TESTS_ALL = $(COOJA_TESTS_DIR)/*_helloworld.csc
|
2012-11-16 10:51:01 +00:00
|
|
|
|
## Some Cooja tests can also be excluded:
|
2012-11-19 12:52:28 +00:00
|
|
|
|
#EXCLUDE_COOJA_TESTS = servreg-hack.csc sky_coffee.csc rime_collect.csc rime_trickle.csc
|
2012-11-16 10:51:01 +00:00
|
|
|
|
## And some can also be marked:
|
2012-11-19 12:52:28 +00:00
|
|
|
|
#MARK_COOJA_TESTS = crosslevel.csc ip_sky_telnet_ping.csc
|
2012-11-13 00:07:04 +00:00
|
|
|
|
|
2012-11-12 22:26:17 +00:00
|
|
|
|
CT := \033[0;0m
|
|
|
|
|
|
|
|
|
|
ifdef BOXED_SIGNS
|
|
|
|
|
SKIP_SIGN := ☐
|
|
|
|
|
FAIL_SIGN := ☒
|
|
|
|
|
PASS_SIGN := ☑
|
|
|
|
|
else
|
|
|
|
|
SKIP_SIGN := ✈
|
|
|
|
|
FAIL_SIGN := ✘
|
|
|
|
|
PASS_SIGN := ✔
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
2012-11-13 18:30:10 +00:00
|
|
|
|
## FIXME: this will misbehave when we intend to skip `examples1` but there is also `examples123` that fails also
|
|
|
|
|
SKIP = (echo $(SKIP_LIST) | grep -q $$e && (echo "\033[1;36m $(SKIP_SIGN) ➝ ❨ $$e ⊈ $@ ❩$(CT)"; $(TAIL) $(LOG); echo skip >> results) || false)
|
2012-11-12 22:26:17 +00:00
|
|
|
|
FAIL = (echo "\033[1;35m $(FAIL_SIGN) ➝ ❨ $$e ∉ $@ ❩$(CT)"; $(TAIL) $(LOG); echo fail >> results)
|
|
|
|
|
PASS = (echo "\033[1;32m $(PASS_SIGN) ➝ ❨ $$e ∈ $@ ❩$(CT)"; echo pass >> results)
|
|
|
|
|
|
|
|
|
|
ifeq ($(BUILD_TYPE),multi)
|
|
|
|
|
THIS = $(MAKE) -C examples/$$e TARGET=$@ > $(LOG) 2>&1
|
2012-11-13 18:30:10 +00:00
|
|
|
|
MINE = $(filter-out $(EXCLUDE_$(subst -,_,$@)), $(EXAMPLES_ALL) $(EXAMPLES_$(subst -,_,$@)))
|
|
|
|
|
SKIP_LIST = $(MARK_EXAMPLES_$(subst -,_,$@))
|
2012-11-12 22:26:17 +00:00
|
|
|
|
endif
|
|
|
|
|
|
2012-11-13 00:07:04 +00:00
|
|
|
|
ifeq ($(BUILD_TYPE),cooja)
|
|
|
|
|
JAVA = java -mx512m
|
2012-11-16 10:51:01 +00:00
|
|
|
|
THIS = $(SHELL) -x -c "cd `dirname $$e` && $(JAVA) -jar ../dist/cooja.jar -nogui=`basename $$e`" > $(LOG) #2>&1
|
|
|
|
|
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), $(wildcard $(COOJA_TESTS_ALL)))
|
|
|
|
|
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
|
2012-11-13 00:07:04 +00:00
|
|
|
|
endif
|
|
|
|
|
|
2012-11-12 22:26:17 +00:00
|
|
|
|
LOG = /tmp/$@_`echo $$e | sed 's:/:_:g'`.log
|
|
|
|
|
|
|
|
|
|
%:
|
|
|
|
|
@echo "\033[1;37m ➠ ❨$@❩ $(CT)"
|
2012-11-13 18:30:10 +00:00
|
|
|
|
@for e in $(MINE); do $(THIS) && $(PASS) || $(SKIP) || $(FAIL); done;
|