dbmate/Makefile
Adrian Macneil 93490b2f15 Add musl target for Alpine linux support (#8)
Building with `CGO_ENABLED=0` results in a binary which can run on Alpine linux (with musl libc), but it also disables SQLite support.

Adding an additional target allows people to decide this tradeoff for themselves.
2017-02-28 21:54:01 -08:00

24 lines
583 B
Makefile

DC := docker-compose
BUILD_FLAGS := -ldflags '-s'
all: clean container lint test build
clean:
rm -rf dist
container:
$(DC) build
lint:
$(DC) run dbmate golint
$(DC) run dbmate go vet
$(DC) run dbmate errcheck
test:
$(DC) run dbmate go test -v
build: clean
$(DC) run -e GOARCH=386 dbmate go build $(BUILD_FLAGS) -o dist/dbmate-linux-i386
$(DC) run -e GOARCH=amd64 dbmate go build $(BUILD_FLAGS) -o dist/dbmate-linux-amd64
# musl target does not support sqlite
$(DC) run -e GOARCH=amd64 -e CGO_ENABLED=0 dbmate go build $(BUILD_FLAGS) -o dist/dbmate-linux-musl-amd64