2 # Copyright (c) 1999-2007 Hewlett-Packard Development Company, L.P.
3 # Contributed by David Mosberger <davidm@hpl.hp.com>
4 # Contributed by Stephane Eranian <eranian@hpl.hp.com>
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions
12 # * Redistributions of source code must retain the above copyright
13 # notice, this list of conditions and the following disclaimer.
14 # * Redistributions in binary form must reproduce the above
15 # copyright notice, this list of conditions and the following
16 # disclaimer in the documentation and/or other materials
17 # provided with the distribution.
18 # * Neither the name of Hewlett-Packard Co. nor the names of its
19 # contributors may be used to endorse or promote products derived
20 # from this software without specific prior written permission.
22 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23 # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
27 # BE LIABLE FOR ANYDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
28 # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
32 # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
33 # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 # Where to install the package. GNU-EFI will create and access
39 # lib and include under the root
43 LIBDIR := ${PREFIX}/lib
45 TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
47 HOSTARCH = $(shell uname -m | sed s,i[3456789]86,ia32,)
48 ARCH := $(shell uname -m | sed s,i[3456789]86,ia32,)
49 OS = $(shell uname -s)
50 INCDIR = -I$(SRCDIR) -I$(TOPDIR)/inc -I$(TOPDIR)/inc/$(ARCH) -I$(TOPDIR)/inc/protocol
51 GCCVERSION := $(shell gcc -dumpversion | cut -f1 -d.)
52 GCCMINOR := $(shell gcc -dumpversion | cut -f2 -d.)
53 GCCNEWENOUGH := $(shell ([ $(GCCVERSION) -gt "4" ] || ([ $(GCCVERSION) -eq "4" ] && [ $(GCCMINOR) -ge "7" ])) && echo 1)
55 CPPFLAGS += -DCONFIG_$(ARCH)
56 ifeq ($(GCCNEWENOUGH),1)
57 CPPFLAGS += -maccumulate-outgoing-args --std=c11
59 CFLAGS += $(ARCH3264) -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants
69 RANLIB := $(prefix)ranlib
70 OBJCOPY := $(prefix)objcopy
73 CFLAGS += -mfixed-range=f32-f127
77 ifeq ($(HOSTARCH), x86_64)
82 ifeq ($(ARCH), x86_64)
83 CFLAGS += -mno-red-zone
84 ifeq ($(HOSTARCH), ia32)