2
0
mirror of https://github.com/junegunn/fzf synced 2024-11-10 13:10:44 +00:00
fzf/src/Makefile

52 lines
1.1 KiB
Makefile
Raw Normal View History

2015-01-01 19:49:30 +00:00
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SUFFIX := darwin
2015-01-01 19:49:30 +00:00
else ifeq ($(UNAME_S),Linux)
SUFFIX := linux
2015-01-01 19:49:30 +00:00
endif
UNAME_M := $(shell uname -m)
ifeq ($(UNAME_M),x86_64)
SUFFIX := $(SUFFIX)_amd64
2015-01-01 19:49:30 +00:00
else ifneq ($(filter i386 i686,$(UNAME_M)),)
SUFFIX := $(SUFFIX)_386
2015-01-01 19:49:30 +00:00
else # TODO
$(error "$(UNAME_M) is not supported, yet.")
endif
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
all: release
2015-01-01 19:49:30 +00:00
release: build
cd fzf && \
cp $(BINARY) $(RELEASE) && \
tar -czf $(RELEASE).tgz $(RELEASE) && \
rm $(RELEASE)
build: fzf/$(BINARY)
2015-01-01 19:49:30 +00:00
fzf/$(BINARY): $(SOURCES)
2015-01-01 19:49:30 +00:00
go get
go test -v
cd fzf && go build -o $(BINARY)
2015-01-01 19:49:30 +00:00
install: fzf/$(BINARY)
2015-01-01 19:49:30 +00:00
mkdir -p $(BINDIR)
cp -f fzf/$(BINARY) $(BINDIR)/fzf
2015-01-01 19:49:30 +00:00
clean:
cd fzf && rm -f $(BINARY) $(RELEASE).tgz
2015-01-01 19:49:30 +00:00
docker:
docker build -t junegunn/ubuntu-sandbox .
linux64: docker
2015-01-01 19:49:30 +00:00
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'
2015-01-01 19:49:30 +00:00
.PHONY: build release install linux64 clean docker