aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuca Matei Pintilie <luca@lucamatei.com> 2023-09-13 23:59:09 +0200
committerThomas Voss <mail@thomasvoss.com> 2023-09-14 00:02:51 +0200
commita9b6c2bd68ccfd72a833355fce55feda914fe3bd (patch)
treefcfd937aac9dfc21034fee800b189e40fc902bdd /Makefile
parente93e75ca1dd782fb0c6df97be89d03d7f1cc66d3 (diff)
Add MMV_NAME and MCP_NAME compile-time variablesv1.3.0
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 <luca@lucamatei.com> Co-authored-by: Thomas Voss <mail@thomasvoss.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 10 insertions, 4 deletions
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