go-org-orgwiki/Makefile
Niklas Fasching f8b8e73722 make: Add serve-gh-pages target
As github pages is served not on root but /go-org/ we need to move everything
into a subdirectory of that name when serving locally
2022-05-30 17:31:54 +02:00

49 lines
1.1 KiB
Makefile

.PHONY: default
default: test
go-org: *.go */*.go go.mod go.sum
go get -d ./...
go build .
.PHONY: 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
.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