Check if variable is defined in a Makefile Using ifndef ifndef MY_FLAG $(error MY_FLAG is not set) endif