~technomancy/fennel

Makefile: add DESTDIR support v1 APPLIED

Michel Alexandre Salim: 1
 Makefile: add DESTDIR support

 1 files changed, 5 insertions(+), 4 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~technomancy/fennel/patches/19851/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] Makefile: add DESTDIR support Export this patch

On Linux distributions, a standard practice is to override `DESTDIR`
when running `make install` during the packaging process.

Support using that variable rather than requiring `PREFIX` to be
overridden.
Signed-off-by: Michel Alexandre Salim <michel@michel-slm.name>
---
 Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index aec162f..7500f0e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
LUA ?= lua
LUA_VERSION ?= $(shell $(LUA) -e 'v=_VERSION:gsub("^Lua *","");print(v)')
DESTDIR ?=
PREFIX ?= /usr/local
BIN_DIR ?= $(PREFIX)/bin
LUA_LIB_DIR ?= $(PREFIX)/share/lua/$(LUA_VERSION)
@@ -82,10 +83,10 @@ coverage: fennel
	@echo "generated luacov.report.out"

install: fennel fennel.lua fennelview.lua
	mkdir -p $(BIN_DIR) && \
		cp fennel $(BIN_DIR)/
	mkdir -p $(LUA_LIB_DIR) && \
		for f in fennel.lua fennelview.lua; do cp $$f $(LUA_LIB_DIR)/; done
	mkdir -p $(DESTDIR)$(BIN_DIR) && \
		cp fennel $(DESTDIR)$(BIN_DIR)/
	mkdir -p $(DESTDIR)$(LUA_LIB_DIR) && \
		for f in fennel.lua fennelview.lua; do cp $$f $(DESTDIR)$(LUA_LIB_DIR)/; done

# Release-related tasks:

-- 
2.29.2
Michel Alexandre Salim <michel@michel-slm.name> writes: