2 # Copyright (C) 2001-2003 Hewlett-Packard Co.
3 # Contributed by Stephane Eranian <eranian@hpl.hp.com>
4 # Contributed by Chandramouli Narayanan<mouli@linux.intel.com>
6 # This file is part of ELILO, the LINUX EFI boot loader.
8 # ELILO is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
13 # ELILO is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with ELILO; see the file COPYING. If not, write to the Free
20 # Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 # Please check out the elilo.txt for complete documentation on how
24 # to use this program.
28 # File system selection. At least one filesystem must be enabled
34 # WARNING WARNING WARNING
36 # Use this option with caution. This filesystem module does not
37 # support ext3 formatted partitions, i.e., it does not know how
38 # to recover from failures (ignores the log).
43 # Chooser selection(at least one must be defined)
45 CONFIG_chooser_simple=y
46 CONFIG_chooser_textmenu=y
49 # Enable IP-address based config file (elilo.conf) when netbooted
51 CONFIG_machspec_netconfig=y
54 # Indicate where the EFI include and libaries are.
55 # They are installed as part of the GNU-EFI package installation
57 EFIINC = /usr/include/efi
62 CDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
65 ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH | sed s,i[3456789]86,ia32,)
66 INCDIR = -I. -I$(TOPDIR) -I$(EFIINC) -I$(EFIINC)/$(ARCH) -I$(EFIINC)/protocol -I$(TOPDIR)/efi110
67 CPPFLAGS = -DCONFIG_$(ARCH)
71 CFLAGS = $(OPTIMFLAGS) -fno-strict-aliasing -fpic -fshort-wchar $(DEBUGFLAGS)
72 LDFLAGS = -nostdlib -znocombreloc
75 ifeq ($(CONFIG_machspec_netconfig),y)
76 CFLAGS += -DENABLE_MACHINE_SPECIFIC_NETCONFIG
79 ifeq ($(CONFIG_localfs),y)
80 CFLAGS += -DCONFIG_LOCALFS
83 ifeq ($(CONFIG_netfs),y)
84 CFLAGS += -DCONFIG_NETFS
87 ifeq ($(CONFIG_ext2fs),y)
88 CFLAGS += -DCONFIG_EXT2FS
91 ifeq ($(CONFIG_chooser_simple),y)
92 CFLAGS += -DCONFIG_CHOOSER_SIMPLE
95 ifeq ($(CONFIG_chooser_textmenu),y)
96 CFLAGS += -DCONFIG_CHOOSER_TEXTMENU
100 # Redhat 8.0 ia32 gcc-3.x version is reported to produce working EFI binaries.
101 # Redhat 9.0 ia32 gcc-3.x version is reported to produce BAD binaries.
106 RANLIB = $(prefix)ranlib
107 OBJCOPY = $(prefix)objcopy
109 # Use Modified binutils that supports x86_64 using UEFI ABI
110 ifeq ($(ARCH), x86_64)
111 CFLAGS += -DEFI_FUNCTION_WRAPPER
112 OBJCOPY = /usr/bin/objcopy
116 GCC_VERSION=$(shell $(CROSS_COMPILE)$(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f1 -d'.')
118 ifneq ($(GCC_VERSION),2)
119 CFLAGS += -frename-registers
122 # EFI specs allows only lower floating point partition to be used
123 CFLAGS += -mfixed-range=f32-f127