aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: beccc5f7d1777aeb0dfe26675b157f39f5479bae (plain)
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
.phony: build
build:
	./build.bash
	./Documentation/MANPAGE-render.bash

.phony: test
test:
	./test.bash

.phony: root_test
root_test:
	./build.bash

# Need to use TMPDIR=/var/tmp as TestOverlay fails on tmpfs.
	cd tests/root_test && go test -c && sudo TMPDIR=/var/tmp ./root_test.test -test.v

	cd tests/cli && go test -c && sudo ./cli.test -test.v -test.run=TestDirectMount

.phony: format
format:
	go fmt ./...

# Keep in sync with uninstall!
.phony: install
install:
	install -Dm755 -t "$(DESTDIR)/usr/bin/" gocryptfs
	install -Dm755 -t "$(DESTDIR)/usr/bin/" gocryptfs-xray/gocryptfs-xray
	install -Dm644 -t "$(DESTDIR)/usr/share/man/man1/" Documentation/gocryptfs.1
	install -Dm644 -t "$(DESTDIR)/usr/share/man/man1/" Documentation/gocryptfs-xray.1
	install -Dm644 -t "$(DESTDIR)/usr/share/licenses/gocryptfs" LICENSE

.phony: uninstall
uninstall:
	rm -f "$(DESTDIR)/usr/bin/gocryptfs"
	rm -f "$(DESTDIR)/usr/bin/gocryptfs-xray"
	rm -f "$(DESTDIR)/usr/share/man/man1/gocryptfs.1"
	rm -f "$(DESTDIR)/usr/share/man/man1/gocryptfs-xray.1"
	rm -f "$(DESTDIR)/usr/share/licenses/gocryptfs/LICENSE"

.phony: ci
ci:
	uname -a ; go version ; openssl version
	df -Th / /tmp /var/tmp

	./build-without-openssl.bash
	./build.bash
	./test.bash
	make root_test
	./crossbuild.bash

	echo "Rebuild with locked dependencies"
	# Download dependencies to "vendor" directory
	go mod vendor
	# Delete global cache
	go clean -modcache
	# GOPROXY=off makes sure we fail instead of making network requests
	# (we should not need any!)
	# "-mod=vendor" is required for Go 1.13
	GOPROXY=off ./build.bash -mod=vendor
	# Delete "vendor" dir
	rm -R vendor