File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,11 @@ PROD :=-X=$(REPOPATH)/common/product
8181EXTLDFLAGS :="-static"
8282LDFLAGS =-ldflags "-extldflags $(EXTLDFLAGS ) $(PROD ) .VERSION_MAJOR=$(VERSION_MAJOR ) $(PROD ) .VERSION_MINOR=$(VERSION_MINOR ) $(PROD ) .VERSION_PATCH=$(VERSION_PATCH ) $(PROD ) .BUILD=$(BUILD ) " -tags osusergo,netgo
8383
84+ # To invoke debug build you need to pass DEBUG variable with any value, eg: DEBUG=1 make WHAT=...
85+ ifdef DEBUG
86+ GCFLAGS += -gcflags="all=-N -l"
87+ endif
88+
8489# We expect to find the protoc-gen-go executable in $GOPATH/bin
8590GOPATH := $(shell go env GOPATH)
8691GOPROTOCPATH =$(ROOT_DIR ) /tools/protoc-gen-go
@@ -124,7 +129,7 @@ $(WHAT): validate-go-version
124129# @echo -e "WHAT_$@_BUILD_FLAGS $(WHAT_$@_BUILD_FLAGS)"
125130 @echo -e "\033[1;33mgo build -mod=vendor\033[0m ./cmd/$@ \033[1;33m==>\033[0m \033[1;34m./bin/$@\033[0m"
126131# @echo ${PWD}
127- @$(WHAT_$@_BUILD_FLAGS) go build -mod=vendor $(VERBOSE_$(V)) -o bin/$@ $(LDFLAGS) ./cmd/$@
132+ @$(WHAT_$@_BUILD_FLAGS) go build -mod=vendor $(VERBOSE_$(V)) $(GCFLAGS) -o bin/$@ $(LDFLAGS) ./cmd/$@
128133
129134# special case: if the current WHAT is o2-aliecs-executor, also copy over the shmcleaner script
130135 @if [ $@ = "o2-aliecs-executor" ]; then \
You can’t perform that action at this time.
0 commit comments