CDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
TOPDIR =
-ARCH = $(shell uname -m | sed s,i[3456789]86,ia32,)
+HOSTARCH = $(shell uname -m | sed s,i[3456789]86,ia32,)
+ARCH := $(shell uname -m | 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) -fno-strict-aliasing -fpic -fshort-wchar $(DEBUGFLAGS)
+CFLAGS = $(ARCH3264) $(OPTIMFLAGS) -fpic -fshort-wchar $(DEBUGFLAGS)
+ASFLAGS = $(ARCH3264)
LDFLAGS = -nostdlib -znocombreloc
INSTALL = install
# 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)
GCC_VERSION=$(shell $(CROSS_COMPILE)$(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f1 -d'.')
# to use this program.
#
-include Make.defaults
-TOPDIR=.
+SRCDIR = .
+
+VPATH = $(SRCDIR)
+
+include $(SRCDIR)/Make.defaults
+TOPDIR = $(SRCDIR)
CRTOBJS = $(EFICRT0)/crt0-efi-$(ARCH).o
LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_efi.lds
LDFLAGS += -T $(LDSCRIPT) -shared -Bsymbolic -L$(EFILIB) -L$(GNUEFILIB) $(CRTOBJS)
-LOADLIBES = -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name)
+LOADLIBES = -lefi -lgnuefi $(shell $(CC) $(ARCH3264) -print-libgcc-file-name)
FORMAT = efi-app-$(ARCH)
FILESYSTEM =
chooser.o : Make.defaults
$(SUBDIRS): dummy
- $(MAKE) -C $@
+ mkdir -p $@
+ $(MAKE) -C $@ -f $(SRCDIR)/../$@/Makefile SRCDIR=$(SRCDIR)/../$@ ARCH=$(ARCH)
dummy:
@exit 1
endif
-include Make.rules
+include $(SRCDIR)/Make.rules
# to use this program.
#
-include ../Make.defaults
-include ../Make.rules
+SRCDIR = .
+
+VPATH = $(SRCDIR)
+
+include $(SRCDIR)/../Make.defaults
+include $(SRCDIR)/../Make.rules
+
+TOPDIR=$(SRCDIR)/..
-TOPDIR=$(CDIR)/..
FILES=
all: $(TARGET)
$(TARGET): check-choosers $(TOPDIR)/Make.defaults $(FILES)
- $(LD) -o $@ -r $(FILES)
+ $(LD) $(LD3264) -o $@ -r $(FILES)
clean:
$(RM) -f $(TARGET) $(FILES)
-
+
check-choosers:
@if [ -n "$(FILES)" ]; then \
exit 0; \
* new upstream version, closes: #376002
* patch for dpkg option --print-installation-architecture going obsolete
from Dann Frazier, closes: #550090
+ * support building 32 and 64 bit targets on each host, closes: #483045
-- Bdale Garbee <bdale@gag.com> Sun, 01 Nov 2009 20:24:12 -0700
Section: admin
Priority: optional
Maintainer: Bdale Garbee <bdale@gag.com>
-Build-Depends: debhelper (>> 5), binutils (>= 2.17.50.0.14), gnu-efi (>=3.0d), po-debconf
+Build-Depends: debhelper (>> 5), binutils (>= 2.17.50.0.14), gcc-multilib [i386 amd64], gnu-efi (>=3.0d), po-debconf
Standards-Version: 3.8.3
Package: elilo
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
+buildarch := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+
configure: configure-stamp
configure-stamp:
dh_testdir
build-stamp:
dh_testdir
+ifeq ($(buildarch), i386)
+ mkdir debian/build64
+ $(MAKE) -C debian/build64 -f ../../Makefile SRCDIR=../.. ARCH=x86_64
+endif
+
+ifeq ($(buildarch), amd64)
+ mkdir debian/build32
+ $(MAKE) -C debian/build32 -f ../../Makefile SRCDIR=../.. ARCH=ia32
+endif
+
$(MAKE)
touch build-stamp
[ ! -f Makefile ] || $(MAKE) clean
+ rm -rf debian/build32 debian/build64
+
debconf-updatepo
dh_clean
dh_clean -k
dh_installdirs
+ifeq ($(buildarch), i386)
+ mkdir -p debian/elilo/usr/lib64/elilo
+ cp debian/build64/elilo.efi debian/elilo/usr/lib64/elilo/elilo.efi
+ chmod 0644 debian/elilo/usr/lib64/elilo/elilo.efi
+endif
+
+ifeq ($(buildarch), amd64)
+ mkdir -p debian/elilo/emul/ia32-linux/usr/lib/elilo
+ cp debian/build32/elilo.efi debian/elilo/emul/ia32-linux/usr/lib/elilo/elilo.efi
+ chmod 0644 debian/elilo/emul/ia32-linux/usr/lib/elilo/elilo.efi
+endif
+
cp elilo.efi debian/elilo/usr/lib/elilo/elilo.efi
+ chmod 0644 debian/elilo/usr/lib/elilo/elilo.efi
# dynamically determine version string from changelog
sed s/'##VERSION##'/"`IFS=\"()\" read pkg ver other < \
cp tools/eliloalt debian/elilo/usr/sbin/eliloalt
chmod 0755 debian/elilo/usr/sbin/eliloalt
- chmod 0644 debian/elilo/usr/lib/elilo/elilo.efi
-
binary-indep: build install
binary-arch: build install
# to use this program.
#
-include ../Make.defaults
-include ../Make.rules
+SRCDIR = .
+
+VPATH = $(SRCDIR)
+
+include $(SRCDIR)/../Make.defaults
+include $(SRCDIR)/../Make.rules
+
+TOPDIR=$(SRCDIR)/..
-TOPDIR=$(CDIR)/..
FILES=simple.o
# without doing make clean.
#
$(TARGET): $(FILES)
- $(LD) -r -o $@ $(FILES)
+ $(LD) $(LD3264) -r -o $@ $(FILES)
clean:
$(RM) -f $(TARGET) $(FILES)
# to use this program.
#
-include ../Make.defaults
-include ../Make.rules
+SRCDIR = .
+
+VPATH = $(SRCDIR)
+
+include $(SRCDIR)/../Make.defaults
+include $(SRCDIR)/../Make.rules
+
+TOPDIR=$(SRCDIR)/..
-TOPDIR=$(CDIR)/..
FILES=
ifeq ($(CONFIG_localfs),y)
# without doing make clean.
#
$(TARGET): check-filesystems $(TOPDIR)/Make.defaults $(FILES)
- $(LD) -r -o $@ $(FILES)
+ $(LD) $(LD3264) -r -o $@ $(FILES)
clean:
$(RM) -f $(TARGET) $(FILES)
# to use this program.
#
-include ../Make.defaults
-include ../Make.rules
+SRCDIR = .
+
+VPATH = $(SRCDIR)
+
+include $(SRCDIR)/../Make.defaults
+include $(SRCDIR)/../Make.rules
+
+TOPDIR=$(SRCDIR)/..
-TOPDIR=$(CDIR)/..
FILES=system.o config.o bzimage.o plain_loader.o gzip_loader.o gzip.o
./bin_to_h <rmswitch >rmswitch.h
$(TARGET): $(FILES)
- $(LD) -r -o $@ $(FILES)
+ $(LD) $(LD3264) -r -o $@ $(FILES)
clean:
$(RM) -f $(TARGET) $(FILES)
# to use this program.
#
-include ../Make.defaults
-include ../Make.rules
+SRCDIR = .
+
+VPATH = $(SRCDIR)
+
+include $(SRCDIR)/../Make.defaults
+include $(SRCDIR)/../Make.rules
+
+TOPDIR=$(SRCDIR)/..
-TOPDIR=$(CDIR)/..
FILES=system.o config.o fpswa.o plain_loader.o gzip_loader.o \
gzip.o memset.o memcpy.o setjmp.o longjmp.o
# to use this program.
#
-include ../Make.defaults
-include ../Make.rules
+SRCDIR = .
+
+VPATH = $(SRCDIR)
+
+include $(SRCDIR)/../Make.defaults
+include $(SRCDIR)/../Make.rules
+
+TOPDIR=$(SRCDIR)/..
-TOPDIR=$(CDIR)/..
FILES=eliloalt.o
TARGET=eliloalt
# to use this program.
#
-include ../Make.defaults
-include ../Make.rules
+SRCDIR = .
+
+VPATH = $(SRCDIR)
+
+include $(SRCDIR)/../Make.defaults
+include $(SRCDIR)/../Make.rules
+
+TOPDIR=$(SRCDIR)/..
-TOPDIR=$(CDIR)/..
FILES=system.o config.o bzimage.o plain_loader.o gzip_loader.o gzip.o
#FILES=system.o config.o plain_loader.o
system.o: rmswitch.h
rmswitch.h: bin_to_h.c rmswitch.S
- $(CC) -o bin_to_h bin_to_h.c
- $(AS) -o rmswitch.o rmswitch.S
+ $(CC) -o bin_to_h $(SRCDIR)/bin_to_h.c
+ $(AS) -o rmswitch.o $(SRCDIR)/rmswitch.S
$(LD) -Ttext 0x0 -s --oformat binary -o rmswitch rmswitch.o
./bin_to_h <rmswitch >rmswitch.h
$(TARGET): $(FILES)
- $(LD) -r -o $@ $(FILES)
+ $(LD) $(LD3264) -r -o $@ $(FILES)
clean:
$(RM) -f $(TARGET) $(FILES)