1
0
mirror of https://github.com/drone/drone-cli.git synced 2024-11-23 17:22:09 +01:00
drone-cli/Makefile

41 lines
892 B
Makefile
Raw Normal View History

BIN := bin
DIST := dist
2015-10-25 02:06:46 +02:00
SRC = $(wildcard drone/*.go)
RELEASES = $(DIST)/drone_linux_amd64.tar.gz \
$(DIST)/drone_linux_386.tar.gz \
$(DIST)/drone_linux_arm.tar.gz \
$(DIST)/drone_darwin_amd64.tar.gz \
$(DIST)/drone_windows_386.tar.gz \
$(DIST)/drone_windows_amd64.tar.gz
GO = GO15VENDOREXPERIMENT=1 go
2015-10-25 02:06:46 +02:00
install: $(BIN)/drone
cp $< $(GOPATH)/bin/
release: $(RELEASES)
deps:
go get -u ./drone/...
2015-10-25 02:06:46 +02:00
test:
$(GO) test ./drone/...
2015-10-25 02:06:46 +02:00
clean:
rm -rf $(BIN) $(DIST)
$(BIN)/drone: $(SRC)
$(GO) build -o $@ $(SRC)
.PRECIOUS: $(BIN)/%/drone
$(BIN)/%/drone: GOOS=$(firstword $(subst _, ,$*))
$(BIN)/%/drone: GOARCH=$(subst .exe,,$(word 2,$(subst _, ,$*)))
$(BIN)/%/drone: $(SRC)
GOOS=$(GOOS) GOARCH=$(GOARCH) $(GO) build -o $@ $(SRC)
2015-10-25 02:06:46 +02:00
$(DIST)/drone_%.tar.gz: $(BIN)/%/drone
mkdir -p $(DIST)
tar -cvzf $@ --directory=$(BIN)/$* drone
sha256sum $@ > $(DIST)/drone_$*.sha256