-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (26 loc) · 773 Bytes
/
Makefile
File metadata and controls
36 lines (26 loc) · 773 Bytes
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
PKGS := $(shell go list ./... 2> /dev/null | grep -v '/vendor')
LOCALS := $(shell find . -type f -name '*.go' -not -path "./vendor*/*")
EXAMPLES := $(shell ls -1 examples)
.EXPORT_ALL_VARIABLES:
GO111MODULE = on
all: fmt deps test build
fmt:
@go fmt ./...
go generate -x ./...
deps:
@which peg || go get github.com/pointlander/peg
go get ./...
-go mod tidy
go vet ./...
test: fmt deps
@go test ./...
bin:
@mkdir $(@)
bin/friendscript:
@go build -o $(@) ./cmd/friendscript/
build: bin bin/friendscript
@which friendscript 2> /dev/null && cp -v bin/friendscript `which friendscript` || true
examples: $(EXAMPLES)
$(EXAMPLES):
go build -o bin/example-$(basename $(@)) examples/$(@)/*.go
.PHONY: build bin/friendscript examples $(EXAMPLES)