From b78d8433572bafe9e025cb9592908c25c3d72229 Mon Sep 17 00:00:00 2001 From: Sudar Date: Fri, 26 Jul 2013 18:47:46 +0530 Subject: [PATCH] Print config info about ARDMK_DIR after Common.mk file is included The show_config_variable macro is available in Common.mk file. So invoke it for ARDMK_DIR only after Common.mk file is included. Fix #111 --- arduino-mk/Arduino.mk | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk index 46cfa24..dde829d 100644 --- a/arduino-mk/Arduino.mk +++ b/arduino-mk/Arduino.mk @@ -214,16 +214,10 @@ endif ifndef ARDMK_DIR # presume it's a level above the path to our own file ARDMK_DIR := $(realpath $(dir $(realpath $(lastword $(MAKEFILE_LIST))))/..) - $(call show_config_variable,ARDMK_DIR,[COMPUTED],(relative to $(notdir $(lastword $(MAKEFILE_LIST))))) else - $(call show_config_variable,ARDMK_DIR,[USER]) -endif - -ifndef ARDMK_PATH - ARDMK_PATH = $(ARDMK_DIR)/bin - $(call show_config_variable,ARDMK_PATH,[COMPUTED],(relative to ARDMK_DIR)) -else - $(call show_config_variable,ARDMK_PATH,[USER]) + # show_config_variable macro is defined in Common.mk file and is not available yet. + # Let's define a variable to know that user specified ARDMK_DIR + ARDMK_DIR_MSG = USER endif ifneq ($(wildcard $(ARDMK_DIR)/arduino-mk/Common.mk),) @@ -236,6 +230,20 @@ else endif endif +# show_config_variable macro is available now. So let's print config details for ARDMK_DIR +ifndef ARDMK_DIR_MSG + $(call show_config_variable,ARDMK_DIR,[COMPUTED],(relative to $(notdir $(lastword $(MAKEFILE_LIST))))) +else + $(call show_config_variable,ARDMK_DIR,[USER]) +endif + +ifndef ARDMK_PATH + ARDMK_PATH = $(ARDMK_DIR)/bin + $(call show_config_variable,ARDMK_PATH,[COMPUTED],(relative to ARDMK_DIR)) +else + $(call show_config_variable,ARDMK_PATH,[USER]) +endif + ######################################################################## # # Arduino Directory