Make.defaults revision 1.1.1.1.4.2       1  1.1.1.1.4.2  rmind # -*- makefile -*-
      2  1.1.1.1.4.2  rmind # Copyright (c) 1999-2007 Hewlett-Packard Development Company, L.P.
      3  1.1.1.1.4.2  rmind #	Contributed by David Mosberger <davidm (a] hpl.hp.com>
      4  1.1.1.1.4.2  rmind #	Contributed by Stephane Eranian <eranian (a] hpl.hp.com>
      5  1.1.1.1.4.2  rmind #
      6  1.1.1.1.4.2  rmind #    All rights reserved.
      7  1.1.1.1.4.2  rmind #
      8  1.1.1.1.4.2  rmind #    Redistribution and use in source and binary forms, with or without
      9  1.1.1.1.4.2  rmind #    modification, are permitted provided that the following conditions
     10  1.1.1.1.4.2  rmind #    are met:
     11  1.1.1.1.4.2  rmind #
     12  1.1.1.1.4.2  rmind #    * Redistributions of source code must retain the above copyright
     13  1.1.1.1.4.2  rmind #      notice, this list of conditions and the following disclaimer.
     14  1.1.1.1.4.2  rmind #    * Redistributions in binary form must reproduce the above
     15  1.1.1.1.4.2  rmind #      copyright notice, this list of conditions and the following
     16  1.1.1.1.4.2  rmind #      disclaimer in the documentation and/or other materials
     17  1.1.1.1.4.2  rmind #      provided with the distribution.
     18  1.1.1.1.4.2  rmind #    * Neither the name of Hewlett-Packard Co. nor the names of its
     19  1.1.1.1.4.2  rmind #      contributors may be used to endorse or promote products derived
     20  1.1.1.1.4.2  rmind #      from this software without specific prior written permission.
     21  1.1.1.1.4.2  rmind #
     22  1.1.1.1.4.2  rmind #    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
     23  1.1.1.1.4.2  rmind #    CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
     24  1.1.1.1.4.2  rmind #    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     25  1.1.1.1.4.2  rmind #    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     26  1.1.1.1.4.2  rmind #    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
     27  1.1.1.1.4.2  rmind #    BE LIABLE FOR ANYDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
     28  1.1.1.1.4.2  rmind #    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     29  1.1.1.1.4.2  rmind #    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
     30  1.1.1.1.4.2  rmind #    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     31  1.1.1.1.4.2  rmind #    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
     32  1.1.1.1.4.2  rmind #    TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
     33  1.1.1.1.4.2  rmind #    THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     34  1.1.1.1.4.2  rmind #    SUCH DAMAGE.
     35  1.1.1.1.4.2  rmind #
     36  1.1.1.1.4.2  rmind 
     37  1.1.1.1.4.2  rmind TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
     38  1.1.1.1.4.2  rmind 
     39  1.1.1.1.4.2  rmind #
     40  1.1.1.1.4.2  rmind # Variables below overridable from command-line:
     41  1.1.1.1.4.2  rmind #   make VARNAME=value ...
     42  1.1.1.1.4.2  rmind #
     43  1.1.1.1.4.2  rmind 
     44  1.1.1.1.4.2  rmind #
     45  1.1.1.1.4.2  rmind # Where to install the package. GNU-EFI will create and access
     46  1.1.1.1.4.2  rmind # lib and include under the root
     47  1.1.1.1.4.2  rmind #
     48  1.1.1.1.4.2  rmind INSTALLROOT  := /
     49  1.1.1.1.4.2  rmind PREFIX       := /usr/local
     50  1.1.1.1.4.2  rmind LIBDIR 	     := $(PREFIX)/lib
     51  1.1.1.1.4.2  rmind INSTALL	     := install
     52  1.1.1.1.4.2  rmind 
     53  1.1.1.1.4.2  rmind # Host/target identification
     54  1.1.1.1.4.2  rmind OS	     := $(shell uname -s)
     55  1.1.1.1.4.2  rmind HOSTARCH     := $(shell uname -m | sed s,i[3456789]86,ia32,)
     56  1.1.1.1.4.2  rmind ARCH	     := $(shell uname -m | sed s,i[3456789]86,ia32,)
     57  1.1.1.1.4.2  rmind 
     58  1.1.1.1.4.2  rmind # FreeBSD (and possibly others) reports amd64 instead of x86_64
     59  1.1.1.1.4.2  rmind ifeq ($(ARCH),amd64)
     60  1.1.1.1.4.2  rmind   override ARCH := x86_64
     61  1.1.1.1.4.2  rmind endif
     62  1.1.1.1.4.2  rmind 
     63  1.1.1.1.4.2  rmind # Compilation tools
     64  1.1.1.1.4.2  rmind prefix       := /usr/bin/
     65  1.1.1.1.4.2  rmind CC           := $(prefix)gcc
     66  1.1.1.1.4.2  rmind AS           := $(prefix)as
     67  1.1.1.1.4.2  rmind LD           := $(prefix)ld
     68  1.1.1.1.4.2  rmind AR           := $(prefix)ar
     69  1.1.1.1.4.2  rmind RANLIB       := $(prefix)ranlib
     70  1.1.1.1.4.2  rmind OBJCOPY      := $(prefix)objcopy
     71  1.1.1.1.4.2  rmind 
     72  1.1.1.1.4.2  rmind 
     73  1.1.1.1.4.2  rmind #
     74  1.1.1.1.4.2  rmind # Variables below derived from variables above
     75  1.1.1.1.4.2  rmind #
     76  1.1.1.1.4.2  rmind 
     77  1.1.1.1.4.2  rmind GCCVERSION   := $(shell $(CC) -dumpversion | cut -f1 -d.)
     78  1.1.1.1.4.2  rmind GCCMINOR     := $(shell $(CC) -dumpversion | cut -f2 -d.)
     79  1.1.1.1.4.2  rmind 
     80  1.1.1.1.4.2  rmind # Rely on GCC MS ABI support?
     81  1.1.1.1.4.2  rmind GCCNEWENOUGH := $(shell ( [ $(GCCVERSION) -gt "4" ]           \
     82  1.1.1.1.4.2  rmind                           || ( [ $(GCCVERSION) -eq "4" ]      \
     83  1.1.1.1.4.2  rmind                                && [ $(GCCMINOR) -ge "7" ] ) ) \
     84  1.1.1.1.4.2  rmind                         && echo 1)
     85  1.1.1.1.4.2  rmind ifeq ($(GCCNEWENOUGH),1)
     86  1.1.1.1.4.2  rmind   CPPFLAGS += -DGNU_EFI_USE_MS_ABI -maccumulate-outgoing-args --std=c11
     87  1.1.1.1.4.2  rmind endif
     88  1.1.1.1.4.2  rmind 
     89  1.1.1.1.4.2  rmind # Arch-specific compilation flags
     90  1.1.1.1.4.2  rmind CPPFLAGS += -DCONFIG_$(ARCH)
     91  1.1.1.1.4.2  rmind 
     92  1.1.1.1.4.2  rmind ifeq ($(ARCH),ia64)
     93  1.1.1.1.4.2  rmind   CFLAGS += -mfixed-range=f32-f127
     94  1.1.1.1.4.2  rmind endif
     95  1.1.1.1.4.2  rmind 
     96  1.1.1.1.4.2  rmind ifeq ($(ARCH),ia32)
     97  1.1.1.1.4.2  rmind   CFLAGS += -mno-mmx -mno-sse
     98  1.1.1.1.4.2  rmind   ifeq ($(HOSTARCH),x86_64)
     99  1.1.1.1.4.2  rmind     ARCH3264 = -m32
    100  1.1.1.1.4.2  rmind   endif
    101  1.1.1.1.4.2  rmind endif
    102  1.1.1.1.4.2  rmind 
    103  1.1.1.1.4.2  rmind ifeq ($(ARCH),x86_64)
    104  1.1.1.1.4.2  rmind   CFLAGS += -mno-red-zone -mno-mmx -mno-sse
    105  1.1.1.1.4.2  rmind   ifeq ($(HOSTARCH),ia32)
    106  1.1.1.1.4.2  rmind     ARCH3264 = -m64
    107  1.1.1.1.4.2  rmind   endif
    108  1.1.1.1.4.2  rmind endif
    109  1.1.1.1.4.2  rmind 
    110  1.1.1.1.4.2  rmind # Generic compilation flags
    111  1.1.1.1.4.2  rmind INCDIR  += -I$(SRCDIR) -I$(TOPDIR)/inc -I$(TOPDIR)/inc/$(ARCH) \
    112  1.1.1.1.4.2  rmind            -I$(TOPDIR)/inc/protocol
    113  1.1.1.1.4.2  rmind CFLAGS  += $(ARCH3264) -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing \
    114  1.1.1.1.4.2  rmind            -fno-merge-constants -ffreestanding -fno-stack-protector       \
    115  1.1.1.1.4.2  rmind            -fno-stack-check
    116  1.1.1.1.4.2  rmind ASFLAGS += $(ARCH3264)
    117  1.1.1.1.4.2  rmind LDFLAGS	+= -nostdlib --no-undefined
    118