From 5ccaa32ae65038b73cc04684d95faa61c8d8d3ff Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Wed, 17 Jul 2019 13:42:49 +0200 Subject: [PATCH] Cleanup makefile License: MIT Signed-off-by: Jakub Sztandera --- .gitignore | 1 + Makefile | 38 +++++++++++++++++++++++++++++--------- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 188904e8f..de6d9c486 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ lotus **/*.h **/*.a **/*.pc +build/.update-modules diff --git a/Makefile b/Makefile index cd7861273..08b05d780 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,41 @@ all: build +.PHONY: all -blssigs: lib/bls-signatures/include/libbls_signatures.h +BUILD_DEPS:=lib/bls-signatures/include/libbls_signatures.h +BUILD_DEPS+=lib/sectorbuilder/include/sector_builder_ffi.h -lib/bls-signatures/include/libbls_signatures.h: lib/bls-signatures/bls-signatures ; +# git modules that need to be loaded +MODULES:= + +lib/bls-signatures/include/libbls_signatures.h: lib/bls-signatures/bls-signatures ./scripts/install-bls-signatures.sh + @touch $@ -sectorbuilder: lib/sectorbuilder/include/sector_builder_ffi.h +MODULES+=lib/bls-signatures/bls-signatures -lib/sectorbuilder/include/sector_builder_ffi.h: lib/sectorbuilder lib/sectorbuilder/rust-fil-sector-builder ; + +lib/sectorbuilder/include/sector_builder_ffi.h: lib/sectorbuilder lib/sectorbuilder/rust-fil-sector-builder ./lib/sectorbuilder/build.sh + @touch $@ -lib/sectorbuilder: - git submodule update --init --recursive lib/sectorbuilder +MODULES+=lib/sectorbuilder +MODULES+=lib/sectorbuilder/rust-fil-sector-builder -deps: blssigs sectorbuilder +$(MODULES): build/.update-modules ; -build: deps +# dummy file that marks the last time modules were updated +build/.update-modules: + git submodule update --init --recursive + touch $@ + +deps: $(BUILD_DEPS) +.PHONY: deps + +build: $(BUILD_DEPS) go build -o lotus ./cmd/lotus +.PHONY: build -.PHONY: all build deps blssigs +dist-clean: + git clean -xdff + git submodule deinit --all -f +.PHONY: dist-clean