#
# IMPORTED VARIABLES:
#
# OMNIMAKE_PRE_ENVIRONMENT_VERIFICATION  -  Targets to be executed before environment verification
# OMNIMAKE_POST_ENVIRONMENT_VERIFICATION -  Targets to be executed after environment verification
#
#


.PHONY: omnimake_announce_verification omnimake_verify_environment omnimake_verify_variables

omnimake_verify_environment: omnimake_announce_verification $(OMNIMAKE_PRE_ENVIRONMENT_VERIFICATION) omnimake_verify_variables $(OMNIMAKE_POST_ENVIRONMENT_VERIFICATION)

omnimake_announce_verification:
	$(SILENT) if [ "$(OMNIMAKE_QUIET_MAKE)" != "YES" ]; then	\
	    $(ECHO) Verifying build environment;		\
	fi

# Verify that required variables are set
omnimake_verify_variables:
	$(SILENT) if [ -z "$(OMNIMAKE_ROOT)" ]; then		\
		$(ECHO) OMNIMAKE_ROOT not set;		\
		exit 1;						\
	fi;
	$(SILENT) if [ -z "$(OMNIMAKE_BUILD_OUTPUT_ROOT)" ]; then	\
		$(ECHO) OMNIMAKE_BUILD_OUTPUT_ROOT not set;		\
		exit 1;						\
	fi;
	$(SILENT) if [ -z "$(OMNIMAKE_INSTALL_ROOT)" ]; then	\
		$(ECHO) OMNIMAKE_INSTALL_ROOT not set;		\
		exit 1;						\
	fi;

