depthcharge 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #!/usr/bin/env bash
  2. # Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
  3. #
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. arguments() {
  17. project_arguments_targets "$project" "$@"
  18. }
  19. dependencies() {
  20. project_dependencies "$project" "$@"
  21. }
  22. usage() {
  23. project_usage_actions "$project"
  24. project_usage_arguments "$project" "$@"
  25. }
  26. download() {
  27. local repository=$project
  28. project_download_git "$project" "$repository" "https://chromium.googlesource.com/chromiumos/platform/depthcharge https://review.coreboot.org/depthcharge.git https://github.com/coreboot/depthcharge.git" "$@"
  29. }
  30. download_check() {
  31. local repository=$project
  32. project_download_check_git "$project" "$repository" "$@"
  33. }
  34. extract() {
  35. project_extract "$project" "$@"
  36. }
  37. extract_check() {
  38. project_extract_check "$project" "$@"
  39. }
  40. update() {
  41. local repository=$project
  42. project_update_git "$project" "$repository" "$@"
  43. }
  44. update_check() {
  45. local repository=$project
  46. project_update_check_git "$project" "$repository" "$@"
  47. }
  48. build() {
  49. local repository=$project
  50. project_sources_directory_missing_empty_error "$project" "$repository" "$@"
  51. if git_project_check $repository
  52. then
  53. git_project_checkout "$project" "$repository" "$@"
  54. fi
  55. local sources_path=$(project_sources_path "$project" "$repository" "$@")
  56. local build_path=$(project_build_path "$project" "$@")
  57. local libpayload_build_path=$(depthcharge_libpayload_build_path "$project" "$@")
  58. local libpayload_build_install_path="$libpayload_build_path/install"
  59. local vboot_sources_path=$(project_sources_path "vboot" "vboot" "devices")
  60. local arch=$(depthcharge_arch "$@")
  61. local device=$(depthcharge_device "$@")
  62. project_action_arguments "checkout" "vboot" "devices"
  63. mkdir -p "$build_path"
  64. make -C "$sources_path" obj="$build_path" DOTCONFIG="$build_path/.config" BOARD="$device" "defconfig"
  65. make -C "$sources_path" obj="$build_path" DOTCONFIG="$build_path/.config" LIBPAYLOAD_DIR="$libpayload_build_install_path/libpayload" VB_SOURCE="$vboot_sources_path" -j$TASKS "depthcharge"
  66. }
  67. build_check() {
  68. project_build_check "$project" "$@"
  69. }
  70. release() {
  71. local repository=$project
  72. project_release_sources_git "$project" "$repository" "$@"
  73. }
  74. release_check() {
  75. local repository=$project
  76. project_release_check_sources_git "$project" "$repository" "$@"
  77. }
  78. clean() {
  79. project_clean "$project" "$@"
  80. }