forked from ipfs/ipget
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (61 loc) · 1.78 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
70
71
72
73
74
75
76
77
78
# Minimum version numbers for software required to build IPFS
IPFS_MIN_GO_VERSION = 1.7
IPFS_MIN_GX_VERSION = 0.6
IPFS_MIN_GX_GO_VERSION = 1.1
dist_root=/ipfs/QmVQJ5mEGT38nYTfe3ZCCZPJhFDXTzBekUb8x3v8Pifugt
gx_bin=bin/gx-v0.11.0
gx-go_bin=bin/gx-go-v1.4.0
# use things in our bin before any other system binaries
export PATH := bin:$(PATH)
export IPFS_API ?= v04x.ipfs.io
go_check:
@bin/check_go_version $(IPFS_MIN_GO_VERSION)
bin/gx-v%:
@echo "installing gx $(@:bin/gx-%=%)"
@bin/dist_get ${dist_root} gx $@ $(@:bin/gx-%=%)
rm -f bin/gx
ln -s $(@:bin/%=%) bin/gx
bin/gx-go-v%:
@echo "installing gx-go $(@:bin/gx-go-%=%)"
@bin/dist_get ${dist_root} gx-go $@ $(@:bin/gx-go-%=%)
rm -f bin/gx-go
ln -s $(@:bin/%=%) bin/gx-go
gx_check: ${gx_bin} ${gx-go_bin}
path_check:
@bin/check_go_path $(realpath $(shell pwd)) $(realpath $(GOPATH)/src/github.com/ipfs/ipget)
deps: go_check gx_check path_check
${gx_bin} --verbose install --global
install: deps
go install
build: deps
go build
clean:
rm -rf ./ipget
uninstall:
go clean github.com/ipfs/ipget
PHONY += help gx_check
PHONY += go_check deps install build clean
##############################################################
# A semi-helpful help message
help:
@echo 'DEPENDENCY TARGETS:'
@echo ''
@echo ' gx_check - Installs or upgrades gx and gx-go'
@echo ' deps - Download dependencies using gx'
@echo ''
@echo 'BUILD TARGETS:'
@echo ''
@echo ' help - print this help message'
@echo ' build - Build binary'
@echo ' install - Build binary and install into $$GOPATH/bin'
@echo ''
@echo 'CLEANING TARGETS:'
@echo ''
@echo ' clean - Remove binary from build directory'
@echo ''
@echo 'TESTING TARGETS:'
@echo ''
@echo ' COMING SOON(TM)'
@echo ''
PHONY += help
.PHONY: $(PHONY)