Skip to content

Commit f163888

Browse files
committed
makefiles/riotgen: fix colors and behav. for undef. targets
When executing `make generate-Makefile.ci` in the base directory, the make system would try to call `riotgen` with `Makefile.ci`, which does not work. Likewise with any other target like `make generate-bogus`. The pattern rule for the prerequisites was not evaluated by make, therefore the check did not work as intended.
1 parent ab921f5 commit f163888

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

makefiles/tools/riotgen.inc.mk

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
.PHONY: riotgen-installed generate-%
1+
.PHONY: riotgen-installed _generate-%
22

3-
-include makefiles/color.inc.mk
3+
RIOTMAKE=$(RIOTBASE)/makefiles
4+
5+
-include $(RIOTMAKE)/utils/ansi.mk
6+
-include $(RIOTMAKE)/color.inc.mk
47

58
riotgen-installed:
69
@command -v riotgen > /dev/null 2>&1 || \
710
{ $(COLOR_ECHO) \
8-
"$(COLOR_RED)'riotgen' command is not available \
9-
please consider installing it from \
10-
https://pypi.python.org/pypi/riotgen$(COLOR_RESET)"; \
11+
"$(COLOR_RED)'riotgen' command is not available.\n\
12+
Please consider installing it with 'pip install riotgen' or download \
13+
it from https://pypi.python.org/pypi/riotgen.$(COLOR_RESET)"; \
1114
exit 1; }
1215

1316
GENERATORS = board driver example module pkg test
14-
$(addprefix generate-,$(GENERATORS)): generate-%
17+
.SECONDEXPANSION:
18+
$(addprefix generate-,$(GENERATORS)): $$(addprefix _,$$@)
1519

16-
generate-%: riotgen-installed
20+
_generate-%: riotgen-installed
1721
@RIOTBASE=$(CURDIR) riotgen $* -i

0 commit comments

Comments
 (0)