-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
54 lines (41 loc) · 870 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
42
43
44
45
46
47
48
49
50
51
52
53
54
CC= go
BIN= ./bin
SRC= ./src
CLEANDIR= $(SRC)/goccgen
GCFLAGS= -ldflags "-w"
DEBUGFLAGS=-gcflags "-N -l"
all:
make deps
make gogo
.PHONY: scanner tac gogo clean test
deps: $(SRC)/lang.bnf
scripts/check-gocc.sh
scanner: $(SRC)/scanner/gentoken.go
cd $(SRC)/scanner; $(CC) install $(GCFLAGS)
tac: $(SRC)/tac/tac.go
cd $(SRC)/tac; $(CC) install $(GCFLAGS)
gogo: $(SRC)/main.go
$(CC) build $(GCFLAGS) -o $(BIN)/gogo $(SRC)/main.go
$(BIN)/gogo -runtime
test:
scripts/run-tests.sh -r2s
scripts/run-tests.sh -r
make testdiff
testdiff:
git diff --exit-code ./test
gofmt:
gofmt -l -s -w ./src
govet:
go tool vet -methods=false ./src
errcheck:
go get github.com/kisielk/errcheck
errcheck -exclude .errcheck-ignore ./src/...
travis:
make
make test
make govet
make gofmt
make errcheck
clean:
rm -rf $(CLEANDIR)
rm -rf $(BIN)