summaryrefslogtreecommitdiff
path: root/Makefile
blob: edfedf8c3c67ab0d750bb6568c543d7f2c693ff3 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
VERSION = $(shell git describe --tags)
GUIVERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d)

all: go-build
	@echo "make debian-dry-run  # shows what could be packaged"
	@echo "make debian-build    # make .deb files for versions that are missing"
	@echo "make test-build      # test build everything"
	@echo "make make-install    # run 'make install' in each app repo to copy to ~/go/bin"
	@echo "make list            # --list: list packaged apps in the wit repo"
	@echo "make update          # --update: run apt update and apt install on all packages"
	@echo "make repomap         # parse the go.wit.com repomap"

go-build: goimports
	GO111MODULE=off go build \
		-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"

vet:
	GO111MODULE=off go vet

only-me: go-build
	./wit-test --only-me

stderr: go-build
	echo "writing to /tmp/wit-test.log"
	./wit-test >/tmp/wit-test.log 2>&1

goimports:
	reset
	goimports -w *.go
	# // to globally reset paths:
	# // gofmt -w -r '"go.wit.com/gui/gadgets" -> "go.wit.com/lib/gadgets"' *.go

gocui: go-build
	./wit-test --gui gocui >/tmp/wit-test.log 2>&1

install: goimports
	GO111MODULE=off go install \
		-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"

check-git-clean:
	@git diff-index --quiet HEAD -- || (echo "Git repository is dirty, please commit your changes first"; exit 1)

list: go-build
	./wit-test --no-gui --list

pull: go-build
	./wit-test --git-pull

update: go-build
	./wit-test --apt-update --dry-run

force-build: go-build
	./wit-test --force

make-install: install
	wit-test --no-gui --make-install
	forge --find-private

test-build: go-build
	./wit-test --test-build

make-install-dry-run: go-build
	./wit-test --no-gui --make-install --dry-run

protobuf:
	go-clone go.wit.com/apps/go-clone

debian-dry-run: go-build
	./wit-test --no-gui --dry-run --debian

debian-build: go-build
	./wit-test --no-gui --debian
	do-aptly

repomap: go-build
	./wit-test --no-gui --repomap /etc/gowebd/repomap

repomap-dryrun: go-build
	./wit-test --no-gui --repomap /etc/gowebd/repomap --dry-run

test: go-build
	./wit-test --no-gui --make-install --test