From 935322665e4cba4eb2c299f67e24b458b63cb880 Mon Sep 17 00:00:00 2001 From: Ian Martin Date: Fri, 24 Jan 2014 12:50:43 -0500 Subject: [PATCH] rl78: Attempt to locate the IAR installation automatically and instruct the user how to specify IAR_PATH if it cannot be found. --- cpu/rl78/Makefile.rl78 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cpu/rl78/Makefile.rl78 b/cpu/rl78/Makefile.rl78 index 562453720..a20382b7f 100755 --- a/cpu/rl78/Makefile.rl78 +++ b/cpu/rl78/Makefile.rl78 @@ -47,7 +47,15 @@ ifdef IAR # Default library configuration (n = normal, f = full): LIB_CONFIG ?= n - IAR_PATH ?= C:\\Program\ Files\\IAR\ Systems\\Embedded\ Workbench\ 6.5\\rl78 + ifeq ($(IAR_PATH),) + IAR_SUBPATH := $(shell ls "C:\Program Files\IAR Systems" | tail -1 ) + + ifeq ($(IAR_SUBPATH),) + $(error Unable to find the IAR installation path. Please specify IAR_PATH. For example: make IAR_PATH="C:\\Program\ Files\\IAR\ Systems\\Embedded\ Workbench\ 6.5\\rl78" ) + endif + + IAR_PATH := "C:\Program Files\IAR Systems\$(IAR_SUBPATH)\rl78" + endif CC = $(IAR_PATH)\\bin\\iccrl78 LD = $(IAR_PATH)\\bin\\xlink