public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 0/3] BaseTools: Update Makefiles with clear ARCH and dependency
@ 2017-11-28  3:18 Liming Gao
  2017-11-28  3:18 ` [PATCH v2 1/3] BaseTools: Replace ARCH with HOST_ARCH in C Makefile to avoid conflict Liming Gao
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Liming Gao @ 2017-11-28  3:18 UTC (permalink / raw)
  To: edk2-devel

https://bugzilla.tianocore.org/show_bug.cgi?id=793
https://bugzilla.tianocore.org/show_bug.cgi?id=786

In V2: 
  Update BaseTools top GNUmakefile with the clear dependency

Liming Gao (3):
  BaseTools: Replace ARCH with HOST_ARCH in C Makefile to avoid conflict
  BaseTools: Update BaseTools top GNUMakefile with the clear dependency
  BaseTools: Update C tools top GNUMakefile to adjust tool order

 BaseTools/GNUmakefile                           |  8 ++---
 BaseTools/Source/C/BootSectImage/GNUmakefile    |  2 +-
 BaseTools/Source/C/BrotliCompress/GNUmakefile   |  2 +-
 BaseTools/Source/C/Common/GNUmakefile           |  2 +-
 BaseTools/Source/C/EfiLdrImage/GNUmakefile      |  2 +-
 BaseTools/Source/C/EfiRom/GNUmakefile           |  2 +-
 BaseTools/Source/C/GNUmakefile                  | 45 ++++++++++++++-----------
 BaseTools/Source/C/GenCrc32/GNUmakefile         |  2 +-
 BaseTools/Source/C/GenFfs/GNUmakefile           |  2 +-
 BaseTools/Source/C/GenFv/GNUmakefile            |  2 +-
 BaseTools/Source/C/GenFw/GNUmakefile            |  2 +-
 BaseTools/Source/C/GenPage/GNUmakefile          |  2 +-
 BaseTools/Source/C/GenSec/GNUmakefile           |  2 +-
 BaseTools/Source/C/GenVtf/GNUmakefile           |  2 +-
 BaseTools/Source/C/GnuGenBootSector/GNUmakefile |  2 +-
 BaseTools/Source/C/LzmaCompress/GNUmakefile     |  2 +-
 BaseTools/Source/C/Makefile                     |  2 +-
 BaseTools/Source/C/Makefiles/footer.makefile    |  8 ++---
 BaseTools/Source/C/Makefiles/header.makefile    | 20 +++++------
 BaseTools/Source/C/Makefiles/ms.common          |  8 ++---
 BaseTools/Source/C/Split/GNUmakefile            |  2 +-
 BaseTools/Source/C/TianoCompress/GNUmakefile    |  2 +-
 BaseTools/Source/C/VfrCompile/GNUmakefile       |  2 +-
 BaseTools/Source/C/VolInfo/GNUmakefile          |  2 +-
 24 files changed, 66 insertions(+), 61 deletions(-)

-- 
2.8.0.windows.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/3] BaseTools: Replace ARCH with HOST_ARCH in C Makefile to avoid conflict
  2017-11-28  3:18 [PATCH v2 0/3] BaseTools: Update Makefiles with clear ARCH and dependency Liming Gao
@ 2017-11-28  3:18 ` Liming Gao
  2017-11-28  3:18 ` [PATCH v2 2/3] BaseTools: Update BaseTools top GNUMakefile with the clear dependency Liming Gao
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Liming Gao @ 2017-11-28  3:18 UTC (permalink / raw)
  To: edk2-devel

https://bugzilla.tianocore.org/show_bug.cgi?id=793

ARCH is too generic. It may cause confuse of target arch or host arch.
To be clarified, replace it with HOST_ARCH in BaseTools C Makefile.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
 BaseTools/Source/C/BootSectImage/GNUmakefile    |  2 +-
 BaseTools/Source/C/BrotliCompress/GNUmakefile   |  2 +-
 BaseTools/Source/C/Common/GNUmakefile           |  2 +-
 BaseTools/Source/C/EfiLdrImage/GNUmakefile      |  2 +-
 BaseTools/Source/C/EfiRom/GNUmakefile           |  2 +-
 BaseTools/Source/C/GNUmakefile                  | 28 ++++++++++++-------------
 BaseTools/Source/C/GenCrc32/GNUmakefile         |  2 +-
 BaseTools/Source/C/GenFfs/GNUmakefile           |  2 +-
 BaseTools/Source/C/GenFv/GNUmakefile            |  2 +-
 BaseTools/Source/C/GenFw/GNUmakefile            |  2 +-
 BaseTools/Source/C/GenPage/GNUmakefile          |  2 +-
 BaseTools/Source/C/GenSec/GNUmakefile           |  2 +-
 BaseTools/Source/C/GenVtf/GNUmakefile           |  2 +-
 BaseTools/Source/C/GnuGenBootSector/GNUmakefile |  2 +-
 BaseTools/Source/C/LzmaCompress/GNUmakefile     |  2 +-
 BaseTools/Source/C/Makefile                     |  2 +-
 BaseTools/Source/C/Makefiles/footer.makefile    |  8 +++----
 BaseTools/Source/C/Makefiles/header.makefile    | 20 +++++++++---------
 BaseTools/Source/C/Makefiles/ms.common          |  8 +++----
 BaseTools/Source/C/Split/GNUmakefile            |  2 +-
 BaseTools/Source/C/TianoCompress/GNUmakefile    |  2 +-
 BaseTools/Source/C/VfrCompile/GNUmakefile       |  2 +-
 BaseTools/Source/C/VolInfo/GNUmakefile          |  2 +-
 23 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/BaseTools/Source/C/BootSectImage/GNUmakefile b/BaseTools/Source/C/BootSectImage/GNUmakefile
index 5f7cb98..90800a4 100644
--- a/BaseTools/Source/C/BootSectImage/GNUmakefile
+++ b/BaseTools/Source/C/BootSectImage/GNUmakefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 APPNAME = BootSectImage
diff --git a/BaseTools/Source/C/BrotliCompress/GNUmakefile b/BaseTools/Source/C/BrotliCompress/GNUmakefile
index 368edbd..3426a00 100644
--- a/BaseTools/Source/C/BrotliCompress/GNUmakefile
+++ b/BaseTools/Source/C/BrotliCompress/GNUmakefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 APPNAME = Brotli
diff --git a/BaseTools/Source/C/Common/GNUmakefile b/BaseTools/Source/C/Common/GNUmakefile
index a193557..5cbca9a 100644
--- a/BaseTools/Source/C/Common/GNUmakefile
+++ b/BaseTools/Source/C/Common/GNUmakefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 # VPATH = ..
diff --git a/BaseTools/Source/C/EfiLdrImage/GNUmakefile b/BaseTools/Source/C/EfiLdrImage/GNUmakefile
index 99f786f..75c04ea 100644
--- a/BaseTools/Source/C/EfiLdrImage/GNUmakefile
+++ b/BaseTools/Source/C/EfiLdrImage/GNUmakefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 APPNAME = EfiLdrImage
diff --git a/BaseTools/Source/C/EfiRom/GNUmakefile b/BaseTools/Source/C/EfiRom/GNUmakefile
index 433c126..a13111c 100644
--- a/BaseTools/Source/C/EfiRom/GNUmakefile
+++ b/BaseTools/Source/C/EfiRom/GNUmakefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 APPNAME = EfiRom
diff --git a/BaseTools/Source/C/GNUmakefile b/BaseTools/Source/C/GNUmakefile
index 83e188c..53ddb67 100644
--- a/BaseTools/Source/C/GNUmakefile
+++ b/BaseTools/Source/C/GNUmakefile
@@ -12,40 +12,40 @@
 #  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
 
-ifndef ARCH
+ifndef HOST_ARCH
   #
-  # If ARCH is not defined, then we use 'uname -m' to attempt
-  # try to figure out the appropriate ARCH.
+  # If HOST_ARCH is not defined, then we use 'uname -m' to attempt
+  # try to figure out the appropriate HOST_ARCH.
   #
   uname_m = $(shell uname -m)
-  $(info Attempting to detect ARCH from 'uname -m': $(uname_m))
+  $(info Attempting to detect HOST_ARCH from 'uname -m': $(uname_m))
   ifneq (,$(strip $(filter $(uname_m), x86_64 amd64)))
-    ARCH=X64
+    HOST_ARCH=X64
   endif
   ifeq ($(patsubst i%86,IA32,$(uname_m)),IA32)
-    ARCH=IA32
+    HOST_ARCH=IA32
   endif
   ifneq (,$(findstring aarch64,$(uname_m)))
-    ARCH=AARCH64
+    HOST_ARCH=AARCH64
   endif
   ifneq (,$(findstring arm,$(uname_m)))
-    ARCH=ARM
+    HOST_ARCH=ARM
   endif
-  ifndef ARCH
-    $(info Could not detected ARCH from uname results)
-    $(error ARCH is not defined!)
+  ifndef HOST_ARCH
+    $(info Could not detected HOST_ARCH from uname results)
+    $(error HOST_ARCH is not defined!)
   endif
-  $(info Detected ARCH of $(ARCH) using uname.)
+  $(info Detected HOST_ARCH of $(HOST_ARCH) using uname.)
 endif
 
-export ARCH
+export HOST_ARCH
 
 MAKEROOT = .
 
 include Makefiles/header.makefile
 
 all: makerootdir subdirs $(MAKEROOT)/libs
-	@echo Finished building BaseTools C Tools with ARCH=$(ARCH)
+	@echo Finished building BaseTools C Tools with HOST_ARCH=$(HOST_ARCH)
 
 LIBRARIES = Common
 # NON_BUILDABLE_APPLICATIONS = GenBootSector BootSectImage
diff --git a/BaseTools/Source/C/GenCrc32/GNUmakefile b/BaseTools/Source/C/GenCrc32/GNUmakefile
index 15b4dad..a3b4aa8 100644
--- a/BaseTools/Source/C/GenCrc32/GNUmakefile
+++ b/BaseTools/Source/C/GenCrc32/GNUmakefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 APPNAME = GenCrc32
diff --git a/BaseTools/Source/C/GenFfs/GNUmakefile b/BaseTools/Source/C/GenFfs/GNUmakefile
index 04f5bb8..af0a27c 100644
--- a/BaseTools/Source/C/GenFfs/GNUmakefile
+++ b/BaseTools/Source/C/GenFfs/GNUmakefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 APPNAME = GenFfs
diff --git a/BaseTools/Source/C/GenFv/GNUmakefile b/BaseTools/Source/C/GenFv/GNUmakefile
index 58ad16c..008ceb7 100644
--- a/BaseTools/Source/C/GenFv/GNUmakefile
+++ b/BaseTools/Source/C/GenFv/GNUmakefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 APPNAME = GenFv
diff --git a/BaseTools/Source/C/GenFw/GNUmakefile b/BaseTools/Source/C/GenFw/GNUmakefile
index ec5b872..89b2aa6 100644
--- a/BaseTools/Source/C/GenFw/GNUmakefile
+++ b/BaseTools/Source/C/GenFw/GNUmakefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 APPNAME = GenFw
diff --git a/BaseTools/Source/C/GenPage/GNUmakefile b/BaseTools/Source/C/GenPage/GNUmakefile
index e1eab87..9b5a4d3 100644
--- a/BaseTools/Source/C/GenPage/GNUmakefile
+++ b/BaseTools/Source/C/GenPage/GNUmakefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 APPNAME = GenPage
diff --git a/BaseTools/Source/C/GenSec/GNUmakefile b/BaseTools/Source/C/GenSec/GNUmakefile
index c2d289c..6c8fd44 100644
--- a/BaseTools/Source/C/GenSec/GNUmakefile
+++ b/BaseTools/Source/C/GenSec/GNUmakefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 APPNAME = GenSec
diff --git a/BaseTools/Source/C/GenVtf/GNUmakefile b/BaseTools/Source/C/GenVtf/GNUmakefile
index ff6599f..4eb4cc7 100644
--- a/BaseTools/Source/C/GenVtf/GNUmakefile
+++ b/BaseTools/Source/C/GenVtf/GNUmakefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 APPNAME = GenVtf
diff --git a/BaseTools/Source/C/GnuGenBootSector/GNUmakefile b/BaseTools/Source/C/GnuGenBootSector/GNUmakefile
index e9d32f8..350014a 100644
--- a/BaseTools/Source/C/GnuGenBootSector/GNUmakefile
+++ b/BaseTools/Source/C/GnuGenBootSector/GNUmakefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 APPNAME = GnuGenBootSector
diff --git a/BaseTools/Source/C/LzmaCompress/GNUmakefile b/BaseTools/Source/C/LzmaCompress/GNUmakefile
index 63d7ee0..390a97f 100644
--- a/BaseTools/Source/C/LzmaCompress/GNUmakefile
+++ b/BaseTools/Source/C/LzmaCompress/GNUmakefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 APPNAME = LzmaCompress
diff --git a/BaseTools/Source/C/Makefile b/BaseTools/Source/C/Makefile
index 77d3b97..50be773 100644
--- a/BaseTools/Source/C/Makefile
+++ b/BaseTools/Source/C/Makefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH = IA32
+HOST_ARCH = IA32
 
 !INCLUDE Makefiles\ms.common
 
diff --git a/BaseTools/Source/C/Makefiles/footer.makefile b/BaseTools/Source/C/Makefiles/footer.makefile
index 390873b..0926aa9 100644
--- a/BaseTools/Source/C/Makefiles/footer.makefile
+++ b/BaseTools/Source/C/Makefiles/footer.makefile
@@ -13,12 +13,12 @@
 
 DEPFILES = $(OBJECTS:%.o=%.d)
 
-$(MAKEROOT)/libs-$(ARCH):
-	mkdir -p $(MAKEROOT)/libs-$(ARCH)
+$(MAKEROOT)/libs-$(HOST_ARCH):
+	mkdir -p $(MAKEROOT)/libs-$(HOST_ARCH)
 
 .PHONY: install
-install: $(MAKEROOT)/libs-$(ARCH) $(LIBRARY)
-	cp $(LIBRARY) $(MAKEROOT)/libs-$(ARCH)
+install: $(MAKEROOT)/libs-$(HOST_ARCH) $(LIBRARY)
+	cp $(LIBRARY) $(MAKEROOT)/libs-$(HOST_ARCH)
 
 $(LIBRARY): $(OBJECTS) 
 	$(BUILD_AR) crs $@ $^
diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile
index 063982b..27aa28b 100644
--- a/BaseTools/Source/C/Makefiles/header.makefile
+++ b/BaseTools/Source/C/Makefiles/header.makefile
@@ -1,10 +1,10 @@
 ## @file
 #
 # The makefile can be invoked with
-# ARCH = x86_64 or x64 for EM64T build
-# ARCH = ia32 or IA32 for IA32 build
-# ARCH = ia64 or IA64 for IA64 build
-# ARCH = Arm or ARM for ARM build
+# HOST_ARCH = x86_64 or x64 for EM64T build
+# HOST_ARCH = ia32 or IA32 for IA32 build
+# HOST_ARCH = ia64 or IA64 for IA64 build
+# HOST_ARCH = Arm or ARM for ARM build
 #
 # Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
 # This program and the accompanying materials
@@ -15,7 +15,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 
 CYGWIN:=$(findstring CYGWIN, $(shell uname -s))
 LINUX:=$(findstring Linux, $(shell uname -s))
@@ -27,19 +27,19 @@ BUILD_AS ?= gcc
 BUILD_AR ?= ar
 BUILD_LD ?= ld
 LINKER ?= $(BUILD_CC)
-ifeq ($(ARCH), IA32)
+ifeq ($(HOST_ARCH), IA32)
 ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/
 endif
 
-ifeq ($(ARCH), X64)
+ifeq ($(HOST_ARCH), X64)
 ARCH_INCLUDE = -I $(MAKEROOT)/Include/X64/
 endif
 
-ifeq ($(ARCH), ARM)
+ifeq ($(HOST_ARCH), ARM)
 ARCH_INCLUDE = -I $(MAKEROOT)/Include/Arm/
 endif
 
-ifeq ($(ARCH), AARCH64)
+ifeq ($(HOST_ARCH), AARCH64)
 ARCH_INCLUDE = -I $(MAKEROOT)/Include/AArch64/
 endif
 
@@ -54,7 +54,7 @@ endif
 BUILD_LFLAGS =
 BUILD_CXXFLAGS = -Wno-unused-result
 
-ifeq ($(ARCH), IA32)
+ifeq ($(HOST_ARCH), IA32)
 #
 # Snow Leopard  is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults 
 #  to x86_64. So make sure tools match uname -m. You can manual have a 64-bit kernal on Snow Leopard
diff --git a/BaseTools/Source/C/Makefiles/ms.common b/BaseTools/Source/C/Makefiles/ms.common
index 69735e6..a6bfea5 100644
--- a/BaseTools/Source/C/Makefiles/ms.common
+++ b/BaseTools/Source/C/Makefiles/ms.common
@@ -19,8 +19,8 @@
 !ERROR "BASE_TOOLS_PATH is not set! Please run build_tools.bat at first!"
 !ENDIF
 
-!IFNDEF ARCH
-ARCH = IA32
+!IFNDEF HOST_ARCH
+HOST_ARCH = IA32
 !ENDIF
 
 MAKE        = nmake -nologo
@@ -36,7 +36,7 @@ LIB_PATH    = $(BASE_TOOLS_PATH)\Lib
 SYS_BIN_PATH=$(EDK_TOOLS_PATH)\Bin
 SYS_LIB_PATH=$(EDK_TOOLS_PATH)\Lib
 
-!IF "$(ARCH)"=="IA32"
+!IF "$(HOST_ARCH)"=="IA32"
 ARCH_INCLUDE = $(SOURCE_PATH)\Include\Ia32
 BIN_PATH     = $(BASE_TOOLS_PATH)\Bin\Win32
 LIB_PATH     = $(BASE_TOOLS_PATH)\Lib\Win32
@@ -44,7 +44,7 @@ SYS_BIN_PATH = $(EDK_TOOLS_PATH)\Bin\Win32
 SYS_LIB_PATH = $(EDK_TOOLS_PATH)\Lib\Win32
 !ENDIF
 
-!IF "$(ARCH)"=="X64"
+!IF "$(HOST_ARCH)"=="X64"
 ARCH_INCLUDE = $(SOURCE_PATH)\Include\X64
 BIN_PATH     = $(BASE_TOOLS_PATH)\Bin\Win64
 LIB_PATH     = $(BASE_TOOLS_PATH)\Lib\Win64
diff --git a/BaseTools/Source/C/Split/GNUmakefile b/BaseTools/Source/C/Split/GNUmakefile
index e38a01f..a42fe1a 100644
--- a/BaseTools/Source/C/Split/GNUmakefile
+++ b/BaseTools/Source/C/Split/GNUmakefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 APPNAME = Split
diff --git a/BaseTools/Source/C/TianoCompress/GNUmakefile b/BaseTools/Source/C/TianoCompress/GNUmakefile
index e4f3a69..403b363 100644
--- a/BaseTools/Source/C/TianoCompress/GNUmakefile
+++ b/BaseTools/Source/C/TianoCompress/GNUmakefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 APPNAME = TianoCompress
diff --git a/BaseTools/Source/C/VfrCompile/GNUmakefile b/BaseTools/Source/C/VfrCompile/GNUmakefile
index 2ebf3e0..b9f8f8c 100644
--- a/BaseTools/Source/C/VfrCompile/GNUmakefile
+++ b/BaseTools/Source/C/VfrCompile/GNUmakefile
@@ -11,7 +11,7 @@
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
 
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 APPNAME = VfrCompile
diff --git a/BaseTools/Source/C/VolInfo/GNUmakefile b/BaseTools/Source/C/VolInfo/GNUmakefile
index d5f115a..86929c5 100644
--- a/BaseTools/Source/C/VolInfo/GNUmakefile
+++ b/BaseTools/Source/C/VolInfo/GNUmakefile
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-ARCH ?= IA32
+HOST_ARCH ?= IA32
 MAKEROOT ?= ..
 
 APPNAME = VolInfo
-- 
2.8.0.windows.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/3] BaseTools: Update BaseTools top GNUMakefile with the clear dependency
  2017-11-28  3:18 [PATCH v2 0/3] BaseTools: Update Makefiles with clear ARCH and dependency Liming Gao
  2017-11-28  3:18 ` [PATCH v2 1/3] BaseTools: Replace ARCH with HOST_ARCH in C Makefile to avoid conflict Liming Gao
@ 2017-11-28  3:18 ` Liming Gao
  2017-11-28  3:18 ` [PATCH v2 3/3] BaseTools: Update C tools top GNUMakefile to adjust tool order Liming Gao
  2017-11-30  4:31 ` [PATCH v2 0/3] BaseTools: Update Makefiles with clear ARCH and dependency Zhu, Yonghong
  3 siblings, 0 replies; 5+ messages in thread
From: Liming Gao @ 2017-11-28  3:18 UTC (permalink / raw)
  To: edk2-devel

https://bugzilla.tianocore.org/show_bug.cgi?id=786

After GNUmakefile dependency is fixed up, it can make with -j N to enable
multiple thread build in base tools C source and save build time.

In my linux host machine, make -j 4 to compile BaseTools and save ~60% time.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
 BaseTools/GNUmakefile          |  8 +++-----
 BaseTools/Source/C/GNUmakefile | 11 +++++++++--
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/BaseTools/GNUmakefile b/BaseTools/GNUmakefile
index 790d33a..6325e40 100644
--- a/BaseTools/GNUmakefile
+++ b/BaseTools/GNUmakefile
@@ -1,7 +1,7 @@
 ## @file
 # GNU/Linux makefile for Base Tools project build.
 #
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
 # This program and the accompanying materials
 # are licensed and made available under the terms and conditions of the BSD License
 # which accompanies this distribution.  The full text of the license may be found at
@@ -24,12 +24,10 @@ subdirs: $(SUBDIRS)
 $(SUBDIRS):
 	$(MAKE) -C $@
 
+Tests: $(SOURCE_SUBDIRS)
+
 .PHONY: $(CLEAN_SUBDIRS)
 $(CLEAN_SUBDIRS):
 	-$(MAKE) -C $(@:-clean=) clean
 
 clean:  $(CLEAN_SUBDIRS)
-
-test:
-	@$(MAKE) -C Tests
-
diff --git a/BaseTools/Source/C/GNUmakefile b/BaseTools/Source/C/GNUmakefile
index 53ddb67..50b6759 100644
--- a/BaseTools/Source/C/GNUmakefile
+++ b/BaseTools/Source/C/GNUmakefile
@@ -1,7 +1,7 @@
 ## @file
 #  GNU/Linux makefile for C tools build.
 #
-#  Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -44,10 +44,11 @@ MAKEROOT = .
 
 include Makefiles/header.makefile
 
-all: makerootdir subdirs $(MAKEROOT)/libs
+all: makerootdir subdirs
 	@echo Finished building BaseTools C Tools with HOST_ARCH=$(HOST_ARCH)
 
 LIBRARIES = Common
+VFRAUTOGEN = VfrCompile/VfrLexer.h
 # NON_BUILDABLE_APPLICATIONS = GenBootSector BootSectImage
 APPLICATIONS = \
   GnuGenBootSector \
@@ -70,6 +71,9 @@ APPLICATIONS = \
 
 SUBDIRS := $(LIBRARIES) $(APPLICATIONS)
 
+$(LIBRARIES): $(MAKEROOT)/libs
+$(APPLICATIONS): $(LIBRARIES) $(MAKEROOT)/bin $(VFRAUTOGEN)
+
 .PHONY: outputdirs
 makerootdir:
 	-mkdir -p $(MAKEROOT)
@@ -83,6 +87,9 @@ $(SUBDIRS):
 $(patsubst %,%-clean,$(sort $(SUBDIRS))):
 	-$(MAKE) -C $(@:-clean=) clean
 
+$(VFRAUTOGEN): VfrCompile/VfrSyntax.g 
+	$(MAKE) -C VfrCompile VfrLexer.h
+
 clean:  $(patsubst %,%-clean,$(sort $(SUBDIRS)))
 
 clean: localClean
-- 
2.8.0.windows.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 3/3] BaseTools: Update C tools top GNUMakefile to adjust tool order
  2017-11-28  3:18 [PATCH v2 0/3] BaseTools: Update Makefiles with clear ARCH and dependency Liming Gao
  2017-11-28  3:18 ` [PATCH v2 1/3] BaseTools: Replace ARCH with HOST_ARCH in C Makefile to avoid conflict Liming Gao
  2017-11-28  3:18 ` [PATCH v2 2/3] BaseTools: Update BaseTools top GNUMakefile with the clear dependency Liming Gao
@ 2017-11-28  3:18 ` Liming Gao
  2017-11-30  4:31 ` [PATCH v2 0/3] BaseTools: Update Makefiles with clear ARCH and dependency Zhu, Yonghong
  3 siblings, 0 replies; 5+ messages in thread
From: Liming Gao @ 2017-11-28  3:18 UTC (permalink / raw)
  To: edk2-devel

Place the tool that takes much build time at the first. This can improve
build performance when make -j N used.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
 BaseTools/Source/C/GNUmakefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/BaseTools/Source/C/GNUmakefile b/BaseTools/Source/C/GNUmakefile
index 50b6759..0dc7482 100644
--- a/BaseTools/Source/C/GNUmakefile
+++ b/BaseTools/Source/C/GNUmakefile
@@ -51,9 +51,10 @@ LIBRARIES = Common
 VFRAUTOGEN = VfrCompile/VfrLexer.h
 # NON_BUILDABLE_APPLICATIONS = GenBootSector BootSectImage
 APPLICATIONS = \
+  BrotliCompress \
+  VfrCompile \
   GnuGenBootSector \
   BootSectImage \
-  BrotliCompress \
   EfiLdrImage \
   EfiRom \
   GenFfs \
@@ -66,8 +67,7 @@ APPLICATIONS = \
   LzmaCompress \
   Split \
   TianoCompress \
-  VolInfo \
-  VfrCompile
+  VolInfo
 
 SUBDIRS := $(LIBRARIES) $(APPLICATIONS)
 
-- 
2.8.0.windows.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 0/3] BaseTools: Update Makefiles with clear ARCH and dependency
  2017-11-28  3:18 [PATCH v2 0/3] BaseTools: Update Makefiles with clear ARCH and dependency Liming Gao
                   ` (2 preceding siblings ...)
  2017-11-28  3:18 ` [PATCH v2 3/3] BaseTools: Update C tools top GNUMakefile to adjust tool order Liming Gao
@ 2017-11-30  4:31 ` Zhu, Yonghong
  3 siblings, 0 replies; 5+ messages in thread
From: Zhu, Yonghong @ 2017-11-30  4:31 UTC (permalink / raw)
  To: Gao, Liming, edk2-devel@lists.01.org

Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> 

Best Regards,
Zhu Yonghong

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Liming Gao
Sent: Tuesday, November 28, 2017 11:19 AM
To: edk2-devel@lists.01.org
Subject: [edk2] [PATCH v2 0/3] BaseTools: Update Makefiles with clear ARCH and dependency

https://bugzilla.tianocore.org/show_bug.cgi?id=793
https://bugzilla.tianocore.org/show_bug.cgi?id=786

In V2: 
  Update BaseTools top GNUmakefile with the clear dependency

Liming Gao (3):
  BaseTools: Replace ARCH with HOST_ARCH in C Makefile to avoid conflict
  BaseTools: Update BaseTools top GNUMakefile with the clear dependency
  BaseTools: Update C tools top GNUMakefile to adjust tool order

 BaseTools/GNUmakefile                           |  8 ++---
 BaseTools/Source/C/BootSectImage/GNUmakefile    |  2 +-
 BaseTools/Source/C/BrotliCompress/GNUmakefile   |  2 +-
 BaseTools/Source/C/Common/GNUmakefile           |  2 +-
 BaseTools/Source/C/EfiLdrImage/GNUmakefile      |  2 +-
 BaseTools/Source/C/EfiRom/GNUmakefile           |  2 +-
 BaseTools/Source/C/GNUmakefile                  | 45 ++++++++++++++-----------
 BaseTools/Source/C/GenCrc32/GNUmakefile         |  2 +-
 BaseTools/Source/C/GenFfs/GNUmakefile           |  2 +-
 BaseTools/Source/C/GenFv/GNUmakefile            |  2 +-
 BaseTools/Source/C/GenFw/GNUmakefile            |  2 +-
 BaseTools/Source/C/GenPage/GNUmakefile          |  2 +-
 BaseTools/Source/C/GenSec/GNUmakefile           |  2 +-
 BaseTools/Source/C/GenVtf/GNUmakefile           |  2 +-
 BaseTools/Source/C/GnuGenBootSector/GNUmakefile |  2 +-
 BaseTools/Source/C/LzmaCompress/GNUmakefile     |  2 +-
 BaseTools/Source/C/Makefile                     |  2 +-
 BaseTools/Source/C/Makefiles/footer.makefile    |  8 ++---
 BaseTools/Source/C/Makefiles/header.makefile    | 20 +++++------
 BaseTools/Source/C/Makefiles/ms.common          |  8 ++---
 BaseTools/Source/C/Split/GNUmakefile            |  2 +-
 BaseTools/Source/C/TianoCompress/GNUmakefile    |  2 +-
 BaseTools/Source/C/VfrCompile/GNUmakefile       |  2 +-
 BaseTools/Source/C/VolInfo/GNUmakefile          |  2 +-
 24 files changed, 66 insertions(+), 61 deletions(-)

-- 
2.8.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-30  4:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-28  3:18 [PATCH v2 0/3] BaseTools: Update Makefiles with clear ARCH and dependency Liming Gao
2017-11-28  3:18 ` [PATCH v2 1/3] BaseTools: Replace ARCH with HOST_ARCH in C Makefile to avoid conflict Liming Gao
2017-11-28  3:18 ` [PATCH v2 2/3] BaseTools: Update BaseTools top GNUMakefile with the clear dependency Liming Gao
2017-11-28  3:18 ` [PATCH v2 3/3] BaseTools: Update C tools top GNUMakefile to adjust tool order Liming Gao
2017-11-30  4:31 ` [PATCH v2 0/3] BaseTools: Update Makefiles with clear ARCH and dependency Zhu, Yonghong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox