Skip to content

Commit

Permalink
fix: add ldflags to 'make install' for version output
Browse files Browse the repository at this point in the history
  • Loading branch information
moooofly committed Feb 7, 2019
1 parent 9ef1e1d commit 2a8c3cb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ all: lint build test

build:
@echo "==> Building ..."
$(GOBUILD) -o harborctl_${GOOS}_${GOARCH} -ldflags '$(LDFLAGS)' ./
$(GOBUILD) -o harborctl -ldflags '$(LDFLAGS)' .
@echo ""

install:
@echo "==> Installing ..."
go install -x ${SRC}
go install -ldflags '$(LDFLAGS)' .
@echo ""

lint:
Expand All @@ -55,10 +55,10 @@ deps:
@echo ""

build_linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build $(BUILD_FLAG) -o harborctl_linux_amd64 -ldflags '$(LDFLAGS)' ./
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build $(BUILD_FLAG) -o harborctl_linux_amd64 -ldflags '$(LDFLAGS)' .

build_darwin:
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build $(BUILD_FLAG) -o harborctl_darwin_amd64 -ldflags '$(LDFLAGS)' ./
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build $(BUILD_FLAG) -o harborctl_darwin_amd64 -ldflags '$(LDFLAGS)' .

pack: build_linux build_darwin
@echo "==> Packing ..."
Expand All @@ -78,7 +78,7 @@ misspell:

clean:
@echo "==> Cleaning ..."
go clean -x -i ${SRC}
go clean -x -i .
rm -f harborctl_*
rm -rf *.out
rm -rf *.tar.gz
Expand Down

0 comments on commit 2a8c3cb

Please sign in to comment.