]> rtime.felk.cvut.cz Git - sysless.git/blobdiff - build-all/Makefile
Add optional WvTest protocol output for build-all
[sysless.git] / build-all / Makefile
index 1b9be19939c0e9a8b5254e2f4303d28684177e45..a171dc70e0ab6d79693c9ca7100c344d198008f9 100644 (file)
@@ -1,15 +1,30 @@
 include Makefile.dirs
 
-all $(MAKECMDGOALS): $(BUILD_DIRS)
+all $(filter-out test,$(MAKECMDGOALS)): rm-Makefile.dirs $(BUILD_DIRS)
 
-.PHONY: Makefile.dirs
 Makefile.dirs:
        ./create-build-tree.sh
 
+.PHONY: rm-Makefile.dirs
+rm-Makefile.dirs:
+       rm Makefile.dirs
+
+
+ifdef WVTEST
+WVSTART = @echo 'Testing "Board $1" in Makefile:'
+WVPASS = $1 && echo "! $1 ok" || ( RC=$$$$?; echo "! $1 FAILED"; exit $$$$RC )
+else
+WVPASS = $1
+endif
+
 define subdir
 .PHONY: $1
 $1:
-       $$(MAKE) -C $1 $(MAKECMDGOALS)
+       $(WVSTART)
+       $(call WVPASS,$$(MAKE) -C $1 $(MAKECMDGOALS))
 endef
 
 $(foreach d,$(BUILD_DIRS),$(eval $(call subdir,$d)))   
+
+test:
+       ./wvtestrun make WVTEST=1