summaryrefslogtreecommitdiffstats
path: root/src/Makefile
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-01-02 04:49:30 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-01-04 00:37:29 +0900
commitf3177305d5572b26f135fc045481358b4eb1bf69 (patch)
treed59fd9587e44e998581a131875bf45e243df6c6e /src/Makefile
parent7ba93d9f8351be64b37c65ae04d594ee261d5d26 (diff)
Rewrite fzf in Go
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 00000000..bae4c906
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,49 @@
+BINARY := fzf/fzf
+
+UNAME_S := $(shell uname -s)
+ifeq ($(UNAME_S),Darwin)
+ BINARY := $(BINARY)_darwin
+else ifeq ($(UNAME_S),Linux)
+ BINARY := $(BINARY)_linux
+endif
+
+UNAME_M := $(shell uname -m)
+ifneq ($(filter i386 i686,$(UNAME_M)),)
+$(error "filtered is not supported, yet.")
+endif
+
+ifeq ($(UNAME_M),x86_64)
+ BINARY := $(BINARY)_amd64
+else ifneq ($(filter i386 i686,$(UNAME_M)),)
+ BINARY := $(BINARY)_386
+else # TODO
+$(error "$(UNAME_M) is not supported, yet.")
+endif
+
+BINDIR = ../bin
+SOURCES = $(wildcard *.go fzf/*.go)
+
+all: build
+
+build: $(BINARY)
+
+$(BINARY): $(SOURCES)
+ go get
+ go test -v
+ cd fzf && go build -o $(notdir $(BINARY))
+
+install: $(BINARY)
+ mkdir -p $(BINDIR)
+ cp -f $(BINARY) $(BINDIR)/fzf
+
+clean:
+ rm -f $(BINARY)
+
+docker:
+ docker build -t junegunn/ubuntu-sandbox .
+
+linux64:
+ docker run -i -t -u jg -v $(shell cd ..; pwd):/fzf junegunn/ubuntu-sandbox \
+ /bin/bash -ci 'cd ~jg/go/src/github.com/junegunn/fzf/src; make build'
+
+.PHONY: build install linux64 clean docker run