This repository has been archived by the owner on Sep 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 143
/
Copy pathMakefile
69 lines (58 loc) · 1.59 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
65
66
67
68
69
ifndef GOPATH
$(error GOPATH *must* be defined)
endif
GOBIN = $(value GOPATH)/bin
ifeq ($(OS),Windows_NT)
$(warning using hardcoded repo of github.com/holochain/holochain-proto)
REPO = github.com/holochain/holochain-proto
else
REPO = $(CURDIR:$(GOPATH)/src/%=%)
endif
# Remove a $(GOPATH)/src/ from the beginning of the current directory.
# Likely to be github.com/holochain/holochain-proto
go_packages = . ./ui ./apptest $(sort $(dir $(wildcard ./cmd/*/)))
# List of directories containing go packages
ifndef HOME
# Is probably a windows machine
ifdef USERPROFILE
HOME = $(USERPROFILE)
# Windows variable for home is USERPROFILE
else
$(error unable to get home directory)
endif
endif
HOLOPATH ?= $(HOME)/.holochain
# Default .holochain location
TEST_FLAGS = -v
define new_line
endef
.PHONY: hcd hcdev hcadmin bs test deps work pub
# Anything which requires deps should end with: gx-go rewrite --undo
all: deps
$(foreach pkg_path,$(go_packages),go get $(pkg_path) ${new_line})
gx-go rewrite --undo
hcd: deps
go get $(REPO)/cmd/hcd
gx-go rewrite --undo
hcdev: deps
go get $(REPO)/cmd/hcdev
gx-go rewrite --undo
hcadmin: deps
go get $(REPO)/cmd/hcadmin
gx-go rewrite --undo
bs: deps
go get $(REPO)/cmd/bs
gx-go rewrite --undo
test: deps
$(foreach pkg_path,$(go_packages),go get -d -t $(pkg_path) && go test $(TEST_FLAGS) $(pkg_path)${new_line})
gx-go rewrite --undo
deps: $(GOBIN)/gx $(GOBIN)/gx-go
gx-go get $(REPO)
$(GOBIN)/gx:
go get -u github.com/whyrusleeping/gx
$(GOBIN)/gx-go:
go get -u github.com/whyrusleeping/gx-go
work: $(GOBIN)/gx-go
gx-go rewrite
pub: $(GOBIN)/gx-go
gx-go rewrite --undo