diff --git a/Makefile b/Makefile index 144cbd7e65..3aed3fe133 100644 --- a/Makefile +++ b/Makefile @@ -43,4 +43,5 @@ print-versions: include makefiles/boards.inc.mk include makefiles/app_dirs.inc.mk +include makefiles/tools/riotgen.inc.mk -include makefiles/tests.inc.mk diff --git a/makefiles/tools/riotgen.inc.mk b/makefiles/tools/riotgen.inc.mk new file mode 100644 index 0000000000..53eb93edc6 --- /dev/null +++ b/makefiles/tools/riotgen.inc.mk @@ -0,0 +1,17 @@ +.PHONY: riotgen-installed generate-% + +-include makefiles/color.inc.mk + +riotgen-installed: + @command -v riotgen 2>&1 > /dev/null || \ + { $(COLOR_ECHO) \ + "$(COLOR_RED)'riotgen' command is not available \ + please consider installing it from \ + https://pypi.python.org/pypi/riotgen$(COLOR_RESET)"; \ + exit 1; } + +GENERATORS = board driver example module pkg test +$(addprefix generate-,$(GENERATORS)): generate-% + +generate-%: riotgen-installed + @RIOTBASE=$(CURDIR) riotgen $* -i