Let it be clear that in this question I ask for further guidance with my current version of Makefile used for my own Shell OpenSSL file en-/decryption scripts, not those scripts themselves.
I did my best, but this is my own first Makefile, so I better give it to you for review. I may only think the work is done, there may be many issues I don't know about.
Requirements:
The implicit destination path must be easily overridden without having to edit the
MakefileThe implicit target must check for integrity (hashsum) stored in the file
SHA512SUMSThe file must account for non-standard Linux environments like Cygwin
I myself tested it under normal circumstances in Linux Mint 18.3 and Cygwin
All files can be simply acquired from GitHub page of this little project
The Makefile follows:
DESTDIR?=/usr/local/bin
install_path=$(DESTDIR)
script_name_1=encrypt-file-aes256
script_name_2=decrypt-file-aes256
user_id=$(shell whoami)
group_id=$(shell id -gn)
.PHONY: check
.PHONY: install
.PHONY: uninstall
check:
[ -f $(script_name_1) ] && [ -f $(script_name_2) ] && sha512sum --check SHA512SUMS --status && echo "OK: Files are prepared. You may use make install command now." || echo "ERROR: Files are missing and / or hashsum mismatch!"
install:
install --verbose --mode=0755 --owner=$(user_id) --group=$(group_id) --target-directory=$(install_path) $(script_name_1) $(script_name_2)
uninstall:
rm $(install_path)/$(script_name_1) $(install_path)/$(script_name_2)