target: add deprecated target name support

This enables us to change the target name without breaking any
target scripts.

Change-Id: I635f961e573264d3dab2560f3a803ef1986ccfde
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/919
Tested-by: jenkins
This commit is contained in:
Spencer Oliver
2012-10-24 15:07:11 +01:00
parent 1bba393e3c
commit 549d9bc72c
19 changed files with 340 additions and 313 deletions

View File

@@ -4909,6 +4909,15 @@ static int target_create(Jim_GetOptInfo *goi)
/* found */
break;
}
/* check for deprecated name */
if (target_types[x]->deprecated_name) {
if (0 == strcmp(cp, target_types[x]->deprecated_name)) {
/* found */
LOG_WARNING("target name is deprecated use: \'%s\'", target_types[x]->name);
break;
}
}
}
if (target_types[x] == NULL) {
Jim_SetResultFormatted(goi->interp, "Unknown target type %s, try one of ", cp);