Skip to content

Instantly share code, notes, and snippets.

@jomoespe
Created January 7, 2020 15:06
Show Gist options
  • Save jomoespe/181931e06f70064c3b00dbbfd2b7a6b9 to your computer and use it in GitHub Desktop.
Save jomoespe/181931e06f70064c3b00dbbfd2b7a6b9 to your computer and use it in GitHub Desktop.
Ckeck executable dependencies in a Makefile
# 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