Skip to content

Commit c2ff495

Browse files
authored
Add make strip to build BFE without symbols and DWARFs (#845)
Signed-off-by: kwanhur <huang_hua2012@163.com>
1 parent d27264a commit c2ff495

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ BFE_PKGS := $(shell go list ./...)
4848
# make, make all
4949
all: prepare compile package
5050

51+
# make, make strip
52+
strip: prepare compile-strip package
53+
5154
# make prepare, download dependencies
5255
prepare: prepare-dep prepare-gen
5356
prepare-dep:
@@ -60,6 +63,11 @@ compile: test build
6063
build:
6164
$(GOBUILD) -ldflags "-X main.version=$(BFE_VERSION) -X main.commit=$(GIT_COMMIT) -extldflags=-static"
6265

66+
# make compile-strip, go build without symbols and DWARFs
67+
compile-strip: test build-strip
68+
build-strip:
69+
$(GOBUILD) -ldflags "-X main.version=$(BFE_VERSION) -X main.commit=$(GIT_COMMIT) -extldflags=-static -s -w"
70+
6371
# make test, test your code
6472
test: test-case vet-case
6573
test-case:

0 commit comments

Comments
 (0)