Makefile 888 Bytes
Newer Older
董子豪's avatar
董子豪 committed
1 2 3 4 5 6 7 8 9 10 11
DEPS:=filcrypto.h filcrypto.pc libfilcrypto.a

all: $(DEPS)
.PHONY: all

# Create a file so that parallel make doesn't call `./install-filcrypto` for
# each of the deps
$(DEPS): .install-filcrypto  ;

.install-filcrypto: rust
	go clean -cache -testcache .
董子豪's avatar
董子豪 committed
12
	bash ./install-filcrypto
董子豪's avatar
董子豪 committed
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
	@touch $@

clean:
	go clean -cache -testcache .
	rm -rf $(DEPS) .install-filcrypto
	rm -f ./runner
	cd rust && cargo clean && cd ..
.PHONY: clean

go-lint: $(DEPS)
	golangci-lint run -v --concurrency 2 --new-from-rev origin/master
.PHONY: go-lint

shellcheck:
	shellcheck install-filcrypto

lint: shellcheck go-lint

cgo-leakdetect: runner
	valgrind --leak-check=full --show-leak-kinds=definite ./runner
.PHONY: cgo-leakdetect

cgo-gen: $(DEPS)
	go run github.com/xlab/c-for-go --nostamp filcrypto.yml
.PHONY: cgo-gen

runner: $(DEPS)
	rm -f ./runner
	go build -o ./runner ./cgoleakdetect/
.PHONY: runner