-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathMakefile
50 lines (39 loc) · 1.1 KB
/
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
.PHONY: default
default: test
go_files=$(shell find . -name '*.go' ! -path './docs/*')
go-org: $(go_files) go.mod go.sum
go get -d ./...
go build .
build: go-org
.PHONY: test
test:
go get -d -t ./...
go test ./... -v
.PHONY: setup
setup:
git config core.hooksPath etc/githooks
command -v go > /dev/null || (echo "go not installed" && false)
.PHONY: preview
preview: generate
xdg-open docs/index.html
.PHONY: generate
generate: generate-gh-pages generate-fixtures
.PHONY: generate-gh-pages
generate-gh-pages: build
./etc/generate-gh-pages
.PHONY: generate-fixtures
generate-fixtures: build
./etc/generate-fixtures $(files)
.PHONY: serve-gh-pages
serve-gh-pages: generate-gh-pages
cd docs && mkdir go-org && mv * go-org 2> /dev/null || true
cd docs && python3 -m http.server
.PHONY: fuzz
fuzz: build
@echo also see "http://lcamtuf.coredump.cx/afl/README.txt"
go get github.com/dvyukov/go-fuzz/go-fuzz
go get github.com/dvyukov/go-fuzz/go-fuzz-build
mkdir -p fuzz fuzz/corpus
cp org/testdata/*.org fuzz/corpus
go-fuzz-build github.com/niklasfasching/go-org/org
go-fuzz -bin=./org-fuzz.zip -workdir=fuzz