diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-05-12 03:25:48 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-05-12 03:25:48 +0200 |
| commit | 2871b670f47b7d04d18abae56ce23ffd38a32249 (patch) | |
| tree | e434a1399de8b8eb3c3f6459827ad183e38bfd0e /makext.mk | |
| parent | 45e996e7c954217efcbc9d07187a070b14e19d53 (diff) | |
| download | makext-2871b670f47b7d04d18abae56ce23ffd38a32249.tar.gz | |
Added .assure extension
Diffstat (limited to 'makext.mk')
| -rw-r--r-- | makext.mk | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -15,6 +15,11 @@ # `makext` was written by Mitja Felicijan and is released under the BSD # two-clause license, see the LICENSE file for more information. +# Checks if operating system is Windows and exists with error. +ifeq ($(OS),Windows_NT) +$(error makext does not support Windows operating system) +endif + # Help extension that lists all the targets with descriptions # and adds description and license information if data provided. .PHONY: .help @@ -27,3 +32,18 @@ endif ifdef MK_LICENSE @echo "\n$(MK_LICENSE)" | fmt endif + +# Checks `MK_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." +else + @for prog in $(shell echo $(MK_ASSURE)); do \ + if ! which $$prog > /dev/null; then \ + echo "Error: '$$prog' not found on this machine."; \ + exit 1; \ + fi; \ + done +endif |
