Created
January 7, 2020 15:06
-
-
Save jomoespe/181931e06f70064c3b00dbbfd2b7a6b9 to your computer and use it in GitHub Desktop.
Ckeck executable dependencies in a Makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check if all executables needed are in the PATH before execite any rule/task. | |
EXECUTABLES = rm mkdir cp mvn java go # List of executables | |
CHECK_EXECUTABLES := $(foreach exec,$(EXECUTABLES),\ | |
$(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH. Check README.md for build requirements"))) | |
# This must be at the begining of the file, so ASAP make parses the file will fail if some of | |
# dependencies does not exist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment