forked from direnv/direnv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (30 loc) · 778 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
DESTDIR ?= /usr/local
MAN_MD = $(wildcard man/*.md)
ROFFS = $(MAN_MD:.md=)
.PHONY: all man html test install dist
#all: build man test
all: build man
build: direnv
stdlib.go: stdlib.sh
cat $< | ./script/str2go main STDLIB $< > $@
direnv: *.go
go fmt
go build -o direnv
clean:
rm -f direnv
%.1: %.1.md
@which md2man-roff >/dev/null || (echo "Could not generate man page because md2man is missing, gem install md2man"; false)
md2man-roff $< > $@
man: $(ROFFS)
test: build
go test
./test/direnv-test.sh
install: all
install -d $(DESTDIR)/bin
install -d $(DESTDIR)/share/man/man1
install direnv $(DESTDIR)/bin
cp -R man/*.1 $(DESTDIR)/share/man/man1
dist:
go get github.com/mitchellh/gox
gox -build-toolchain
gox -output "dist/{{.Dir}}.{{.OS}}-{{.Arch}}"