mirror of
https://github.com/clearlinux/mixer-tools.git
synced 2026-09-05 21:21:44 +00:00
The tools have been converted from many bash scripts into a single binary, written in Go. This creates a codebase that is much easier to edit and maintain, and a single tool that provides all the functionality needed. The interface is more intuitive and easy to use as it provides options and menus for each subcommand. Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
43 lines
1.1 KiB
Makefile
43 lines
1.1 KiB
Makefile
CUR_DIR = $(shell pwd)
|
|
|
|
%.build:
|
|
GOPATH=$(CUR_DIR) go install $(subst .build,,$@)
|
|
|
|
clean:
|
|
test ! -d $(CUR_DIR)/pkg || rm -rvf $(CUR_DIR)/pkg; \
|
|
test ! -d $(CUR_DIR)/bin || rm -rvf $(CUR_DIR)/bin
|
|
|
|
%.compliant:
|
|
@ ( \
|
|
cd "$(PROJECT_ROOT)/$(subst .compliant,,$@)" >/dev/null || exit 1; \
|
|
go fmt || exit 1; \
|
|
GOPATH=$(CUR_DIR)/ go vet || exit 1; \
|
|
);
|
|
|
|
prep_coverage:
|
|
@ ( \
|
|
echo "mode: count" > coverage.out; \
|
|
);
|
|
|
|
%.test: prep_coverage
|
|
@ ( \
|
|
safe_nom=`echo "$(subst .test,,$@)" | sed 's/\//_/g'`; \
|
|
GOPATH=$(CUR_DIR) go test -v -cover -covermode=count -coverprofile=_coverage_$$safe_nom.out $(subst .test,,$@); \
|
|
tail -n +2 _coverage_$$safe_nom.out >> coverage.out; \
|
|
rm _coverage_$$safe_nom.out; \
|
|
);
|
|
|
|
%.benchmark:
|
|
@ ( \
|
|
safe_nom=`echo "$(subst .benchmark,,$@)" | sed 's/\//_/g'`; \
|
|
cd "$(PROJECT_ROOT)/$(subst .benchmark,,$@)" >/dev/null || exit 1; \
|
|
GOPATH=$(CUR_DIR) go test -run=XXX -v -bench=. -cpuprofile=$(CUR_DIR)/$$safe_nom.cpuprofile -memprofile=$(CUR_DIR)/$$safe_nom.memprofile; \
|
|
);
|
|
|
|
check: $(GO_TESTS)
|
|
|
|
bench: $(GO_BENCH)
|
|
|
|
coverage: check
|
|
GOPATH=$(CUR_DIR)/ go tool cover -html=coverage.out -o coverage.html
|