Skip to content

Commit 0fd5004

Browse files
cfergeauanjannath
authored andcommitted
Makefile: Rename $(CURDIR)/bin/crc$(IS_EXE) rule
This rule is marked as .PHONY, which instructs make that $(CURDIR)/bin/crc$(IS_EXE) is a 'virtual' target name, and does not correspond to an actual file existing on disk. We thus don't really have to make it that complicated, since this rule installs the crc binary with "go install", we can just rename it to "install" and make the Makefile slightly easier to read.
1 parent 1984dd8 commit 0fd5004

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ GOOS ?= $(shell go env GOOS)
3131
GOARCH ?= $(shell go env GOARCH)
3232
ORG := github.com/code-ready
3333
REPOPATH ?= $(ORG)/crc
34-
ifeq ($(GOOS),windows)
35-
IS_EXE := .exe
36-
endif
3734

3835
PACKAGES := go list ./... | grep -v /out
3936

@@ -62,7 +59,7 @@ LDFLAGS := $(VERSION_VARIABLES) -extldflags='-static' -s -w
6259

6360
# Add default target
6461
.PHONY: default
65-
default: $(CURDIR)/bin/crc$(IS_EXE)
62+
default: install
6663

6764
# Create and update the vendor directory
6865
.PHONY: vendor
@@ -75,8 +72,8 @@ binappend:
7572

7673
# Start of the actual build targets
7774

78-
.PHONY: $(CURDIR)/bin/crc$(IS_EXE)
79-
$(CURDIR)/bin/crc$(IS_EXE):
75+
.PHONY: install
76+
install:
8077
go install -ldflags="$(VERSION_VARIABLES)" ./cmd/crc
8178

8279
$(BUILD_DIR)/darwin-amd64/crc:

0 commit comments

Comments
 (0)