musala/Makefile

54 lines
1 KiB
Makefile
Raw Permalink Normal View History

2018-08-21 07:08:51 +00:00
GOFILES=$(wildcard *.go)
2021-01-03 12:37:02 +00:00
BINDIR=bin
NAME=musala
2020-12-07 09:46:55 +00:00
MJML_TEMPLATES=$(wildcard templates/*.mjml)
MJML_OUTPUT=$(patsubst %.mjml,%.mjml.html,$(MJML_TEMPLATES))
2018-08-21 07:08:51 +00:00
2021-01-03 12:37:02 +00:00
all: help
2018-08-21 07:08:51 +00:00
2020-12-07 09:46:55 +00:00
%.mjml.html: %.mjml
npx mjml $< --config.minify > $@
.PHONY: build build-binaries build-templates
build: build-binaries build-templates ## build executable
build-binaries: build-templates
2021-01-03 12:47:56 +00:00
mkdir -p $(BINDIR)
2021-01-03 12:37:02 +00:00
cd $(BINDIR) && go build ../...
2018-08-21 07:08:51 +00:00
2020-12-07 09:46:55 +00:00
build-templates: $(MJML_OUTPUT)
2018-08-21 07:08:51 +00:00
install: ## install binaries
go install ./...
.PHONY: shellcheck
shellcheck: ## run shellcheck validation
scripts/validate/shellcheck
.PHONY: help
help: ## print this help
2021-01-03 12:37:02 +00:00
@awk 'BEGIN {FS = ":.*?## "} \
/^[a-zA-Z_-]+:.*?## / \
{sub("\\\\n",sprintf("\n%22c"," "), \
$$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' \
$(MAKEFILE_LIST)
2018-08-21 07:08:51 +00:00
2020-12-07 09:46:55 +00:00
.PHONY: clean clean-templates clean-binaries
clean: clean-templates clean-binaries ## remove build artifacts
clean-templates:
rm -f ./templates/*.mjml.html
clean-binaries:
2021-01-03 12:37:02 +00:00
rm -rf $(BINDIR)/*
2018-08-21 07:08:51 +00:00
test: build
./test.sh
2020-12-06 22:52:08 +00:00
npm:
npm install