public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "PierreGondois" <pierre.gondois@arm.com>
To: devel@edk2.groups.io
Cc: Pierre Gondois <Pierre.Gondois@arm.com>,
	bob.c.feng@intel.com, liming.gao@intel.com, Sami.Mujawar@arm.com,
	pierre.gondois@arm.com, nd@arm.com
Subject: [PATCH v4 2/2] BaseTools: Remove caret in NASM_INC macro
Date: Mon, 10 Feb 2020 10:49:08 +0000	[thread overview]
Message-ID: <20200210104908.116064-3-pierre.gondois@arm.com> (raw)
In-Reply-To: <20200210104908.116064-1-pierre.gondois@arm.com>

From: Pierre Gondois <pierre.gondois@arm.com>

NASM_INC contains the list of directory to include when using
the nasm assembler.

In nmake makefiles, a trailing backslash escapes the newline char
and replaces it with a space ' '. To have a literal trailing
backslash, it must be escaped with a caret '^'. This is not
necessary for GNU makefiles.

On windows platforms, for the NASM_INC macro, a caret escaping
a trailing a backslash was appended to the last included
folder regardless of the makefile type.
For instance, "/Include/" was replaced by "/Include/^\".

This is causing a build failure on windows platforms using
GNU makefiles since the caret '^' doesn't escape any chars in
GNU makefiles and is thus conserved.
"/Include^\" was replaced by "/Include\/" in nmake makefiles,
but remained "/Include/^\" in GNU makefiles.

This patch removes the caret '^' on the build using GNU makefiles.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---

The changes can be seen at https://github.com/PierreARM/edk2/tree/720_BaseTools_Rationalise_makefile_generation_v4

 BaseTools/Source/Python/AutoGen/GenMake.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
index f5d15c40ad3196e5ea56f375bec12c38d313c9ee..bbb3c29446f53fa7f2cb61a216a5b119f72c3fbc 100755
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -612,9 +612,10 @@ cleanlib:
                 IncludePath = self._INC_FLAG_['NASM'] + self.PlaceMacro(P, self.Macros)
                 if IncludePath.endswith(os.sep):
                     IncludePath = IncludePath.rstrip(os.sep)
-                # When compiling .nasm files, need to add a literal backslash at each path
-                # To specify a literal backslash at the end of the line, precede it with a caret (^)
-                if P == MyAgo.IncludePathList[-1] and os.sep == '\\':
+                # When compiling .nasm files, need to add a literal backslash at each path.
+                # In nmake makfiles, a trailing literal backslash must be escaped with a caret ('^').
+                # It is otherwise replaced with a space (' '). This is not necessary for GNU makfefiles.
+                if P == MyAgo.IncludePathList[-1] and self._Platform == WIN32_PLATFORM and self._FileType == NMAKE_FILETYPE:
                     IncludePath = ''.join([IncludePath, '^', os.sep])
                 else:
                     IncludePath = os.path.join(IncludePath, '')
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


  parent reply	other threads:[~2020-02-10 10:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10 10:49 [PATCH v4 0/2] BaseTools: Rationalise makefile generation PierreGondois
2020-02-10 10:49 ` [PATCH v4 1/2] " PierreGondois
2020-02-10 10:49 ` PierreGondois [this message]
2020-02-12  2:07 ` [edk2-devel] [PATCH v4 0/2] " Bob Feng
     [not found] ` <15F285876DA55E24.22872@groups.io>
2020-02-12  2:37   ` Bob Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200210104908.116064-3-pierre.gondois@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox