chore(makefile): auto set NOSTRIP

This commit is contained in:
mzz2017 2023-03-17 15:56:55 +08:00
parent aede17b857
commit bbf9b8e910

View File

@ -14,8 +14,11 @@ OUTPUT ?= dae
MAX_MATCH_SET_LEN ?= 64
CFLAGS := -DMAX_MATCH_SET_LEN=$(MAX_MATCH_SET_LEN) $(CFLAGS)
NOSTRIP ?= n
STRIP_PATH := $(shell command -v $(STRIP) 2>/dev/null)
ifeq ($(strip $(NOSTRIP)),y)
STRIP_FLAG := -no-strip
else ifeq ($(wildcard $(STRIP_PATH)),)
STRIP_FLAG := -no-strip
else
STRIP_FLAG := -strip=$(STRIP)
endif
@ -48,4 +51,5 @@ ebpf: clean-ebpf
@unset GOOS && \
unset GOARCH && \
unset GOARM && \
echo $(STRIP_FLAG) && \
go generate ./control/control.go