Fix for Makefile bug #30
This commit is contained in:
parent
0d0d63d8d1
commit
1e31e33707
16
Makefile
16
Makefile
|
@ -25,13 +25,19 @@ test:
|
||||||
@go test -v ./...
|
@go test -v ./...
|
||||||
|
|
||||||
BIN_DIR := $(GOPATH)/bin
|
BIN_DIR := $(GOPATH)/bin
|
||||||
GORICE := $(BIN_DIR)/github.com/GeertJohan/go.rice
|
GORICE := $(BIN_DIR)/rice
|
||||||
GOLANGCILINT := $(BIN_DIR)/golangci-lint
|
GOLANGCILINT := $(BIN_DIR)/golangci-lint
|
||||||
GITCHGLOG := $(BIN_DIR)/git-chglog
|
GITCHGLOG := $(BIN_DIR)/git-chglog
|
||||||
|
WEB_BUILD_DIR := ./web/build/manifest.json
|
||||||
|
|
||||||
$(GORICE):
|
$(GORICE):
|
||||||
@GO111MODULE=off go get -u github.com/GeertJohan/go.rice/rice
|
@GO111MODULE=off go get -u github.com/GeertJohan/go.rice/rice
|
||||||
|
|
||||||
|
$(WEB_BUILD_DIR):
|
||||||
|
@echo "First install Yarn and create a build of the web UI found under ./web"
|
||||||
|
@echo "Command: cd web && yarn build"
|
||||||
|
@exit 1
|
||||||
|
|
||||||
$(GITCHGLOG):
|
$(GITCHGLOG):
|
||||||
@GO111MODULE=off go get -u github.com/git-chglog/git-chglog/cmd/git-chglog
|
@GO111MODULE=off go get -u github.com/git-chglog/git-chglog/cmd/git-chglog
|
||||||
|
|
||||||
|
@ -49,7 +55,7 @@ LDFLAGS := -s -w
|
||||||
PLATFORMS := windows linux darwin
|
PLATFORMS := windows linux darwin
|
||||||
os = $(word 1, $@)
|
os = $(word 1, $@)
|
||||||
|
|
||||||
$(PLATFORMS): lint test gen
|
$(PLATFORMS): lint test
|
||||||
@mkdir -p release
|
@mkdir -p release
|
||||||
@GOOS=$(os) GOARCH=amd64 go build $(BUILD_FLAGS) -o release/$(BINARY)-$(BUILD_VERSION)-$(os)-amd64
|
@GOOS=$(os) GOARCH=amd64 go build $(BUILD_FLAGS) -o release/$(BINARY)-$(BUILD_VERSION)-$(os)-amd64
|
||||||
|
|
||||||
|
@ -59,10 +65,10 @@ all: lint test $(BINARY)
|
||||||
|
|
||||||
build: $(BINARY)
|
build: $(BINARY)
|
||||||
|
|
||||||
gen: $(GORICE)
|
gen: $(GORICE) $(WEB_BUILD_DIR)
|
||||||
@go generate ./...
|
@go generate ./...
|
||||||
|
|
||||||
$(BINARY): clean gen
|
$(BINARY): clean
|
||||||
@go build $(BUILD_FLAGS) -o $(BINARY)
|
@go build $(BUILD_FLAGS) -o $(BINARY)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@ -71,7 +77,7 @@ clean:
|
||||||
run: clean
|
run: clean
|
||||||
@go run $(BUILD_FLAGS) main.go $(ARGS)
|
@go run $(BUILD_FLAGS) main.go $(ARGS)
|
||||||
|
|
||||||
install: gen
|
install:
|
||||||
@echo $(GOPATH)
|
@echo $(GOPATH)
|
||||||
@echo "Commit Hash: `git rev-parse HEAD`"
|
@echo "Commit Hash: `git rev-parse HEAD`"
|
||||||
@echo "Old Hash: `shasum $(GOPATH)/bin/$(BINARY) 2>/dev/null | cut -c -32`"
|
@echo "Old Hash: `shasum $(GOPATH)/bin/$(BINARY) 2>/dev/null | cut -c -32`"
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue