]> code.delx.au - refind/commitdiff
Improved TianoCore build procedure; can now build both x86-64 and x86
authorsrs5694 <srs5694@users.sourceforge.net>
Thu, 8 Nov 2012 18:00:31 +0000 (13:00 -0500)
committersrs5694 <srs5694@users.sourceforge.net>
Thu, 8 Nov 2012 18:00:31 +0000 (13:00 -0500)
binaries on one computer.

BUILDING.txt
Make.tiano
filesystems/Make.tiano
refind.inf
refind/Make.tiano

index dba98a5eb5d5f9db8bad89ed3dcf5e4144c94bb4..f41a6665942910673e6526dada3f59d745cebfac 100644 (file)
@@ -156,9 +156,10 @@ installed the toolkit:
    drivers) must be typed in the shell you use for this step.
 
 9) Edit Conf/target.txt and change the following:
-   - ACTIVE_PLATFORM = MdeModulePkg/MdeModulePkg.dsc
+   - ACTIVE_PLATFORM = MdePkg/MdePkg.dsc
    - TARGET = RELEASE (DEBUG might work, but I've not tested it).
-   - TARGET_ARCH = X64 (on x86-64; leave this as IA32 on x86)
+   - TARGET_ARCH = X64 (on x86-64; leave this as IA32 on x86). If you plan
+     to build both architectures, you can set this to "IA32 X64".
    - TOOL_CHAIN_TAG = GCC46 (or other value depending on your GCC version;
      type "gcc -v" to learn your GCC version number). Note that GCC 4.7
      doesn't have its own entry, so use GCC46 for GCC 4.7.
@@ -207,7 +208,11 @@ With your development system set up, you can compile rEFInd as follows:
 4) Type "make gnuefi" to build with GNU-EFI, or either "make" alone or
    "make tiano" to build with TianoCore EDK2. With any luck, rEFInd will
    compile without error, leaving the "refind_ia32.efi" or "refind_x64.efi"
-   file, depending on your platform, in the "refind" subdirectory.
+   file, depending on your platform, in the "refind" subdirectory. If you
+   want to build IA32 binaries on an x86-64 (X64) system, type "ARCH=ia32
+   make". This works only if you're using the TianoCore build kit, and only
+   if you set TARGET_ARCH to either "IA32" or "IA32 X64" in target.txt when
+   you set up the TianoCore.
 
 5) The default build process does NOT build the filesystem drivers. If you
    want to build them, you must type "make fs" in the main rEFInd source
index 4b4ee920585f5777a1b8e2fcf64748ceec504e0c..04a3eb7b89a0fbf071034eaa582fd4b4f0588f4c 100644 (file)
@@ -4,7 +4,7 @@
 #
 
 HOSTARCH        = $(shell uname -m | sed s,i[3456789]86,ia32,)
-ARCH            := $(HOSTARCH)
+ARCH            ?= $(HOSTARCH)
 
 # Note: IA64 options are untested; taken from Debian's rEFIt package.
 ifeq ($(ARCH),ia64)
@@ -16,13 +16,17 @@ endif
 ifeq ($(ARCH),ia32)
   ARCH_C_FLAGS = -m32 -DEFI32 -malign-double
   ARCHDIR = Ia32
+  UC_ARCH = IA32
   FILENAME_CODE = ia32
+  LD_CODE = elf_i386
 endif
 
 ifeq ($(ARCH),x86_64)
   ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -DEFIX64 -mcmodel=large -m64
   ARCHDIR = X64
+  UC_ARCH = X64
   FILENAME_CODE = x64
+  LD_CODE = elf_x86_64
 endif
 
 EDK2BASE = /usr/local/UDK2010/MyWorkSpace
@@ -56,7 +60,7 @@ GENFW           = $(EDK2BASE)/BaseTools/Source/C/bin/GenFw
 LDSCRIPT = $(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script
 
 LDFLAGS         = -nostdlib -n -q --gc-sections --script=$(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script \
-                  --entry efi_main -u efi_main
+                  --entry efi_main -u efi_main -m $(LD_CODE)
 
 %.obj: %.c
        $(CC) $(ARCH_C_FLAGS) $(CFLAGS) $(INCLUDE_DIRS) -DNO_BUILTIN_VA_FUNCS -D__MAKEWITH_TIANO -c $< -o $@
index 18c85b978bdd8be3416fed29a0b79cb51dc8caf6..960a651bdf9e4a3f8d4a9c08e8fd3a5b8cf3d1b2 100644 (file)
@@ -4,7 +4,7 @@
 #
 
 HOSTARCH        = $(shell uname -m | sed s,i[3456789]86,ia32,)
-ARCH            := $(HOSTARCH)
+ARCH            ?= $(HOSTARCH)
 
 # Note: IA64 options are untested; taken from Debian's rEFIt package.
 ifeq ($(ARCH),ia64)
@@ -16,13 +16,17 @@ endif
 ifeq ($(ARCH),ia32)
   ARCH_C_FLAGS = -m32 -malign-double
   ARCHDIR = Ia32
+  UC_ARCH = IA32
   FILENAME_CODE = ia32
+  LD_CODE = elf_i386
 endif
 
 ifeq ($(ARCH),x86_64)
   ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -mcmodel=large -m64
   ARCHDIR = X64
+  UC_ARCH = X64
   FILENAME_CODE = x64
+  LD_CODE = elf_x86_64
 endif
 
 EDK2BASE = /usr/local/UDK2010/MyWorkSpace
@@ -31,7 +35,7 @@ EDK2BASE = /usr/local/UDK2010/MyWorkSpace
 # Below file defines TARGET (RELEASE or DEBUG), TARGET_ARCH (X64 or IA32), and TOOL_CHAIN_TAG (GCC44, GCC45, or GCC46)
 include $(EDK2BASE)/Conf/target.txt
 
-EFILIB          = $(EDK2BASE)/Build/MdeModule/$(TARGET)_$(TOOL_CHAIN_TAG)/$(TARGET_ARCH)/MdePkg/Library
+EFILIB          = $(EDK2BASE)/Build/Mde/$(TARGET)_$(TOOL_CHAIN_TAG)/$(UC_ARCH)/MdePkg/Library
 ALL_EFILIBS     = $(EFILIB)/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib/OUTPUT/BaseDebugPrintErrorLevelLib.lib \
                  $(EFILIB)/BasePrintLib/BasePrintLib/OUTPUT/BasePrintLib.lib \
                  $(EFILIB)/BasePcdLibNull/BasePcdLibNull/OUTPUT/BasePcdLibNull.lib \
@@ -73,7 +77,7 @@ GENFW           = $(EDK2BASE)/BaseTools/Source/C/bin/GenFw
 LDSCRIPT = $(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script
 
 LDFLAGS         = -nostdlib -n -q --gc-sections --script=$(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script \
-                  --entry _ModuleEntryPoint -u _ModuleEntryPoint
+                  --entry _ModuleEntryPoint -u _ModuleEntryPoint -m $(LD_CODE)
 
 %.o: %.c
        $(CC) $(ARCH_C_FLAGS) $(CFLAGS) $(INCLUDE_DIRS) -DFSTYPE=$(DRIVERNAME) -DNO_BUILTIN_VA_FUNCS -c $< -o $@
index a478b0c564f4792af0aad145c356f58cff67cbcc..5df54c208bc41f60fd8c7cc531b0a5bd3209face 100644 (file)
@@ -48,7 +48,7 @@
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
+#  MdeModulePkg/MdeModulePkg.dec\r
   IntelFrameworkPkg/IntelFrameworkPkg.dec\r
   IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
 \r
index fd9f444c37848351f31100bf5399bd1184f94125..fa4ad1d91420f8733a8a1525da3444aa09b14bf6 100644 (file)
@@ -7,7 +7,7 @@
 
 include ../Make.tiano
 
-EFILIB          = $(EDK2BASE)/Build/MdeModule/$(TARGET)_$(TOOL_CHAIN_TAG)/$(TARGET_ARCH)/MdePkg/Library
+EFILIB          = $(EDK2BASE)/Build/Mde/$(TARGET)_$(TOOL_CHAIN_TAG)/$(UC_ARCH)/MdePkg/Library
 ALL_EFILIBS     = $(EFILIB)/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib/OUTPUT/BaseDebugPrintErrorLevelLib.lib \
                   $(EFILIB)/BasePrintLib/BasePrintLib/OUTPUT/BasePrintLib.lib \
                   $(EFILIB)/BasePcdLibNull/BasePcdLibNull/OUTPUT/BasePcdLibNull.lib \