On Mar 8, 2013, at 1:07 AM, "Gao, Liming" <[email protected]> wrote:

> Andrew:
>   Yes. This method can create the same size image. For your proposal, when 
> compiler source file, its related file path will be used, right? If yes, its 
> command must run at $WORKSAPCE directory?
>  

Liming yes, you are correct. I updated the [C-Code-File] rule build_rule.txt 
file to build from the WORKSPACE directory when I changed from ${src} to 
${relsrc}

    <Command.XCODE>
        cd $(WORKSPACE); "$(CC)" $(INC) $(CC_FLAGS) -o ${dst} ${relsrc}

The way GNU make works this cd is only for the subprocess that executes the 
$(CC) command and it is not global. 

Thanks,

Andrew Fish

> Thanks
> Liming
> From: Andrew Fish [mailto:[email protected]] 
> Sent: Friday, March 08, 2013 2:41 AM
> To: [email protected]
> Subject: [edk2-buildtools] Request to add $(relsrc) support to 
> build_rule.template
>  
> We would like to have the option of the ASSERT() messages being $WORKSPACE 
> relative. This makes them not only small, but also a standard size.  It 
> removes the need to map a drive (on Windows) or make symlinks (Unix) to try 
> and control the length of the ASSERT messages.  I could not think of a way to 
> make this work so I ended up adding $(relsrc) support to the 
> build_rule.template file.
>  
> I had to make the following change to add this feature. I'm thinking there 
> may be an easier way to access $(WORKSPACE), but I was not sure how to do 
> this?
>  
> --- Source/Python/AutoGen/BuildEngine.py       (revision 14013)
> +++ Source/Python/AutoGen/BuildEngine.py    (working copy)
> @@ -232,6 +232,7 @@
>              SrcPath = ""
>              # SourceFile must be a list
>              SrcFile = "$(%s)" % self.FileListMacro
> +            ScrFileRel = SrcFile
>          else:
>              SrcFileName, SrcFileBase, SrcFileExt = SourceFile.Name, 
> SourceFile.BaseName, SourceFile.Ext
>              if SourceFile.Root:
> @@ -242,6 +243,7 @@
>                  SrcFileDir = "."
>              SrcFile = SourceFile.Path
>              SrcPath = SourceFile.Dir
> +            ScrFileRel = os.path.relpath (SrcFile, os.getenv('WORKSPACE'))
>  
>          # destination file (the first one)
>          if self.DestFileList:
> @@ -264,6 +266,7 @@
>              "s_name"    :   SrcFileName,
>              "s_base"    :   SrcFileBase,
>              "s_ext"     :   SrcFileExt,
> +            "relsrc"    :   ScrFileRel,
>              # destination file
>              "dst"       :   DestFile,
>              "d_path"    :   DestPath,
>  
> If there is interest in making this change I can create a patch. If there is 
> a better way to do this please let me know.
>  
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Olivier Martin <[email protected]>
>  
> Andrew Fish
>  
>  

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
edk2-buildtools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-buildtools-devel

Reply via email to