diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 39 |
1 files changed, 17 insertions, 22 deletions
@@ -1,30 +1,25 @@ -.PHONY: build test test-go test-wrappers clean +.DEFAULT_GOAL := build +.PHONY: build fmt cli clean -build: - $(MAKE) -C exports -test: test-go test-wrappers +VERSION := $(shell grep -o 'const Version = "[^"]*' internal/version/version.go | cut -d '"' -f 2) + -test-go: - go test ./... -v +build: + CGO_ENABLED="1" go build -o lib/libeduvpn_common-${VERSION}.so -buildmode=c-shared ./exports -#WRAPPERS ?= $(notdir $(patsubst %/,%,$(wildcard wrappers/*/))) -WRAPPERS=python +fmt: + gofumpt -w . -# Enable parallelism if -j is specified, but first execute build -test-wrappers: build - $(MAKE) $(foreach wrapper,$(WRAPPERS),.test-$(wrapper)) +lint: + golangci-lint run -E stylecheck,revive,gocritic ./... -clean: .clean-libs $(foreach wrapper,$(WRAPPERS),.clean-$(wrapper)) +cli: + go build -o eduvpn-common-cli ./cmd/cli -.clean-libs: - $(MAKE) -C exports clean +test: + go test ./... -# Define test & clean for each wrapper -define wrapper_targets -.test-$(1): - $(MAKE) -C wrappers/$(1) test -.clean-$(1): - $(MAKE) -C wrappers/$(1) clean -endef -$(foreach wrapper,$(WRAPPERS),$(eval $(call wrapper_targets,$(wrapper)))) +clean: + rm -rf lib + go clean |
