blob: ea6cbb50e50e93073303716529f96bb263f3fbc4 [file] [log] [blame]
David K. Bainbridge528b3182017-01-23 08:51:59 -08001# Build, and run tests.
2check: examples
3 go test ./...
4
5example_source := $(wildcard example/*.go)
6example_binaries := $(patsubst %.go,%,$(example_source))
7
8# Clean up binaries.
9clean:
10 $(RM) $(example_binaries)
11
12# Reformat the source files to match our layout standards.
13format:
14 gofmt -w .
15
16# Invoke gofmt's "simplify" option to streamline the source code.
17simplify:
18 gofmt -w -s .
19
20# Build the examples (we have no tests for them).
21examples: $(example_binaries)
22
23%: %.go
24 go build -o $@ $<
25
26.PHONY: check clean format examples simplify