@@ -743,6 +743,8 @@ class ARMParser extends KeilParser<KeilARMOption> {
743743
744744 // keil props
745745 const mdk_OutputDirectory : string = File . normalize ( commonOption . OutputDirectory || '.' ) ;
746+ const mdk_CreateHexFile : boolean = commonOption . CreateHexFile == '1' ;
747+ const mdk_CreateLib : boolean = commonOption . CreateLib == '1' ;
746748
747749 // BeforeMake
748750 const beforeMake = commonOption . BeforeMake ;
@@ -784,23 +786,27 @@ class ARMParser extends KeilParser<KeilARMOption> {
784786 if ( env [ 'KEIL_OUTPUT_NAME' ] ) {
785787 eideOption . afterBuildTasks . splice ( 0 , 0 , {
786788 "name" : '[Copy linker output for Keil User Commands]' ,
787- "command" : `$<cd:mdk-proj-dir> && copy "\${OutDir}\\\${ProjectName}.axf" "${ mdk_OutputDirectory } \\\${KEIL_OUTPUT_NAME}.axf"` ,
789+ "command" : `$<cd:mdk-proj-dir> && mkdir ${ mdk_OutputDirectory } & copy "\${OutDir}\\\${ProjectName}.axf" "${ mdk_OutputDirectory } \\\${KEIL_OUTPUT_NAME}.axf"` ,
788790 "disable" : actived_cnt == 0 ,
789791 "abortAfterFailed" : true
790792 } ) ;
791793 } else {
792794 eideOption . afterBuildTasks . splice ( 0 , 0 , {
793795 "name" : '[Copy linker output for Keil User Commands]' ,
794- "command" : `$<cd:mdk-proj-dir> && copy "\${OutDir}\\\${ProjectName}.axf" "${ mdk_OutputDirectory } \\\${ProjectName}.axf"` ,
796+ "command" : `$<cd:mdk-proj-dir> && mkdir ${ mdk_OutputDirectory } & copy "\${OutDir}\\\${ProjectName}.axf" "${ mdk_OutputDirectory } \\\${ProjectName}.axf"` ,
795797 "disable" : actived_cnt == 0 ,
796798 "abortAfterFailed" : true
797799 } ) ;
798800 }
799801 }
800- if ( actived_cnt > 0 ) {
802+ if ( mdk_CreateLib ) {
803+ // Make eide output lib instead of elf
804+ if ( eideOption . linker == undefined ) eideOption . linker = { } ;
805+ eideOption . linker [ 'output-format' ] = 'lib' ;
806+ }
807+ if ( ! mdk_CreateHexFile ) {
801808 // Make eide Don't output hex/bin
802- if ( eideOption . linker == undefined )
803- eideOption . linker = { } ;
809+ if ( eideOption . linker == undefined ) eideOption . linker = { } ;
804810 eideOption . linker [ '$disableOutputTask' ] = true ;
805811 }
806812 }
0 commit comments