Makefile 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. #
  2. # Copyright (C) 1999-2007 Hewlett-Packard Co.
  3. # Contributed by David Mosberger <[email protected]>
  4. # Contributed by Stephane Eranian <[email protected]>
  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. VERSION = 3.0.3
  37. SRCDIR = $(shell pwd)
  38. VPATH = $(SRCDIR)
  39. include $(SRCDIR)/Make.defaults
  40. SUBDIRS = lib gnuefi inc apps
  41. gnuefi: lib
  42. all: check_gcc $(SUBDIRS)
  43. mkvars:
  44. @echo AR=$(AR)
  45. @echo ARCH=$(ARCH)
  46. @echo ARCH3264=$(ARCH3264)
  47. @echo AS=$(AS)
  48. @echo ASFLAGS=$(ASFLAGS)
  49. @echo CC=$(CC)
  50. @echo CFLAGS=$(CFLAGS)
  51. @echo CPPFLAGS=$(CPPFLAGS)
  52. @echo GCCMINOR=$(GCCMINOR)
  53. @echo GCCNEWENOUGH=$(GCCNEWENOUGH)
  54. @echo GCCVERSION=$(GCCVERSION)
  55. @echo HOSTARCH=$(HOSTARCH)
  56. @echo INCDIR=$(INCDIR)
  57. @echo INSTALL=$(INSTALL)
  58. @echo INSTALLROOT=$(INSTALLROOT)
  59. @echo LD=$(LD)
  60. @echo LDFLAGS=$(LDFLAGS)
  61. @echo LIBDIR=$(LIBDIR)
  62. @echo OBJCOPY=$(OBJCOPY)
  63. @echo OS=$(OS)
  64. @echo prefix=$(prefix)
  65. @echo PREFIX=$(PREFIX)
  66. @echo RANLIB=$(RANLIB)
  67. @echo SRCDIR=$(SRCDIR)
  68. @echo TOPDIR=$(TOPDIR)
  69. $(SUBDIRS):
  70. mkdir -p $(OBJDIR)/$@
  71. $(MAKE) -C $(OBJDIR)/$@ -f $(SRCDIR)/$@/Makefile SRCDIR=$(SRCDIR)/$@ ARCH=$(ARCH)
  72. clean:
  73. rm -f *~
  74. @for d in $(SUBDIRS); do \
  75. if [ -d $(OBJDIR)/$$d ]; then \
  76. $(MAKE) -C $(OBJDIR)/$$d -f $(SRCDIR)/$$d/Makefile SRCDIR=$(SRCDIR)/$$d clean; \
  77. fi; \
  78. done
  79. install:
  80. @for d in $(SUBDIRS); do \
  81. mkdir -p $(OBJDIR)/$$d; \
  82. $(MAKE) -C $(OBJDIR)/$$d -f $(SRCDIR)/$$d/Makefile SRCDIR=$(SRCDIR)/$$d install; done
  83. .PHONY: $(SUBDIRS) clean depend
  84. #
  85. # on both platforms you must use gcc 3.0 or higher
  86. #
  87. check_gcc:
  88. ifeq ($(GCC_VERSION),2)
  89. @echo "you need to use a version of gcc >= 3.0, you are using `$(CC) --version`"
  90. @exit 1
  91. endif
  92. include $(SRCDIR)/Make.rules
  93. test-archive:
  94. @rm -rf /tmp/gnu-efi-$(VERSION) /tmp/gnu-efi-$(VERSION)-tmp
  95. @mkdir -p /tmp/gnu-efi-$(VERSION)-tmp
  96. @git archive --format=tar $(shell git branch | awk '/^*/ { print $$2 }') | ( cd /tmp/gnu-efi-$(VERSION)-tmp/ ; tar x )
  97. @git diff | ( cd /tmp/gnu-efi-$(VERSION)-tmp/ ; patch -s -p1 -b -z .gitdiff )
  98. @mv /tmp/gnu-efi-$(VERSION)-tmp/ /tmp/gnu-efi-$(VERSION)/
  99. @dir=$$PWD; cd /tmp; tar -c --bzip2 -f $$dir/gnu-efi-$(VERSION).tar.bz2 gnu-efi-$(VERSION)
  100. @rm -rf /tmp/gnu-efi-$(VERSION)
  101. @echo "The archive is in gnu-efi-$(VERSION).tar.bz2"
  102. tag:
  103. git tag $(VERSION) refs/heads/master
  104. archive: tag
  105. @rm -rf /tmp/gnu-efi-$(VERSION) /tmp/gnu-efi-$(VERSION)-tmp
  106. @mkdir -p /tmp/gnu-efi-$(VERSION)-tmp
  107. @git archive --format=tar $(VERSION) | ( cd /tmp/gnu-efi-$(VERSION)-tmp/ ; tar x )
  108. @mv /tmp/gnu-efi-$(VERSION)-tmp/ /tmp/gnu-efi-$(VERSION)/
  109. @dir=$$PWD; cd /tmp; tar -c --bzip2 -f $$dir/gnu-efi-$(VERSION).tar.bz2 gnu-efi-$(VERSION)
  110. @rm -rf /tmp/gnu-efi-$(VERSION)
  111. @echo "The archive is in gnu-efi-$(VERSION).tar.bz2"