From 6b3dd79542bf0505853d99e2ed2dcca5052c2c2b Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 27 May 2023 08:56:05 -1000 Subject: [PATCH] ;dev: make copy-exe*/install-as*: install binaries to bin/old/ --- Makefile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index a3bcc0f4d..3fdd80e73 100644 --- a/Makefile +++ b/Makefile @@ -240,6 +240,17 @@ install: \ $(call def-help,install, download dependencies and install hledger executables to ~/.local/bin or equivalent (with stack)) $(STACK) install +install-as-%: $(call def-help,install-as-FOO, like make install but install to bin/old/hledger*-FOO) + @$(STACK) install --local-bin-path bin/old + @printf "\nMoved executables to:\n" + @for EXE in $(BINARIES); do mv bin/old/$$EXE bin/old/$$EXE-$*; echo "- bin/$$EXE-$*"; done + +copy-exe-%: $(call def-help,copy-exe.FOO, copy ~/.local/bin/hledger to bin/old/hledger-FOO) + cp ~/.local/bin/hledger bin/old/hledger-$* + +copy-exes-%: $(call def-help,copy-exes.FOO, copy ~/.local/bin/hledger* to bin/old/hledger*-FOO) + for EXE in $(BINARIES); do cp ~/.local/bin/$$EXE bin/old/$$EXE-$*; done + ############################################################################### $(call def-help-subheading,BUILDING:) @@ -431,17 +442,6 @@ ghci-doctest: $(call def-help,ghci-doctest, start ghci REPL on hledger-lib docte ghci-shake: $(call def-help,ghci-shake, start ghci REPL on Shake.hs) $(STACK) exec $(SHAKEDEPS) -- ghci Shake.hs -copy-exe-%: $(call def-help,copy-exe.FOO, copy ~/.local/bin/hledger to hledger-FOO) - cp ~/.local/bin/hledger{,-$*} - -copy-exes-%: $(call def-help,copy-exes.FOO, copy ~/.local/bin/hledger* to hledger*-FOO) - for EXE in $(BINARIES); do cp ~/.local/bin/$$EXE{,-$*}; done - -install-as-%: $(call def-help,install-as-FOO, like stack install but save executables as bin/old/hledger*-FOO) - @$(STACK) install --local-bin-path bin/old - @printf "\nMoved executables to:\n" - @for EXE in $(BINARIES); do mv bin/old/$$EXE bin/old/$$EXE-$*; echo "- bin/$$EXE-$*"; done - # make must be GNU Make 4.3+ .PHONY: shellcompletions shellcompletions: $(call def-help,shellcompletions, update shell completions in hledger package)