lotus/Makefile

144 lines
3.4 KiB
Makefile
Raw Normal View History

all: build
.PHONY: all
GOVERSION:=$(shell go version | cut -d' ' -f 3 | cut -d. -f 2)
ifeq ($(shell expr $(GOVERSION) \< 13), 1)
$(warning Your Golang version is go 1.$(GOVERSION))
$(error Update Golang to version $(shell grep '^go' go.mod))
endif
# git modules that need to be loaded
MODULES:=
CLEAN:=
2019-08-28 16:14:32 +00:00
## BLS
BLS_PATH:=extern/go-bls-sigs/
BLS_DEPS:=libbls_signatures.a libbls_signatures.pc libbls_signatures.h
BLS_DEPS:=$(addprefix $(BLS_PATH),$(BLS_DEPS))
$(BLS_DEPS): build/.bls-install ;
build/.bls-install: $(BLS_PATH)
$(MAKE) -C $(BLS_PATH) $(BLS_DEPS:$(BLS_PATH)%=%)
@touch $@
MODULES+=$(BLS_PATH)
BUILD_DEPS+=build/.bls-install
CLEAN+=build/.bls-install
2019-07-08 11:00:52 +00:00
2019-08-28 16:14:32 +00:00
## SECTOR BUILDER
SECTOR_BUILDER_PATH:=extern/go-sectorbuilder/
SECTOR_BUILDER_DEPS:=libsector_builder_ffi.a sector_builder_ffi.pc sector_builder_ffi.h
SECTOR_BUILDER_DEPS:=$(addprefix $(SECTOR_BUILDER_PATH),$(SECTOR_BUILDER_DEPS))
2019-07-16 15:14:16 +00:00
$(SECTOR_BUILDER_DEPS): build/.sector-builder-install ;
build/.sector-builder-install: $(SECTOR_BUILDER_PATH)
$(MAKE) -C $(SECTOR_BUILDER_PATH) $(SECTOR_BUILDER_DEPS:$(SECTOR_BUILDER_PATH)%=%)
@touch $@
MODULES+=$(SECTOR_BUILDER_PATH)
BUILD_DEPS+=build/.sector-builder-install
CLEAN+=build/.sector-builder-install
2019-09-04 09:49:22 +00:00
$(MODULES): build/.update-modules ;
2019-08-28 16:14:32 +00:00
2019-09-04 09:49:22 +00:00
# dummy file that marks the last time modules were updated
build/.update-modules:
git submodule update --init --recursive
touch $@
2019-08-28 16:14:32 +00:00
2019-09-04 09:49:22 +00:00
# end git modules
2019-08-28 16:14:32 +00:00
2019-09-04 09:49:22 +00:00
## PROOFS
2019-08-28 16:14:32 +00:00
CLEAN+=build/.update-modules
deps: $(BUILD_DEPS)
.PHONY: deps
2019-07-08 11:00:52 +00:00
lotus: $(BUILD_DEPS)
rm -f lotus
2019-07-08 11:00:52 +00:00
go build -o lotus ./cmd/lotus
2019-10-02 23:36:33 +00:00
go run github.com/GeertJohan/go.rice/rice append --exec lotus -i ./build
.PHONY: lotus
CLEAN+=lotus
lotus-storage-miner: $(BUILD_DEPS)
rm -f lotus-storage-miner
go build -o lotus-storage-miner ./cmd/lotus-storage-miner
2019-10-02 23:36:33 +00:00
go run github.com/GeertJohan/go.rice/rice append --exec lotus-storage-miner -i ./build
2019-11-21 16:10:04 +00:00
lotus-worker: $(BUILD_DEPS)
rm -f lotus-worker
go build -o lotus-worker ./cmd/lotus-worker
go run github.com/GeertJohan/go.rice/rice append --exec lotus-worker -i ./build
.PHONY: lotus-storage-miner
CLEAN+=lotus-storage-miner
build: lotus lotus-storage-miner
.PHONY: build
2019-07-08 11:00:52 +00:00
2019-10-15 02:35:22 +00:00
install:
install -C ./lotus /usr/local/bin/lotus
2019-10-17 01:24:45 +00:00
install -C ./lotus-storage-miner /usr/local/bin/lotus-storage-miner
benchmarks:
go run github.com/whyrusleeping/bencher ./... > bench.json
@echo Submitting results
@curl -X POST 'http://benchmark.kittyhawk.wtf/benchmark' -d '@bench.json' -u "${benchmark_http_cred}"
.PHONY: benchmarks
2019-07-24 21:45:01 +00:00
pond: build
go build -o pond ./lotuspond
2019-07-25 23:32:38 +00:00
(cd lotuspond/front && npm i && npm run build)
2019-07-24 21:45:01 +00:00
.PHONY: pond
2019-10-11 06:11:57 +00:00
townhall:
rm -f townhall
go build -o townhall ./cmd/lotus-townhall
(cd ./cmd/lotus-townhall/townhall && npm i && npm run build)
2019-10-29 13:06:02 +00:00
go run github.com/GeertJohan/go.rice/rice append --exec townhall -i ./cmd/lotus-townhall -i ./build
2019-10-11 06:11:57 +00:00
.PHONY: townhall
2019-10-13 07:33:25 +00:00
fountain:
rm -f fountain
go build -o fountain ./cmd/lotus-fountain
go run github.com/GeertJohan/go.rice/rice append --exec fountain -i ./cmd/lotus-fountain
.PHONY: fountain
2019-11-16 19:51:54 +00:00
chainwatch:
rm -f chainwatch
go build -o chainwatch ./cmd/lotus-chainwatch
go run github.com/GeertJohan/go.rice/rice append --exec chainwatch -i ./cmd/lotus-chainwatch
.PHONY: chainwatch
stats:
rm -f stats
go build -o stats ./tools/stats
.PHONY: stats
clean:
rm -rf $(CLEAN)
-$(MAKE) -C $(BLS_PATH) clean
2019-08-28 16:42:22 +00:00
-$(MAKE) -C $(SECTOR_BUILDER_PATH) clean
.PHONY: clean
dist-clean:
git clean -xdff
git submodule deinit --all -f
.PHONY: dist-clean
2019-08-21 17:15:28 +00:00
type-gen:
go run ./gen/main.go
print-%:
@echo $*=$($*)