2015-01-01 19:49:30 +00:00
|
|
|
UNAME_S := $(shell uname -s)
|
|
|
|
ifeq ($(UNAME_S),Darwin)
|
2015-01-04 16:25:54 +00:00
|
|
|
SUFFIX := darwin
|
2015-01-01 19:49:30 +00:00
|
|
|
else ifeq ($(UNAME_S),Linux)
|
2015-01-04 16:25:54 +00:00
|
|
|
SUFFIX := linux
|
2015-01-01 19:49:30 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
UNAME_M := $(shell uname -m)
|
|
|
|
ifeq ($(UNAME_M),x86_64)
|
2015-01-04 16:25:54 +00:00
|
|
|
SUFFIX := $(SUFFIX)_amd64
|
2015-01-01 19:49:30 +00:00
|
|
|
else ifneq ($(filter i386 i686,$(UNAME_M)),)
|
2015-01-04 16:25:54 +00:00
|
|
|
SUFFIX := $(SUFFIX)_386
|
2015-01-01 19:49:30 +00:00
|
|
|
else # TODO
|
|
|
|
$(error "$(UNAME_M) is not supported, yet.")
|
|
|
|
endif
|
|
|
|
|
2015-01-04 16:25:54 +00:00
|
|
|
BINARY := fzf-$(SUFFIX)
|
|
|
|
BINDIR := ../bin
|
|
|
|
SOURCES := $(wildcard *.go fzf/*.go)
|
|
|
|
RELEASE = fzf-$(shell fzf/$(BINARY) --version)-$(SUFFIX)
|
2015-01-01 19:49:30 +00:00
|
|
|
|
2015-01-04 16:25:54 +00:00
|
|
|
all: release
|
2015-01-01 19:49:30 +00:00
|
|
|
|
2015-01-04 16:25:54 +00:00
|
|
|
release: build
|
|
|
|
cd fzf && \
|
|
|
|
cp $(BINARY) $(RELEASE) && \
|
|
|
|
tar -czf $(RELEASE).tgz $(RELEASE) && \
|
|
|
|
rm $(RELEASE)
|
2015-01-03 17:00:22 +00:00
|
|
|
|
2015-01-04 16:25:54 +00:00
|
|
|
build: fzf/$(BINARY)
|
2015-01-01 19:49:30 +00:00
|
|
|
|
2015-01-04 16:25:54 +00:00
|
|
|
fzf/$(BINARY): $(SOURCES)
|
2015-01-01 19:49:30 +00:00
|
|
|
go get
|
|
|
|
go test -v
|
2015-01-04 16:25:54 +00:00
|
|
|
cd fzf && go build -o $(BINARY)
|
2015-01-01 19:49:30 +00:00
|
|
|
|
2015-01-04 16:25:54 +00:00
|
|
|
install: fzf/$(BINARY)
|
2015-01-01 19:49:30 +00:00
|
|
|
mkdir -p $(BINDIR)
|
2015-01-04 16:25:54 +00:00
|
|
|
cp -f fzf/$(BINARY) $(BINDIR)/fzf
|
2015-01-01 19:49:30 +00:00
|
|
|
|
|
|
|
clean:
|
2015-01-04 16:25:54 +00:00
|
|
|
cd fzf && rm -f $(BINARY) $(RELEASE).tgz
|
2015-01-01 19:49:30 +00:00
|
|
|
|
|
|
|
docker:
|
|
|
|
docker build -t junegunn/ubuntu-sandbox .
|
|
|
|
|
2015-01-05 03:21:26 +00:00
|
|
|
linux64: docker
|
2015-01-01 19:49:30 +00:00
|
|
|
docker run -i -t -u jg -v $(shell cd ..; pwd):/fzf junegunn/ubuntu-sandbox \
|
2015-01-04 16:25:54 +00:00
|
|
|
/bin/bash -ci 'cd ~jg/go/src/github.com/junegunn/fzf/src; make'
|
2015-01-01 19:49:30 +00:00
|
|
|
|
2015-01-05 03:21:26 +00:00
|
|
|
.PHONY: build release install linux64 clean docker
|