-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
64 lines (51 loc) · 1.53 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
ifndef version
version=$(shell git rev-list -1 HEAD)
endif
buildargs = -ldflags "-X main.VersionString=$(version)" -v
all: build test install
build:
cd cmd/nash && go build $(buildargs)
cd cmd/nashfmt && go build $(buildargs)
cd stdbin/mkdir && go build $(buildargs)
cd stdbin/pwd && go build $(buildargs)
cd stdbin/write && go build $(buildargs)
cd stdbin/strings && go build $(buildargs)
NASHPATH?=$(HOME)/nash
NASHROOT?=$(HOME)/nashroot
# FIXME: binaries install do not work on windows this way (the .exe)
install: build
@echo
@echo "Installing nash at: "$(NASHROOT)
mkdir -p $(NASHROOT)/bin
rm -f $(NASHROOT)/bin/nash
rm -f $(NASHROOT)/bin/nashfmt
cp -p ./cmd/nash/nash $(NASHROOT)/bin
cp -p ./cmd/nashfmt/nashfmt $(NASHROOT)/bin
rm -rf $(NASHROOT)/stdlib
cp -pr ./stdlib $(NASHROOT)/stdlib
cp -pr ./stdbin/mkdir/mkdir $(NASHROOT)/bin/mkdir
cp -pr ./stdbin/pwd/pwd $(NASHROOT)/bin/pwd
cp -pr ./stdbin/write/write $(NASHROOT)/bin/write
cp -pr ./stdbin/strings/strings $(NASHROOT)/bin/strings
docsdeps:
go get github.com/madlambda/mdtoc/cmd/mdtoc
docs: docsdeps
mdtoc -w ./README.md
mdtoc -w ./docs/interactive.md
mdtoc -w ./docs/reference.md
mdtoc -w ./docs/stdlib/fmt.md
test: build
./hack/check.sh
update-vendor:
cd cmd/nash && nash ./vendor.sh
release: clean
./hack/releaser.sh $(version)
coverage-html: test
go tool cover -html=coverage.txt -o coverage.html
@echo "coverage file: coverage.html"
coverage-show: coverage-html
xdg-open coverage.html
clean:
rm -f cmd/nash/nash
rm -f cmd/nashfmt/nashfmt
rm -rf dist