From a9b6c2bd68ccfd72a833355fce55feda914fe3bd Mon Sep 17 00:00:00 2001 From: Luca Matei Pintilie Date: Wed, 13 Sep 2023 23:59:09 +0200 Subject: Add MMV_NAME and MCP_NAME compile-time variables Due to the sheer popularity of the "mmv" name it might conflict with other programs installed on the user's computer. As such the MMV_NAME and MCP_NAME environmental variables can control the program's name at compile time, allowing the user to avoid name conflicts with other programs. If the variables are not set then they will silently default back to "mmv" and "mcp" respectively. Signed-off-by: Luca Matei Pintilie Co-authored-by: Thomas Voss --- Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c49dd38..131acc5 100644 --- a/Makefile +++ b/Makefile @@ -6,13 +6,19 @@ MANDIR = ${DPREFIX}/share/man target = target/release/mmv +mmv = $${MMV_NAME:-mmv} +mcp = $${MCP_NAME:-mcp} + all: ${target} ${target}: src/main.rs cargo build --release install: mkdir -p ${DPREFIX}/bin ${DPREFIX}/share/man/man1 - cp ${target} ${DPREFIX}/bin/mmv - cp ${target} ${DPREFIX}/bin/mcp - cp mmv.1 ${MANDIR}/man1 - ln -srf ${MANDIR}/man1/mmv.1 ${MANDIR}/man1/mcp.1 + cp ${target} ${DPREFIX}/bin/${mmv} + cp mmv.1 ${MANDIR}/man1/${mmv}.1 + ln -srf ${DPREFIX}/bin/${mmv} ${DPREFIX}/bin/${mcp} + ln -srf ${MANDIR}/man1/${mmv}.1 ${MANDIR}/man1/${mcp}.1 + +clean: + rm -rf target -- cgit v1.2.3