dbmate/Makefile

41 lines
691 B
Makefile
Raw Normal View History

DC := docker-compose
2016-05-21 20:01:49 -07:00
BUILD_FLAGS := -ldflags '-s'
PACKAGES := . ./pkg/...
2015-11-25 10:57:58 -08:00
.PHONY: all
all: dep install test lint build
.PHONY: dep
dep:
dep ensure -vendor-only
2015-12-01 18:35:18 -08:00
.PHONY: install
install:
go install -v $(PACKAGES)
2015-11-25 10:57:58 -08:00
.PHONY: test
test:
go test -v $(PACKAGES)
2015-11-25 10:57:58 -08:00
.PHONY: lint
2015-11-25 10:57:58 -08:00
lint:
golint -set_exit_status $(PACKAGES)
go vet $(PACKAGES)
errcheck $(PACKAGES)
2015-11-25 10:57:58 -08:00
.PHONY: clean
clean:
rm -rf dist
2015-12-01 17:36:23 -08:00
.PHONY: build
build: clean
GOARCH=amd64 go build $(BUILD_FLAGS) -o dist/dbmate-linux-amd64 .
# musl target does not support sqlite
GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o dist/dbmate-linux-musl-amd64 .
.PHONY: docker
docker:
$(DC) pull
$(DC) build
$(DC) run --rm dbmate make