Skip to content
Snippets Groups Projects
Commit ad7e433a authored by Junegunn Choi's avatar Junegunn Choi
Browse files

Use build tags to enable static linking

parent 5a60aa50
No related branches found
No related tags found
No related merge requests found
......@@ -44,10 +44,10 @@ clean:
cd fzf && rm -f fzf-*
fzf/$(BINARY32): $(SOURCES)
cd fzf && GOARCH=386 CGO_ENABLED=1 go build -o $(BINARY32)
cd fzf && GOARCH=386 CGO_ENABLED=1 go build -a -o $(BINARY32)
fzf/$(BINARY64): $(SOURCES)
cd fzf && go build $(LDFLAGS) -o $(BINARY64)
cd fzf && go build -a -tags "$(TAGS)" -o $(BINARY64)
$(BINDIR)/fzf: fzf/$(BINARY64) | $(BINDIR)
cp -f fzf/$(BINARY64) $(BINDIR)
......@@ -79,7 +79,7 @@ centos: docker-centos
linux: docker-centos
docker run -i -t -v $(GOPATH):/go junegunn/centos-sandbox \
/bin/bash -ci 'cd /go/src/github.com/junegunn/fzf/src; make'
/bin/bash -ci 'cd /go/src/github.com/junegunn/fzf/src; make TAGS=static'
.PHONY: all build release test install uninstall clean docker \
linux arch ubuntu centos docker-arch docker-ubuntu docker-centos
......@@ -3,9 +3,8 @@ package curses
/*
#include <ncurses.h>
#include <locale.h>
#cgo darwin LDFLAGS: -lncurses
#cgo linux,386 LDFLAGS: -lncurses
#cgo linux,amd64 LDFLAGS: -l:libncurses.a -l:libtinfo.a -l:libgpm.a -ldl
#cgo !static LDFLAGS: -lncurses
#cgo static LDFLAGS: -l:libncurses.a -l:libtinfo.a -l:libgpm.a -ldl
*/
import "C"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment