Makefile: fix DESTDIR and PREFIX concatenation
Commits77374e8
andb5f530a
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 <github@gone.nl>
This commit is contained in:
parent
e1f28659bc
commit
2019a1e68f
10
Makefile
10
Makefile
@ -255,8 +255,8 @@ man/%: docs/man/%.md FORCE
|
|||||||
go-md2man -in "$<" -out "$@"
|
go-md2man -in "$<" -out "$@"
|
||||||
|
|
||||||
define installmanpage
|
define installmanpage
|
||||||
$(INSTALL) -d $(DESTDIR)/$(MANDIR)/man$(2);
|
$(INSTALL) -d $(DESTDIR)$(MANDIR)/man$(2);
|
||||||
gzip -c $(1) >$(DESTDIR)/$(MANDIR)/man$(2)/$(3).gz;
|
gzip -c $(1) >$(DESTDIR)$(MANDIR)/man$(2)/$(3).gz;
|
||||||
endef
|
endef
|
||||||
|
|
||||||
install-man: man
|
install-man: man
|
||||||
@ -351,12 +351,12 @@ clean-test: ## clean up debris from previously failed tests
|
|||||||
|
|
||||||
install: ## install binaries
|
install: ## install binaries
|
||||||
@echo "$(WHALE) $@ $(BINARIES)"
|
@echo "$(WHALE) $@ $(BINARIES)"
|
||||||
@$(INSTALL) -d $(DESTDIR)/$(PREFIX)/bin
|
@$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
|
||||||
@$(INSTALL) $(BINARIES) $(DESTDIR)/$(PREFIX)/bin
|
@$(INSTALL) $(BINARIES) $(DESTDIR)$(PREFIX)/bin
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
@echo "$(WHALE) $@"
|
@echo "$(WHALE) $@"
|
||||||
@rm -f $(addprefix $(DESTDIR)/$(PREFIX)/bin/,$(notdir $(BINARIES)))
|
@rm -f $(addprefix $(DESTDIR)$(PREFIX)/bin/,$(notdir $(BINARIES)))
|
||||||
|
|
||||||
ifeq ($(GOOS),windows)
|
ifeq ($(GOOS),windows)
|
||||||
install-deps:
|
install-deps:
|
||||||
|
Loading…
Reference in New Issue
Block a user