-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
35 lines (28 loc) · 957 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
.DEFAULT_GOAL := build
SHELL := bash
.SHELLFLAGS := -euo pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
.PHONY: help
help: ## Describe useful make targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%-30s %s\n", $$1, $$2}'
.PHONY: build
build: ## Regenerate static output (default)
@go run .
.PHONY: run
run: build ## Run on :8080
@wrangler pages dev --port 8080 --live-reload --compatibility-date=2023-03-02 dist
.PHONY: clean
clean: ## Delete intermediate build artifacts
rm -rf dist/*.html dist/recipes/*.html
.PHONY: upgrade
upgrade: ## Upgrade Go dependencies
go get -u -t ./...
go mod tidy -v
.PHONY: lint
lint: ## Lint project
test -z "$$(gofmt -s -l . | tee /dev/stderr)"
go vet ./...
go run honnef.co/go/tools/cmd/staticcheck@latest
# Resize images with ImageMagick: convert file.jpg -resize 300x300 dist/static/file.webp