-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathMakefile
41 lines (27 loc) · 807 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
36
37
38
39
40
41
TEMPL ?= templ
GO ?= go
default: dev
TEMPLATES = $(patsubst %.templ,%_templ.go,$(wildcard web/templates/*.templ))
web/templates/%_templ.go: web/templates/%.templ
$(TEMPL) generate -f $^
templates: $(TEMPLATES)
dev: deps templates
env $(FLAGS) $(GO) run $(GOFLAGS) cmd/*.go
prod: GOFLAGS="-ldflags=-X github.com/demostanis/42evaluators/internal/api.defaultRedirectURI=https://42evaluators.com"
prod: deps templates dev
nojobs: FLAGS=disabledjobs=*
nojobs: dev
race: GOFLAGS+=-race
race: dev
debug: FLAGS=httpdebug=*
debug: dev
42evaluators: templates
$(GO) build cmd/main.go -o $@
build: deps 42evaluators
clean:
$(RM) $(TEMPLATES)
deps:
@if ! which templ >/dev/null 2>&1 ; then \
$(GO) install github.com/a-h/templ/cmd/templ@latest; \
fi
.PHONY: default templates dev build clean deps