XGOARCH := amd64 XGOOS := linux XBIN := $(XGOOS)_$(XGOARCH)/journal all: checkfmt vet test install test: go test ./... vet: go vet ./... checkfmt: @sh -c "test -z $$(gofmt -l .)" || { echo "one or more files need to be formatted: try make fmt to fix this automatically"; exit 1; } fmt: gofmt -w . install: go install ./... xinstall: env GOOS=$(XGOOS) GOARCH=$(XGOARCH) CGO_ENABLED=1 \ CC=x86_64-linux-musl-gcc go install -ldflags '-extldflags "-static"' ./... publish: ifndef DEST_PATH $(error DEST_PATH must be set when publishing) endif rsync -a $(GOPATH)/bin/$(XBIN) $(DEST_PATH)/$(XBIN) @sha256sum $(GOPATH)/bin/$(XBIN)