@@ -711,6 +711,18 @@ class ARMParser extends KeilParser<KeilARMOption> {
711711 if ( eideOption . afterBuildTasks == undefined )
712712 eideOption . afterBuildTasks = [ ] ;
713713
714+ // keil props
715+ const mdk_OutputName : string = commonOption . OutputName ;
716+ const mdk_OutputDirectory : string = File . normalize ( commonOption . OutputDirectory || 'Objects' ) ;
717+ const mdk_CreateHexFile : boolean = commonOption . CreateHexFile == '1' ;
718+ const mdk_CreateLib : boolean = commonOption . CreateLib == '1' ;
719+
720+ // setup env
721+ if ( mdk_OutputName && mdk_OutputName != this . _file . noSuffixName )
722+ env [ 'KEIL_OUTPUT_NAME' ] = mdk_OutputName ;
723+ if ( mdk_OutputDirectory )
724+ env [ 'KEIL_OUTPUT_DIR' ] = mdk_OutputDirectory
725+
714726 // --------------------------------------------
715727 // KEIL Key Code: % # @ ! $
716728 // % File name with extension (PROJECT1.UVPROJ)
@@ -730,22 +742,17 @@ class ARMParser extends KeilParser<KeilARMOption> {
730742 . replace ( / % H \b / g, '${KEIL_OUTPUT_NAME}.hex' )
731743 . replace ( / % L \b / g, '${KEIL_OUTPUT_NAME}.axf' )
732744 . replace ( / % P \b / g, this . _file . name )
733- . replace ( / # H \b / g, '${OutDir }\\${KEIL_OUTPUT_NAME}.hex' )
734- . replace ( / # L \b / g, '${OutDir }\\${KEIL_OUTPUT_NAME}.axf' )
745+ . replace ( / # H \b / g, '${KEIL_OUTPUT_DIR }\\${KEIL_OUTPUT_NAME}.hex' )
746+ . replace ( / # L \b / g, '${KEIL_OUTPUT_DIR }\\${KEIL_OUTPUT_NAME}.axf' )
735747 . replace ( / # P \b / g, this . _file . path )
736748 . replace ( / @ ( H | L ) \b / g, '${KEIL_OUTPUT_NAME}' )
737- . replace ( / \$ ( H | L ) \b / g, '${OutDir }\\' )
749+ . replace ( / \$ ( H | L ) \b / g, '${KEIL_OUTPUT_DIR }\\' )
738750 . replace ( / \$ J \b / g, '${ToolchainRoot}\\include\\' )
739751 . replace ( / \$ K \b / g, '${ToolchainRoot}\\' )
740- . replace ( / \! H \b / g, '.\\${OutDirBase }\\${KEIL_OUTPUT_NAME}.hex' )
741- . replace ( / \! L \b / g, '.\\${OutDirBase }\\${KEIL_OUTPUT_NAME}.axf' )
752+ . replace ( / \! H \b / g, '${KEIL_OUTPUT_DIR }\\${KEIL_OUTPUT_NAME}.hex' )
753+ . replace ( / \! L \b / g, '${KEIL_OUTPUT_DIR }\\${KEIL_OUTPUT_NAME}.axf' )
742754 . replace ( / \b K E I L _ O U T P U T _ N A M E \b / g, OUTNAME_KEY ) ;
743755
744- // keil props
745- const mdk_OutputDirectory : string = File . normalize ( commonOption . OutputDirectory || '.' ) ;
746- const mdk_CreateHexFile : boolean = commonOption . CreateHexFile == '1' ;
747- const mdk_CreateLib : boolean = commonOption . CreateLib == '1' ;
748-
749756 // BeforeMake
750757 const beforeMake = commonOption . BeforeMake ;
751758 if ( beforeMake ) {
@@ -994,11 +1001,6 @@ class ARMParser extends KeilParser<KeilARMOption> {
9941001 obj . defineList = this . parseMacroString ( target . TargetOption . TargetArmAds . Cads . VariousControls . Define ) ;
9951002
9961003 obj . env = { } ;
997- const keil_out_name = target . TargetOption . TargetCommonOption . OutputName ;
998- if ( keil_out_name && keil_out_name != this . _file . noSuffixName ) {
999- obj . env [ 'KEIL_OUTPUT_NAME' ] = keil_out_name ;
1000- }
1001-
10021004 obj . compileOption = Object . create ( null ) ;
10031005 obj . compileOption . toolchain = target . uAC6 === '1' ? 'AC6' : 'AC5' ;
10041006 this . getOption ( target . TargetOption , obj . compileOption , obj . env ) ;
0 commit comments