9ddd4f7 BaseTools: Update the rule to remove .lib before link it for GCC

Authored and Committed by Yonghong Zhu 5 years ago
    BaseTools: Update the rule to remove .lib before link it for GCC
    
    We met a case on GCC toolchain for increment build. the case is user
    build Helloworld first, then rename the source file Helloworld.c to
    Helloworld_new.c and also update the file name to Helloworld_new.c in
    .inf file's [sources] section. finally, he rebuild it again.
    It cause build failure due to multiple definition of `UefiMain' because
    in the .lib file it both have Helloworld.obj and Helloworld_new.obj.
    current we use the option 'cr' to create the .lib file while the 'r'
    cmd means replace existing or insert new files into the archive. so
    in this patch before we create the .lib file, we delete it first.
    
    Cc: Liming Gao <liming.gao@intel.com>
    Contributed-under: TianoCore Contribution Agreement 1.1
    Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
    Reviewed-by: Liming Gao <liming.gao@intel.com>