move gbp.conf to debian/
[debian/elilo] / Make.defaults
index 8037303f2a9133e24ba5e679c8642eca119c2cae..1eb95ccb8cf28b4e3ca4affe3f162fb98871d440 100644 (file)
@@ -1,6 +1,7 @@
 #
 #  Copyright (C) 2001-2003 Hewlett-Packard Co.
 #      Contributed by Stephane Eranian <eranian@hpl.hp.com>
+#      Contributed by Chandramouli Narayanan<mouli@linux.intel.com>
 #
 # This file is part of ELILO, the LINUX EFI boot loader.
 #
@@ -54,21 +55,23 @@ CONFIG_machspec_netconfig=y
 # They are installed as part of the GNU-EFI package installation
 #
 EFIINC    = /usr/include/efi
-GNUEFILIB   = /usr/lib
+GNUEFILIB  = /usr/lib
 EFILIB    = /usr/lib
 EFICRT0           = /usr/lib
 
 CDIR    := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
 TOPDIR  =
 
-ARCH      = $(shell uname -m | sed s,i[3456789]86,ia32,)
-INCDIR    = -I. -I$(TOPDIR) -I$(EFIINC) -I$(EFIINC)/$(ARCH) -I$(EFIINC)/protocol
+HOSTARCH   = $(shell dpkg-architecture -qDEB_BUILD_ARCH | sed s,i[3456789]86,ia32,)
+ARCH      := $(shell dpkg-architecture -qDEB_BUILD_ARCH | sed s,i[3456789]86,ia32,)
+INCDIR    = -I. -I$(TOPDIR) -I$(EFIINC) -I$(EFIINC)/$(ARCH) -I$(EFIINC)/protocol -I$(TOPDIR)/efi110
 CPPFLAGS   = -DCONFIG_$(ARCH) 
 
 OPTIMFLAGS = -O2 
 DEBUGFLAGS = -Wall
-CFLAGS    = $(OPTIMFLAGS) -fpic -fshort-wchar $(DEBUGFLAGS)
-LDFLAGS           = -nostdlib
+CFLAGS     = $(ARCH3264) $(OPTIMFLAGS) -fpic -fshort-wchar $(DEBUGFLAGS)
+ASFLAGS    = $(ARCH3264)
+LDFLAGS           = -nostdlib -znocombreloc
 INSTALL           = install
 
 ifeq ($(CONFIG_machspec_netconfig),y)
@@ -95,36 +98,49 @@ ifeq ($(CONFIG_chooser_textmenu),y)
 CFLAGS += -DCONFIG_CHOOSER_TEXTMENU
 endif
 
+prefix         = /usr/bin/
+  # Redhat 8.0 ia32 gcc-3.x version is reported to produce working EFI binaries.
+  # Redhat 9.0 ia32 gcc-3.x version is reported to produce BAD binaries.
+CC             = $(prefix)gcc
+AS             = $(prefix)as
+LD             = $(prefix)ld
+AR             = $(prefix)ar
+RANLIB         = $(prefix)ranlib
+OBJCOPY                = $(prefix)objcopy
+
+# Use Modified binutils that supports x86_64 using UEFI ABI
+ifeq ($(ARCH), x86_64)
+  ifeq ($(HOSTARCH), ia32)
+       ARCH3264 = -m64
+       LD3264 = -melf_x86_64
+
+       GNUEFILIB := $(GNUEFILIB)64
+       EFILIB    := $(EFILIB)64
+       EFICRT0   := $(EFICRT0)64
+  endif
+
+        CFLAGS   += -DEFI_FUNCTION_WRAPPER
+       OBJCOPY   = /usr/bin/objcopy
+endif
+
+ifeq ($(ARCH), ia32)
+  ifeq ($(HOSTARCH), x86_64)
+       ARCH3264 = -m32
+       LD3264 = -melf_i386
+
+       GNUEFILIB := /emul/ia32-linux$(GNUEFILIB)
+       EFILIB    := /emul/ia32-linux$(EFILIB)
+       EFICRT0   := /emul/ia32-linux$(EFICRT0)
+  endif
+endif
+
 ifeq ($(ARCH),ia64)
-  prefix       = /usr/bin/
-  CC           = $(prefix)gcc
-  AS           = $(prefix)as
-  LD           = $(prefix)ld
-  LD           = ld
-  AR           = $(prefix)ar
-  RANLIB       = $(prefix)ranlib
-  OBJCOPY      = $(prefix)objcopy
-
-GCC_VERSION=$(shell $(CROSS_COMPILE)$(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f1 -d'.')
-
-ifneq ($(GCC_VERSION),2)
+ GCC_VERSION=$(shell $(CROSS_COMPILE)$(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f1 -d'.')
+
+ ifneq ($(GCC_VERSION),2)
         CFLAGS += -frename-registers
-endif
-#
-# EFI specs allows only lower floating point partition to be used
-# 
-# Redhat 8.0 gcc-3.x version is reported to produce working EFI binaries.
-# Redhat 9.0 gcc-3.x version is reported to produce BAD binaries.
-#
-CFLAGS += -mfixed-range=f32-f127
-else
- ifeq ($(ARCH),ia32)
-  prefix       = /usr/bin/
-  CC           = $(prefix)gcc
-  AS           = $(prefix)as
-  LD           = $(prefix)ld
-  AR           = $(prefix)ar
-  RANLIB       = $(prefix)ranlib
-  OBJCOPY      = $(prefix)objcopy
  endif
+
+ # EFI specs allows only lower floating point partition to be used
+ CFLAGS += -mfixed-range=f32-f127
 endif