Advertisement
Guest User

Untitled

a guest
May 26th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.06 KB | None | 0 0
  1. what I did in VIM: %s/CorebootPayloadPkg/UefiPayloadPkg/
  2. ##
  3. ## This file is part of the coreboot project.
  4. ##
  5. ## Copyright (C) 2017 Google Inc.
  6. ##
  7. ## This program is free software; you can redistribute it and/or modify
  8. ## it under the terms of the GNU General Public License as published by
  9. ## the Free Software Foundation; version 2 of the License.
  10. ##
  11. ## This program is distributed in the hope that it will be useful,
  12. ## but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ## GNU General Public License for more details.
  15. ##
  16.  
  17. # force the shell to bash - the edksetup.sh script doesn't work with dash
  18. export SHELL := env bash
  19.  
  20. project_name=Tianocore
  21. project_dir=$(CURDIR)/tianocore
  22. project_git_repo=https://github.com/mrchromebox/edk2
  23. project_git_branch=coreboot_fb
  24. upstream_git_repo=https://github.com/tianocore/edk2
  25.  
  26. # STABLE revision is MrChromebox's coreboot framebuffer (coreboot_fb) branch
  27. TAG-$(CONFIG_TIANOCORE_STABLE)=origin/$(project_git_branch)
  28. TAG-$(CONFIG_TIANOCORE_REVISION)=$(CONFIG_TIANOCORE_REVISION_ID)
  29.  
  30. export EDK_TOOLS_PATH=$(project_dir)/BaseTools
  31.  
  32. ifeq ($(CONFIG_TIANOCORE_DEBUG),y)
  33. BUILD_TYPE=DEBUG
  34. else
  35. BUILD_TYPE=RELEASE
  36. endif
  37.  
  38. ifneq ($(CONFIG_TIANOCORE_USE_8254_TIMER), y)
  39. TIMER=-DUSE_HPET_TIMER
  40. endif
  41.  
  42. ifeq ($(CONFIG_TIANOCORE_TARGET_IA32), y)
  43. BUILD_STR=-a IA32 -t COREBOOT -p UefiPayloadPkg/UefiPayloadPkgIa32.dsc -b $(BUILD_TYPE) $(TIMER)
  44. else
  45. BUILD_STR=-a IA32 -a X64 -t COREBOOT -p UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc -b $(BUILD_TYPE) $(TIMER)
  46. endif
  47.  
  48. all: clean build
  49.  
  50. $(project_dir):
  51. echo " Cloning $(project_name) from Git"
  52. git clone --branch $(project_git_branch) $(project_git_repo) $(project_dir); \
  53. cd $(project_dir); \
  54. git remote add upstream $(upstream_git_repo)
  55.  
  56. update: $(project_dir)
  57. cd $(project_dir); \
  58. echo " Fetching new commits from the $(project_name) repo"; \
  59. git fetch --multiple origin upstream 2>/dev/null; \
  60. if ! git rev-parse --verify -q $(TAG-y) >/dev/null; then \
  61. echo " $(TAG-y) is not a valid git reference"; \
  62. exit 1; \
  63. fi; \
  64. if git describe --all --dirty | grep -qv dirty; then \
  65. echo " Checking out $(project_name) revision $(TAG-y)"; \
  66. git checkout --detach $(TAG-y); \
  67. else \
  68. echo " Working directory not clean; will not overwrite"; \
  69. fi
  70.  
  71. checktools:
  72. echo "Checking uuid-dev..."
  73. echo "#include <uuid/uuid.h>" > libtest.c
  74. echo "int main(int argc, char **argv) { (void) argc; (void) argv; return 0; }" >> libtest.c
  75. $(HOSTCC) $(HOSTCCFLAGS) libtest.c -o libtest >/dev/null 2>&1 && echo " found uuid-dev." || \
  76. ( echo " Not found."; echo "ERROR: please_install uuid-dev (libuuid-devel)"; exit 1 )
  77. rm -rf libtest.c libtest
  78. echo "Checking nasm..."
  79. type nasm > /dev/null 2>&1 && echo " found nasm." || \
  80. ( echo " Not found."; echo "Error: Please install nasm."; exit 1 )
  81.  
  82. build: update checktools
  83. unset CC; $(MAKE) -C $(project_dir)/BaseTools
  84. echo " build $(project_name) $(TAG-y)"
  85. if [ -n $(CONFIG_TIANOCORE_BOOTSPLASH_FILE) ]; then \
  86. echo " Copying custom bootsplash image"; \
  87. case "$(CONFIG_TIANOCORE_BOOTSPLASH_FILE)" in \
  88. /*) cp $(CONFIG_TIANOCORE_BOOTSPLASH_FILE) \
  89. $(project_dir)/UefiPayloadPkg/Logo/Logo.bmp;; \
  90. *) cp $(top)/$(CONFIG_TIANOCORE_BOOTSPLASH_FILE) \
  91. $(project_dir)/UefiPayloadPkg/Logo/Logo.bmp;; \
  92. esac \
  93. fi; \
  94. cd $(project_dir); \
  95. export EDK_TOOLS_PATH=$(project_dir)/BaseTools; \
  96. export WORKSPACE=$(project_dir); \
  97. . ./edksetup.sh BaseTools; \
  98. grep -q "COREBOOT" $(project_dir)/Conf/tools_def.txt; \
  99. if [ $$? -ne 0 ]; then \
  100. cat ../tools_def.txt >> $(project_dir)/Conf/tools_def.txt; \
  101. fi; \
  102. build $(BUILD_STR); \
  103. mv $(project_dir)/Build/UefiPayloadPkg*/*/FV/UEFIPAYLOAD.fd $(project_dir)/Build/UEFIPAYLOAD.fd; \
  104. git checkout UefiPayloadPkg/Logo/Logo.bmp > /dev/null 2>&1 || true
  105.  
  106. clean:
  107. test -d $(project_dir) && (cd $(project_dir); rm -rf Build; rm -f Conf/tools_def.txt) || exit 0
  108.  
  109. distclean:
  110. rm -rf $(project_dir)
  111. .PHONY: all update checktools config build clean distclean
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement