Skip to content

Commit

Permalink
Makefile debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarak Ben Youssef committed Jun 1, 2023
1 parent d4b873d commit f0b49e7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ export DOCKER_BUILDKIT := 1

# `ADX_SUPPORT` is 1 if ADX instructions are supported and 0 otherwise.
ifeq ($(shell uname -s),Linux)
OS := Linux
# detect ADX support on the CURRENT linux machine.
ADX_SUPPORT := $(shell if ([ -f "/proc/cpuinfo" ] && grep -q -e '^flags.*\badx\b' /proc/cpuinfo); then echo 1; else echo 0; fi)
else
OS := NO_Linux
# on non-linux machines, set the flag to 1 by default
ADX_SUPPORT := 1
endif
Expand All @@ -61,6 +63,14 @@ else
endif
CGO_FLAG := CGO_CFLAGS=$(CRYPTO_FLAG)

.PHONY: debug
debug:
$(shell grep -q -e '^flags.*\badx\b' /proc/cpuinfo)
@echo $(OS)
@echo $(ADX_SUPPORT)
@echo $(CRYPTO_FLAG)
@echo $(CGO_FLAG)

cmd/collection/collection:
$(CGO_FLAG) go build -o cmd/collection/collection cmd/collection/main.go

Expand All @@ -86,7 +96,7 @@ install-mock-generators:
go install github.com/golang/mock/mockgen@v1.6.0;

.PHONY: install-tools
install-tools: check-go-version install-mock-generators
install-tools: debug check-go-version install-mock-generators
cd ${GOPATH}; \
go install github.com/golang/protobuf/protoc-gen-go@v1.3.2; \
go install github.com/uber/prototool/cmd/prototool@v1.9.0; \
Expand Down

0 comments on commit f0b49e7

Please sign in to comment.