Hi! I’ve wrote my first Makefile:
# PREFIX: sets the installation prefix
PREFIX?=/home/$(USER)/.local/bin
.PHONY: install
install:
cp -nv ./clip-view/clip-view.sh $(PREFIX)/clip-view
chmod +x $(PREFIX)/clip-view
.PHONY: uninstall
uninstall:
rm -v $(PREFIX)/clip-view
.PHONY: tests
tests:
env -C md-to-clip bats tests.bats
As I have several Bash scripts to install I wanna Makefile to provide capability to chose what ones to install. What’s the best way to do it? Create boolean-like variables specifying whether to install something or not or create separate script-specific targets like this:
.PHONY: some-script-name-install
some-script-name-install:
cp -nv ./from/path /to/path
chmod +x /to/path
and make install
target to install everything at once? I am asking from the perspective how traditionally this issue is solved. Another complete different solution is to create makefile-s separately for each Bash script.
The original question is here.