Let us suppose we use GNU Make on Linux for the purpose of this question.
As a regular shell script writer, the Makefile scripting seems a little odd to me.
Anyways, that is opinion-based, so straight to my question:
I found a way for me to write Makefiles a little bit more like shell scripts.
That being a line break / continuation character usage: \
Example beginning of my Makefile:
DESTDIR ?=
PREFIX ?= /usr/local/bin
install_path := $(DESTDIR)$(PREFIX)
encrypt_script := encrypt-file-aes256
decrypt_script := decrypt-file-aes256
distrib_name := openssl-encryption
this_file := $(lastword $(MAKEFILE_LIST))
.PHONY: check
check: $(encrypt_script) $(decrypt_script)
@tput bold; tput setaf 3; echo Target: $@; echo; tput sgr0
@if [ -f SHA512SUM ]; then \
( sha512sum --check SHA512SUM && \
( tput bold; tput setaf 2; echo; echo "Ok. You may use 'sudo make install' or '(sudo) make install PREFIX=SomeDir' command now."; tput sgr0 ) || \
( tput bold; tput setaf 1; echo; echo "ERROR: Files hash sum mismatch!"; echo; tput sgr0; exit 1 ) \
) \
else \
$(MAKE) --file=$(this_file) SHA512SUM; \
fi
Have I totally crossed the line, or is it in common concept acceptable?
To avoid closing on opinion-based, please avoid your personal preferences, and quote sources.
Here is just a snippet of the code. You can find the whole Makefile without these changes here.