-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
65 lines (46 loc) · 1.51 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
FFI_PATH:=extern/filecoin-ffi/
FFI_DEPS:=.install-filcrypto
FFI_DEPS:=$(addprefix $(FFI_PATH),$(FFI_DEPS))
$(FFI_DEPS): build-dep/.filecoin-install ;
MODULES:=
CLEAN:=
BINS:=
ldflags=-X=github.com/filecoin-project/lotus/build.CurrentCommit=+git.$(subst -,.,$(shell git describe --always --match=NeVeRmAtCh --dirty 2>/dev/null || git rev-parse --short HEAD 2>/dev/null))
ifneq ($(strip $(LDFLAGS)),)
ldflags+=-extldflags=$(LDFLAGS)
endif
GOFLAGS+=-ldflags="$(ldflags)"
build-dep/.filecoin-install: $(FFI_PATH)
$(MAKE) -C $(FFI_PATH) $(FFI_DEPS:$(FFI_PATH)%=%)
@touch $@
MODULES+=$(FFI_PATH)
BUILD_DEPS+=build-dep/.filecoin-install
CLEAN+=build-dep/.filecoin-install
link-build-dir:
./scripts/link-build.sh
BUILD_DEPS+=link-build-dir
$(MODULES): build-dep/.update-modules ;
# dummy file that marks the last time modules were updated
build-dep/.update-modules:
git submodule update --init --recursive
touch $@
CLEAN+=build-dep/.update-modules
test: $(BUILD_DEPS)
go test -v -failfast ./...
lint: $(BUILD_DEPS)
golint --set_exit_status `go list ./... | grep -v /extern/ | grep -v /proxy$$`
deps: $(BUILD_DEPS)
dep-check: build-dep/.update-modules
./tool/scripts/submodule-check.sh
dist-clean:
git clean -xdff
git submodule deinit --all -f
gen-proxy:
go run scripts/proxy-gen.go
build-ro: $(BUILD_DEPS)
mkdir -p ./bin
rm -f ./bin/chain-ro
go build $(GOFLAGS) -o ./bin/chain-ro ./chain-ro/cmd
go run github.com/GeertJohan/go.rice/rice append --exec ./bin/chain-ro -i ./build
.PHONY: lotus
BINS+=lotus