diff --git a/tests/Makefile.compile-test b/tests/Makefile.compile-test index e30f9da361c8cb7aa4b973153073ff295872daa0..0c0a670444056c863c35b1e5f77178247c33821e 100644 --- a/tests/Makefile.compile-test +++ b/tests/Makefile.compile-test @@ -39,7 +39,7 @@ get_target_vars = $(wordlist 2,15,$(subst :, ,$1)) define dooneexample @echo -n Building example $(3): $(1) $(4) for target $(2) -@((cd $(EXAMPLESDIR)/$(1); \ +@((cd $(EXAMPLESDIR)/$(1) && \ $(MAKE) $(4) TARGET=$(2) clean && make -j $(4) TARGET=$(2) WERROR=1) > \ /dev/null 2>make.err && \ (echo " -> OK" && printf "%-75s %-40s %-20s TEST OK\n" "$(1)" "$(4)" "$(2)" > $(3)-$(subst /,-,$(1))$(2).testlog) || \ @@ -53,16 +53,23 @@ $(call dooneexample,$(dir $(call get_target,${1})),$(notdir $(call get_target,${ endef #end of GNU make magic -examples: +examples: | $(EXAMPLESDIR) $(foreach ex, $(EXAMPLES), $(call doexample, ${ex})) +$(EXAMPLESDIR): + @echo "Could not find examples directory $(EXAMPLESDIR).\n" + @echo "If this failure is when running 19-out-of-tree-builds, clone" + @echo "https://github.com/contiki-ng/out-of-tree-tests into" + @echo "$(EXAMPLESDIR) and run the test again.\n" + @false + summary: examples @cat *.testlog > summary @echo "========== Summary ==========" @cat summary -clean: +clean: | $(EXAMPLESDIR) @rm -f *.testlog summary @$(foreach example, $(EXAMPLES), \ $(foreach target, $(EXAMPLESTARGETS), \ - (cd $(EXAMPLESDIR)/$(example); $(MAKE) TARGET=$(target) clean);)) + (cd $(EXAMPLESDIR)/$(example) && $(MAKE) TARGET=$(target) clean);))