Skip to content

Commit 9a7c8dc

Browse files
committed
Rename INSTALL_PREFIX to DESTDIR and fix BINNAME
1 parent a5d4e9d commit 9a7c8dc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# V=1 for verbose output.
33
# BINNAME=step to change the name of the executable
44
# PREFIX=bin/ to change the build output path
5-
# INSTALL_PREFIX=/usr/local/bin to change the install path
5+
# DESTDIR=/usr/local/bin to change the install path
66
# GOOS_OVERRIDE="GOOS=linux GOARCH=arm GOARM=6" to change OS and arch
77
# CGO_OVERRIDE="CGO_ENABLED=1" to enable CGO
88
#
@@ -150,14 +150,14 @@ govulncheck:
150150
# Install
151151
#########################################
152152

153-
INSTALL_PREFIX?=/usr/local/
153+
DESTDIR?=/usr/local/
154154

155-
install: $(PREFIX)bin/step
156-
$Q mkdir -p $(INSTALL_PREFIX)bin/
157-
$Q install $(PREFIX)bin/step $(DESTDIR)$(INSTALL_PREFIX)bin/step
155+
install: $(PREFIX)bin/$(BINNAME)
156+
$Q mkdir -p $(DESTDIR)bin/
157+
$Q install $(PREFIX)bin/$(BINNAME) $(DESTDIR)bin/$(BINNAME)
158158

159159
uninstall:
160-
$Q rm -f $(DESTDIR)$(INSTALL_PREFIX)/bin/step
160+
$Q rm -f $(DESTDIR)/bin/$(BINNAME)
161161

162162
.PHONY: install uninstall
163163

@@ -166,7 +166,7 @@ uninstall:
166166
#########################################
167167

168168
clean:
169-
$Q rm -f bin/step
169+
$Q rm -f bin/$(BINNAME)
170170
$Q rm -rf dist
171171

172172
.PHONY: clean
@@ -182,7 +182,7 @@ define BUNDLE_MAKE
182182
# $(2) -- Go Architecture (e.g. amd64, arm, arm64, etc.)
183183
# $(3) -- Go ARM architectural family (e.g. 7, 8, etc.)
184184
# $(4) -- Parent directory for executables generated by 'make'.
185-
$Q GOOS_OVERRIDE='GOOS=$(1) GOARCH=$(2) GOARM=$(3)' PREFIX=$(4) make $(4)bin/step
185+
$Q GOOS_OVERRIDE='GOOS=$(1) GOARCH=$(2) GOARM=$(3)' PREFIX=$(4) make $(4)bin/$(BINNAME)
186186
endef
187187

188188
binary-linux-amd64:

0 commit comments

Comments
 (0)