mirror of
https://github.com/jimeh/casecmp.git
synced 2026-02-19 02:16:40 +00:00
Update Makefile
This commit is contained in:
35
Makefile
35
Makefile
@@ -1,9 +1,8 @@
|
|||||||
DEV_DEPS = github.com/kardianos/govendor
|
|
||||||
|
|
||||||
NAME = casecmp
|
NAME = casecmp
|
||||||
BINARY = bin/${NAME}
|
BINARY = bin/${NAME}
|
||||||
SOURCES = $(shell find . -name '*.go' -o -name 'VERSION' -o -name 'README.md')
|
SOURCES = $(shell find . -name '*.go' -o -name 'VERSION' -o -name 'README.md')
|
||||||
VERSION = $(shell cat VERSION)
|
VERSION ?= $(shell cat VERSION)
|
||||||
|
WHOAMI ?= $(shell whoami)
|
||||||
RELEASE_DIR = releases
|
RELEASE_DIR = releases
|
||||||
RELEASE_TARGETS = \
|
RELEASE_TARGETS = \
|
||||||
$(RELEASE_DIR)/$(NAME)-$(VERSION)_darwin_386.tar.gz \
|
$(RELEASE_DIR)/$(NAME)-$(VERSION)_darwin_386.tar.gz \
|
||||||
@@ -25,27 +24,19 @@ $(BINARY): $(SOURCES)
|
|||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: $(BINARY)
|
build: $(BINARY)
|
||||||
|
|
||||||
.PHONY: clean
|
|
||||||
clean:
|
|
||||||
$(eval BIN_DIR := $(shell dirname ${BINARY}))
|
|
||||||
if [ -f ${BINARY} ]; then rm ${BINARY}; fi; \
|
|
||||||
if [ -d ${BIN_DIR} ]; then rmdir ${BIN_DIR}; fi
|
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run: $(BINARY)
|
run: $(BINARY)
|
||||||
$(BINARY)
|
$(BINARY)
|
||||||
|
|
||||||
.PHONY: deps
|
.PHONY: clean
|
||||||
deps:
|
clean:
|
||||||
@govendor sync
|
$(eval BIN_DIR := $(shell dirname ${BINARY}))
|
||||||
|
if [ -f ${BINARY} ]; then rm ${BINARY}; fi
|
||||||
|
if [ -d ${BIN_DIR} ]; then rmdir ${BIN_DIR}; fi
|
||||||
|
|
||||||
.PHONY: dev-deps
|
.PHONY: docker-build
|
||||||
dev-deps:
|
docker-build: clean
|
||||||
@$(foreach DEP,$(DEV_DEPS),go get $(DEP);)
|
docker build -t "$(WHOAMI)/$(NAME)" .
|
||||||
|
|
||||||
.PHONY: update-dev-deps
|
|
||||||
update-dev-deps:
|
|
||||||
@$(foreach DEP,$(DEV_DEPS),go get -u $(DEP);)
|
|
||||||
|
|
||||||
.PHONY: release
|
.PHONY: release
|
||||||
release: $(RELEASE_TARGETS)
|
release: $(RELEASE_TARGETS)
|
||||||
@@ -71,9 +62,3 @@ $(RELEASE_DIR)/$(NAME)-$(VERSION)_windows_%.zip: $(SOURCES)
|
|||||||
&& zip -r "$@" "$(TARGET)" \
|
&& zip -r "$@" "$(TARGET)" \
|
||||||
&& cd "$(TARGET)" && rm "$(NAME).exe" $(RELEASE_ASSETS) && cd .. \
|
&& cd "$(TARGET)" && rm "$(NAME).exe" $(RELEASE_ASSETS) && cd .. \
|
||||||
&& rmdir "$(TARGET)"
|
&& rmdir "$(TARGET)"
|
||||||
|
|
||||||
.PHONY: docker
|
|
||||||
docker: clean deps
|
|
||||||
$(eval REPO := $(shell whoami)/$(NAME))
|
|
||||||
docker build -t "$(REPO):latest" . \
|
|
||||||
&& docker tag "$(REPO):latest" "$(REPO):$(VERSION)"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user