iso
5/10/2016 - 12:56 AM

Check if a command exist in Makefile

Check if a command exist in Makefile

LS := ; @which ls > /dev/null

ifndef LS
$(eval ls := $(shell which ls))
else
$(eval ls := something/ls
endif

my-ls:
  $(ls) -lah