From a534caebb44b0da04aaa4d05f5a60e951016ae6e Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Thu, 15 Feb 2018 22:07:46 +0100 Subject: [PATCH] makefiles: add code generator targets These targets will bootstrap code for an example application, a test application or a new board support. The 'riotgen' tool is used behind --- Makefile | 1 + makefiles/tools/riotgen.inc.mk | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 makefiles/tools/riotgen.inc.mk 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