Make.defaults 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #
  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>
  5. #
  6. # All rights reserved.
  7. #
  8. # Redistribution and use in source and binary forms, with or without
  9. # modification, are permitted provided that the following conditions
  10. # are met:
  11. #
  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.
  21. #
  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
  34. # SUCH DAMAGE.
  35. # #
  36. #
  37. # Where to install the package. GNU-EFI will create and access
  38. # lib and include under the root
  39. #
  40. INSTALLROOT := /
  41. PREFIX := /usr/local
  42. LIBDIR := ${PREFIX}/lib
  43. TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
  44. HOSTARCH = $(shell uname -m | sed s,i[3456789]86,ia32,)
  45. ARCH := $(shell uname -m | sed s,i[3456789]86,ia32,)
  46. OS = $(shell uname -s)
  47. INCDIR = -I$(SRCDIR) -I$(TOPDIR)/inc -I$(TOPDIR)/inc/$(ARCH) -I$(TOPDIR)/inc/protocol
  48. GCCVERSION := $(shell gcc -dumpversion | cut -f1 -d.)
  49. GCCMINOR := $(shell gcc -dumpversion | cut -f2 -d.)
  50. GCCNEWENOUGH := $(shell ([ $(GCCVERSION) -gt "4" ] || ([ $(GCCVERSION) -eq "4" ] && [ $(GCCMINOR) -ge "7" ])) && echo 1)
  51. CPPFLAGS = -DCONFIG_$(ARCH)
  52. ifeq ($(GCCNEWENOUGH),1)
  53. CPPFLAGS += -DGNU_EFI_USE_MS_ABI -maccumulate-outgoing-args --std=c11
  54. endif
  55. CFLAGS = $(ARCH3264) -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants
  56. ASFLAGS = $(ARCH3264)
  57. LDFLAGS = -nostdlib
  58. INSTALL = install
  59. prefix = /usr/bin/
  60. CC := $(prefix)gcc
  61. AS := $(prefix)as
  62. LD := $(prefix)ld
  63. AR := $(prefix)ar
  64. RANLIB := $(prefix)ranlib
  65. OBJCOPY := $(prefix)objcopy
  66. ifeq ($(ARCH),ia64)
  67. CFLAGS += -mfixed-range=f32-f127
  68. endif
  69. ifeq ($(ARCH), ia32)
  70. ifeq ($(HOSTARCH), x86_64)
  71. ARCH3264 = -m32
  72. endif
  73. endif
  74. ifeq ($(ARCH), x86_64)
  75. CFLAGS += -mno-red-zone
  76. ifeq ($(HOSTARCH), ia32)
  77. ARCH3264 = -m64
  78. endif
  79. endif