dbmate/Makefile
Adrian Macneil df119a76f3
Migrate to dep for dependency management (#26)
* Replace `Godeps` with `dep`
* Upgrade all dependencies
* Remove vendor source from git repository
2018-01-23 17:11:34 -08:00

40 lines
721 B
Makefile

DC := docker-compose
BUILD_FLAGS := -ldflags '-s'
PACKAGES := ./cmd/... ./pkg/...
.PHONY: all
all: dep install test lint build
.PHONY: dep
dep:
dep ensure -vendor-only
.PHONY: install
install:
go install -v $(PACKAGES)
.PHONY: test
test:
go test -v $(PACKAGES)
.PHONY: lint
lint:
golint -set_exit_status $(PACKAGES)
go vet $(PACKAGES)
errcheck $(PACKAGES)
.PHONY: clean
clean:
rm -rf dist
.PHONY: build
build: clean
GOARCH=amd64 go build $(BUILD_FLAGS) -o dist/dbmate-linux-amd64 ./cmd/dbmate
# musl target does not support sqlite
GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o dist/dbmate-linux-musl-amd64 ./cmd/dbmate
.PHONY: docker
docker:
$(DC) pull
$(DC) build
$(DC) run --rm dbmate make