-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
41 lines (28 loc) · 920 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
.PHONY: all docs deps fast validate build lint format test clean distclean
SOURCES := $(shell find ./src -name "*.go")
SOURCEDIRS := $(shell find ./src -type d)
BUILD := $(shell git describe --tags)
all: deps validate build
docs:
rm -rf ./docs
cd hugo && hugo
mv hugo/public ./docs
deps:
go mod download
fast: deps build
validate:
./scripts/validate.sh
build: $(shell ./scripts/cmdslist.sh)
# For quick building of binaries, you can run something like "make bin/server"
bin/%: src/cmd/% $(SOURCES) $(SOURCEDIRS)
go build -ldflags="-s -w -X github.com/uoregon-libraries/newspaper-curation-app/src/version.Version=$(BUILD)" -o $@ github.com/uoregon-libraries/newspaper-curation-app/$<
lint:
revive --config=./revive.toml --formatter=unix src/...
format:
find src/ -name "*.go" | xargs goimports -l -w
test:
go test ./src/...
clean:
rm bin/* -f
distclean: clean
go clean -modcache -testcache -cache