From 4c63e84ce295387d74f0abdc83660b4de4500416 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Sun, 12 May 2024 03:29:41 +0200 Subject: Changed MK_ to MEX_ --- Makefile | 6 +++--- README.md | 14 +++++++------- makext.mk | 16 ++++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 2869487..12629ca 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ -MK_DESCRIPTION="This provides some additional tools for makefiles." -MK_LICENSE="Released under the BSD two-clause license, see the LICENSE file for more information." -MK_ASSURE="python3 ls tree clang" +MEX_DESCRIPTION="This provides some additional tools for makefiles." +MEX_LICENSE="Released under the BSD two-clause license, see the LICENSE file for more information." +MEX_ASSURE="python3 ls tree clang" include makext.mk diff --git a/README.md b/README.md index 5f8fd86..ada9a43 100644 --- a/README.md +++ b/README.md @@ -93,22 +93,22 @@ Targets: You can provide description for the project that will be displayed together with `help`. To do this provide this information in the -`MK_DESCRIPTION` variable. +`MEX_DESCRIPTION` variable. Same goes for license information. Provide this information by creating -`MK_LICENSE` variable. +`MEX_LICENSE` variable. If these variables are not present this information will not be displayed in the help. > [!IMPORTANT] -> Variables `MK_DESCRIPTION` and `MK_LICENSE` must be defined before you +> Variables `MEX_DESCRIPTION` and `MEX_LICENSE` must be defined before you > include `makext.mk` to your `Makefile`. This is needed because the way > GNU Make is parsing Makefiles. ```make -MK_DESCRIPTION="This provides some additional tools for makefiles." -MK_LICENSE="Released under the BSD two-clause license, see the LICENSE file for more information." +MEX_DESCRIPTION="This provides some additional tools for makefiles." +MEX_LICENSE="Released under the BSD two-clause license, see the LICENSE file for more information." include makext.mk @@ -143,7 +143,7 @@ be used. If programs are missing recipes can only partially be executed leaving project in a potentially broken state. ```make -MK_ASSURE="python3 ls tree clang" +MEX_ASSURE="python3 ls tree clang" include makext.mk @@ -152,7 +152,7 @@ build-app: .assure ``` `.assure` prerequisite will loop over the list of programs defined in -`MK_ASSURE` variable and in case one is missing will exit `make` with +`MEX_ASSURE` variable and in case one is missing will exit `make` with status code error 1. This will stop executing the recipe and therefore not execute anything in target `build-app`. diff --git a/makext.mk b/makext.mk index b4846c0..99cba0a 100644 --- a/makext.mk +++ b/makext.mk @@ -24,23 +24,23 @@ endif # and adds description and license information if data provided. .PHONY: .help .help: -ifdef MK_DESCRIPTION - @echo "$(MK_DESCRIPTION)\n" | fmt +ifdef MEX_DESCRIPTION + @echo "$(MEX_DESCRIPTION)\n" | fmt endif @echo "Targets:" @grep -vE '^[[:space:]]' $(MAKEFILE_LIST) | grep -E '^.*:.* #' | sed -E 's/(.*):(.*):.*#(.*)/ \2###\3/' | column -t -s '###' -ifdef MK_LICENSE - @echo "\n$(MK_LICENSE)" | fmt +ifdef MEX_LICENSE + @echo "\n$(MEX_LICENSE)" | fmt endif -# Checks `MK_ASSURE` variable if all the programs declared actually +# Checks `MEX_ASSURE` variable if all the programs declared actually # exist on a machine. If not this exists make with error. .PHONY: .assure .assure: -ifndef MK_ASSURE - @echo "Variable MK_ASSURE is not defined. Can not check for programs." +ifndef MEX_ASSURE + @echo "Variable MEX_ASSURE is not defined. Can not check for programs." else - @for prog in $(shell echo $(MK_ASSURE)); do \ + @for prog in $(shell echo $(MEX_ASSURE)); do \ if ! which $$prog > /dev/null; then \ echo "Error: '$$prog' not found on this machine."; \ exit 1; \ -- cgit v1.2.3