diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py index 92c7bf0cda..daec9c6d54 100755 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -120,7 +120,7 @@ class BuildFile(object): }, POSIX_PLATFORM : { - "CP" : "cp -f", + "CP" : "cp -p -f", "MV" : "mv -f", "RM" : "rm -f", "MD" : "mkdir -p", diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index a599c5bb76..e9f68384b4 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -2932,7 +2932,7 @@ class DscBuildData(PlatformBuildClassObject): MakeApp = MakeApp + PcdMakefileEnd MakeApp = MakeApp + AppTarget % ("""\tcopy $(APPLICATION) $(APPFILE) /y """) else: - MakeApp = MakeApp + AppTarget % ("""\tcp $(APPLICATION) $(APPFILE) """) + MakeApp = MakeApp + AppTarget % ("""\tcp -p $(APPLICATION) $(APPFILE) """) MakeApp = MakeApp + '\n' IncludeFileFullPaths = [] for includefile in IncludeFiles: @@ -2955,7 +2955,7 @@ class DscBuildData(PlatformBuildClassObject): else: PcdValueCommonPath = os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Common/PcdValueCommon.c")) MakeApp = MakeApp + '%s/PcdValueCommon.c : %s\n' % (self.OutputPath, PcdValueCommonPath) - MakeApp = MakeApp + '\tcp -f %s %s/PcdValueCommon.c\n' % (PcdValueCommonPath, self.OutputPath) + MakeApp = MakeApp + '\tcp -p -f %s %s/PcdValueCommon.c\n' % (PcdValueCommonPath, self.OutputPath) MakeFileName = os.path.join(self.OutputPath, 'Makefile') MakeApp += "$(OBJECTS) : %s\n" % MakeFileName SaveFileOnChange(MakeFileName, MakeApp, False)