Skip to content

Commit 2362b12

Browse files
Expand DESTDIR outside of prefixed dir variables
1 parent ec84197 commit 2362b12

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Makefile

+9-9
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ SHARDS_CONFIG_BUILD_COMMIT := $(shell git rev-parse --short HEAD 2> /dev/null)
4242
SHARDS_VERSION := $(shell cat VERSION)
4343
SOURCE_DATE_EPOCH := $(shell (git show -s --format=%ct HEAD || stat -c "%Y" Makefile || stat -f "%m" Makefile) 2> /dev/null)
4444
EXPORTS := SHARDS_CONFIG_BUILD_COMMIT="$(SHARDS_CONFIG_BUILD_COMMIT)" SOURCE_DATE_EPOCH="$(SOURCE_DATE_EPOCH)"
45-
BINDIR ?= $(DESTDIR)$(PREFIX)/bin
46-
MANDIR ?= $(DESTDIR)$(PREFIX)/share/man
45+
BINDIR ?= $(PREFIX)/bin
46+
MANDIR ?= $(PREFIX)/share/man
4747
INSTALL ?= /usr/bin/install
4848

4949
MOLINILLO_VERSION = $(shell $(CRYSTAL) eval 'require "yaml"; puts YAML.parse(File.read("shard.lock"))["shards"]["molinillo"]["version"]')
@@ -78,17 +78,17 @@ bin/shards$(EXE): $(SOURCES) $(TEMPLATES) lib
7878
.PHONY: install
7979
install: ## Install shards
8080
install: bin/shards$(EXE) man/shards.1.gz man/shard.yml.5.gz
81-
$(INSTALL) -m 0755 -d "$(BINDIR)" "$(MANDIR)/man1" "$(MANDIR)/man5"
82-
$(INSTALL) -m 0755 bin/shards$(EXE) "$(BINDIR)"
83-
$(INSTALL) -m 0644 man/shards.1.gz "$(MANDIR)/man1"
84-
$(INSTALL) -m 0644 man/shard.yml.5.gz "$(MANDIR)/man5"
81+
$(INSTALL) -m 0755 -d "$(DESTDIR)$(BINDIR)" "$(DESTDIR)$(MANDIR)/man1" "$(DESTDIR)$(MANDIR)/man5"
82+
$(INSTALL) -m 0755 bin/shards$(EXE) "$(DESTDIR)$(BINDIR)"
83+
$(INSTALL) -m 0644 man/shards.1.gz "$(DESTDIR)$(MANDIR)/man1"
84+
$(INSTALL) -m 0644 man/shard.yml.5.gz "$(DESTDIR)$(MANDIR)/man5"
8585

8686
.PHONY: uninstall
8787
uninstall: ## Uninstall shards
8888
uninstall:
89-
rm -f "$(BINDIR)/shards"
90-
rm -f "$(MANDIR)/man1/shards.1.gz"
91-
rm -f "$(MANDIR)/man5/shard.yml.5.gz"
89+
rm -f "$(DESTDIR)$(BINDIR)/shards"
90+
rm -f "$(DESTDIR)$(MANDIR)/man1/shards.1.gz"
91+
rm -f "$(DESTDIR)$(MANDIR)/man5/shard.yml.5.gz"
9292

9393
.PHONY: test
9494
test: ## Run all tests

0 commit comments

Comments
 (0)