############################################################################### # # include file to check version of GHS tools # # Copyright (C) Nintendo. All rights reserved. # # These coded instructions, statements, and computer programs contain # proprietary information of Nintendo of America Inc. and/or Nintendo # Company Ltd., and are protected by Federal copyright law. They may # not be disclosed to third parties or copied or duplicated in any form, # in whole or in part, without the prior written consent of Nintendo. # ############################################################################### ifeq ($(_@), @) SHOW_GHS_VERSION=$(info Using GHS tools version $(CAFE_GHS_VERSION) ($(GHS_VERSION_NUMBER))) else SHOW_GHS_VERSION= endif ifndef GHS_VERSION_CHECK_MK export GHS_VERSION_CHECK_MK := TRUE ifndef CAFE_REPORTED_GHS_VERSION export CAFE_REPORTED_GHS_VERSION := 1 REQUIRED_GHS_VERSION := "v5.3.25" REQUIRED_GHS_VERSION_OLD := "v5.3.25" MIN_GHS_VERSION_NUMBER := 50302400 ifndef CAFE_GHS_VERSION $(error error: CAFE_GHS_VERSION not set. cafe.bat sets this environment variable.) else GHS_VERSION_NUMBER_P1 := $(strip $(subst P,0,$(subst .,0,$(subst Nintendo,,$(subst v,,$(CAFE_GHS_VERSION)))))) GHS_VERSION_NUMBER_WORDS := $(words $(GHS_VERSION_NUMBER_P1)) ifeq ($(GHS_VERSION_NUMBER_WORDS),1) GHS_VERSION_NUMBER := $(word 1, $(GHS_VERSION_NUMBER_P1))00 else ifeq ($(GHS_VERSION_NUMBER_WORDS),2) GHS_VERSION_NUMBER := $(word 1, $(GHS_VERSION_NUMBER_P1))$(word 2, $(GHS_VERSION_NUMBER_P1)) else ifeq ($(GHS_VERSION_NUMBER_WORDS), 8) GHS_VERSION_NUMBER := $(word 1, $(GHS_VERSION_NUMBER_P1))$(word 2, $(GHS_VERSION_NUMBER_P1)) else $(error error: can't parse $(CAFE_GHS_VERSION) words = $(GHS_VERSION_NUMBER_WORDS)) endif endif endif $(SHOW_GHS_VERSION) ifneq ($(shell if [ $(GHS_VERSION_NUMBER) -ge $(MIN_GHS_VERSION_NUMBER) ]; then echo pass; fi),pass) ifeq ("$(CAFE_GHS_VERSION)","$(REQUIRED_GHS_VERSION_OLD)") $(info === warning: Please update to GHS version "$(REQUIRED_GHS_VERSION)".) $(warning warning: Old GHS version used ($(CAFE_GHS_VERSION))) else $(info === error: Please update to GHS version "$(REQUIRED_GHS_VERSION)".) $(error error: Invalid GHS version used ($(CAFE_GHS_VERSION))) endif endif endif endif endif