From 70245ad98cb3fa8d2c13b882e615317488ccbdc0 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 18 May 2016 13:29:09 +0900 Subject: [PATCH] [make] Reduce the size of the binaries with `-ldflags -w` Related: #555 --- src/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index 5980386..f7aa0b2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -47,7 +47,7 @@ deps: $(SRCDIR) $(SOURCES) android-build: $(SRCDIR) cd $(SRCDIR) && GOARCH=arm GOARM=7 CGO_ENABLED=1 go get - cd $(SRCDIR)/fzf && GOARCH=arm GOARM=7 CGO_ENABLED=1 go build -a -ldflags="-extldflags=-pie" -o $(BINARYARM7) + cd $(SRCDIR)/fzf && GOARCH=arm GOARM=7 CGO_ENABLED=1 go build -a -ldflags="-w -extldflags=-pie" -o $(BINARYARM7) cd $(SRCDIR)/fzf && cp $(BINARYARM7) $(RELEASEARM7) && tar -czf $(RELEASEARM7).tgz $(RELEASEARM7) && \ rm -f $(RELEASEARM7) @@ -63,10 +63,10 @@ clean: cd fzf && rm -f fzf-* fzf/$(BINARY32): deps - cd fzf && GOARCH=386 CGO_ENABLED=1 go build -a -tags "$(TAGS)" -o $(BINARY32) + cd fzf && GOARCH=386 CGO_ENABLED=1 go build -a -ldflags -w -tags "$(TAGS)" -o $(BINARY32) fzf/$(BINARY64): deps - cd fzf && go build -a -tags "$(TAGS)" -o $(BINARY64) + cd fzf && go build -a -ldflags -w -tags "$(TAGS)" -o $(BINARY64) $(BINDIR)/fzf: fzf/$(BINARY) | $(BINDIR) cp -f fzf/$(BINARY) $(BINDIR)