RPGs4_sanity/Makefile

38 lines
1.2 KiB
Makefile
Raw Normal View History

2022-11-20 00:37:48 +01:00
# I'm no PHONY!
2022-10-14 00:50:52 +02:00
STYLES := $(patsubst templates/%/render.sh,%,$(wildcard templates/*/render.sh))
help:
@printf "make %s\n" \
render-styles \
2022-11-20 00:37:48 +01:00
render-styles-push \
2022-10-14 00:50:52 +02:00
$(patsubst %,render-style-%-stdout,$(STYLES)) \
$(patsubst %,render-example-card-%-stdout,$(STYLES)) \
$(patsubst %,render-style-%-live,$(STYLES)) \
$(patsubst %,render-example-card-%-live,$(STYLES)) \
2022-11-20 00:37:48 +01:00
$(patsubst %,render-style-%-file,$(STYLES)) \
$(patsubst %,render-style-%-file-push,$(STYLES)) \
| sort
2022-10-14 00:50:52 +02:00
2022-11-20 00:37:48 +01:00
render-styles: $(patsubst %,render-style-%-file,$(STYLES))
render-styles-push: $(patsubst %,render-style-%-file-push,$(STYLES))
2022-10-14 00:50:52 +02:00
render-style-%-stdout: templates/%/render.sh
./"$<" | bat --language html --plain --paging never
render-example-card-%-stdout: templates/%/example.sh
./"$<" | bat --language html --plain --paging never
render-style-%-live:
fd --type f . templates/$* | entr make render-style-$*-stdout
render-example-card-%-live:
fd --type f . templates/$* | entr make render-example-card-$*-stdout
2022-11-20 00:37:48 +01:00
render-style-%-file:
mkdir -p pvv/styles
make --quiet render-style-$*-stdout > pvv/styles/$*.html
2022-10-14 00:50:52 +02:00
2022-11-20 00:37:48 +01:00
render-style-%-file-push: render-style-%-file
./api.py set-style $* pvv/styles/$*.html