Skip to content

Commit 2019a1e

Browse files
committed
Makefile: fix DESTDIR and PREFIX concatenation
Commits 77374e8 and b5f530a changed handling of the `DESTDIR` and `PREFIX` variables, and introduced a `MANDIR` variable. However, in those commits, the variables are concatenated with a directory separator (`/`); `$DESTDIR/$PREFIX`. The `$PREFIX` variable (and consequently, the `MANDIR` variable) already should have a leading `/` (absolute path), so there should be no need to add it. In addition, adding the `/`, would not allow either an empty path to be passed (well, it would result in `//` in the path), or for `$PREFIX` to be used with a relative path (with an empty `$PREFIX`). This patch removes the directory separator. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent e1f2865 commit 2019a1e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ man/%: docs/man/%.md FORCE
255255
go-md2man -in "$<" -out "$@"
256256

257257
define installmanpage
258-
$(INSTALL) -d $(DESTDIR)/$(MANDIR)/man$(2);
259-
gzip -c $(1) >$(DESTDIR)/$(MANDIR)/man$(2)/$(3).gz;
258+
$(INSTALL) -d $(DESTDIR)$(MANDIR)/man$(2);
259+
gzip -c $(1) >$(DESTDIR)$(MANDIR)/man$(2)/$(3).gz;
260260
endef
261261

262262
install-man: man
@@ -351,12 +351,12 @@ clean-test: ## clean up debris from previously failed tests
351351

352352
install: ## install binaries
353353
@echo "$(WHALE) $@ $(BINARIES)"
354-
@$(INSTALL) -d $(DESTDIR)/$(PREFIX)/bin
355-
@$(INSTALL) $(BINARIES) $(DESTDIR)/$(PREFIX)/bin
354+
@$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
355+
@$(INSTALL) $(BINARIES) $(DESTDIR)$(PREFIX)/bin
356356

357357
uninstall:
358358
@echo "$(WHALE) $@"
359-
@rm -f $(addprefix $(DESTDIR)/$(PREFIX)/bin/,$(notdir $(BINARIES)))
359+
@rm -f $(addprefix $(DESTDIR)$(PREFIX)/bin/,$(notdir $(BINARIES)))
360360

361361
ifeq ($(GOOS),windows)
362362
install-deps:

0 commit comments

Comments
 (0)