At the beginning of each makefile, I validate my environment variables.  The
two invalid_* functions return an error message on failure, or nothing on
success.

# Validate arguments
INVALID_MODE := $(invalid_mode)
INVALID_PLAT := $(invalid_plat)

Then I add a 'valid' goal that uses these calculated values to determine
whether the environment needs to be aborted due to an invalid environment.

# Goals
all: valid
        ... the build ...

valid:
ifdef INVALID_MODE
        echo $(INVALID_MODE)
        exit 2
endif
ifdef INVALID_PLAT
        echo $(INVALID_PLAT)
        exit 2
endif

This works, but is mildly cumbersome.  Is there a way to abort make before I
make it to my first goal/target?

Adam


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to