dash/go-bindings/Makefile
Kittywhiskers Van Gogh 8bf0c812f5 Squashed 'src/dashbls/' changes from 66ee820fbc..22b066020c
22b066020c build: match detection of Win32 libraries with mimalloc (#60)
03268b3a02 Merge pull request #59 from kittywhiskers/repair_subtree
3d2e7a183e depends: commit microsoft/mimalloc@91ba1f37 to source tree as 44314dd9
7a4d1a01fa depends: remove mangled 'depends/mimalloc' subdirectory
44314dd972 Squashed 'depends/mimalloc/' content from commit 91ba1f37
8383f081bd dashbls: replace flaky minialloc with microsoft/mimalloc@91ba1f37, add as vendored dependency (#55)
85b7e61b55 fix: Should not check validity for legacy G1 and G2 in FromBytes (#58)
7457939dd5 chore/fix: bump Catch2 to v2.13.10 (#57)

git-subtree-dir: src/dashbls
git-subtree-split: 22b066020c14bd162022c73f90fc7c940f4acdda
2023-01-02 12:40:54 +05:30

53 lines
1.7 KiB
Makefile

SRC_DIR=$(PWD)/../src
BUILD_DIR=$(PWD)/../build
GO="go"
COVERAGE_OUTPUT ?= coverage.out
.PHONY: default vet test clean
default: prepare vet test clean
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
CURR_DIR := $(dir $(MAKEFILE_PATH))
CGO_ENABLED := 1
CGO_LDFLAGS ?= "\
-L$(CURR_DIR)../build/depends/mimalloc \
-L$(CURR_DIR)../build/depends/relic/lib \
-L$(CURR_DIR)../build/src \
-ldashbls -lrelic_s -lmimalloc-secure -lgmp"
CGO_CXXFLAGS ?= "\
-I$(CURR_DIR)../build/depends/relic/include \
-I$(CURR_DIR)../depends/mimalloc/include \
-I$(CURR_DIR)../depends/relic/include \
-I$(CURR_DIR)../include"
prepare:
@mkdir -p ../build/src/dashbls
cp -rv ../src/* ../build/src/dashbls
fmt: ## Run go fmt to format Go files
$(GO) fmt
test: ## Run a basic test suite
CGO_CXXFLAGS=$(CGO_CXXFLAGS) CGO_LDFLAGS=$(CGO_LDFLAGS) $(GO) test
cover: ## Run tests and generate test coverage file, output coverage results and HTML coverage file.
CGO_CXXFLAGS=$(CGO_CXXFLAGS) CGO_LDFLAGS=$(CGO_LDFLAGS) $(GO) test -coverprofile $(COVERAGE_OUTPUT)
CGO_CXXFLAGS=$(CGO_CXXFLAGS) CGO_LDFLAGS=$(CGO_LDFLAGS) $(GO) tool cover -func=$(COVERAGE_OUTPUT)
CGO_CXXFLAGS=$(CGO_CXXFLAGS) CGO_LDFLAGS=$(CGO_LDFLAGS) $(GO) tool cover -html=$(COVERAGE_OUTPUT)
rm -f $(COVERAGE_OUTPUT)
vet: ## Go vet all project code
CGO_CXXFLAGS=$(CGO_CXXFLAGS) CGO_LDFLAGS=$(CGO_LDFLAGS) go vet ./...
help: ## Show This Help
@for line in $$(cat Makefile | grep "##" | grep -v "grep" | sed "s/:.*##/:/g" | sed "s/\ /!/g"); do verb=$$(echo $$line | cut -d ":" -f 1); desc=$$(echo $$line | cut -d ":" -f 2 | sed "s/!/\ /g"); printf "%-30s--%s\n" "$$verb" "$$desc"; done
clean: ## Clean up transient (generated) files
$(GO) clean
rm -f $(COVERAGE_OUTPUT)