cros-ec 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. dependencies_check() {
  23. project_dependencies_check "$project" "$@"
  24. }
  25. usage() {
  26. project_usage_actions "$project"
  27. project_usage_arguments "$project" "$@"
  28. }
  29. download() {
  30. local repository=$project
  31. project_download_git "$project" "$repository" "https://chromium.googlesource.com/chromiumos/platform/ec https://review.coreboot.org/chrome-ec.git https://github.com/coreboot/chrome-ec.git" "$@"
  32. }
  33. download_check() {
  34. local repository=$project
  35. project_download_check_git "$project" "$repository" "$@"
  36. }
  37. extract() {
  38. project_extract "$project" "$@"
  39. }
  40. extract_check() {
  41. project_extract_check "$project" "$@"
  42. }
  43. update() {
  44. local repository=$project
  45. project_update_git "$project" "$repository" "$@"
  46. }
  47. update_check() {
  48. local repository=$project
  49. project_update_check_git "$project" "$repository" "$@"
  50. }
  51. build() {
  52. local target=$1
  53. local repository=$project
  54. project_sources_directory_missing_empty_error "$project" "$repository" "$@"
  55. local sources_path=$(project_sources_path "$project" "$repository" "$@")
  56. local build_path=$(project_build_path "$project" "$@")
  57. if git_project_check "$repository"
  58. then
  59. git_project_checkout "$project" "$repository" "$@"
  60. fi
  61. mkdir -p "$build_path"
  62. if [[ "$target" = "tools" ]]
  63. then
  64. make -C "$sources_path" out="$build_path" HOST_CROSS_COMPILE= -j$TASKS "utils"
  65. else
  66. local arch="arm"
  67. local config=$(cros_ec_config "$@")
  68. local crossgcc_bin_prefix=$(project_action_arguments "prefix" "crossgcc" "$arch")
  69. make -C "$sources_path" out="$build_path" CROSS_COMPILE="$crossgcc_bin_prefix" HOST_CROSS_COMPILE= BOARD="$config" -j$TASKS
  70. fi
  71. }
  72. build_check() {
  73. project_build_check "$project" "$@"
  74. }
  75. install() {
  76. project_install "$project" "$@"
  77. }
  78. install_check() {
  79. project_install_check "$project" "$@"
  80. }
  81. release() {
  82. local target=$1
  83. local repository=$project
  84. if [[ "$target" = "tools" ]]
  85. then
  86. project_release_install_archive "$project" "$TOOLS" "$@"
  87. else
  88. project_release_install_archive "$project" "$IMAGES" "$@"
  89. fi
  90. project_release_sources_git "$project" "$repository" "$@"
  91. }
  92. release_check() {
  93. local target=$1
  94. local repository=$project
  95. if [[ "$target" = "tools" ]]
  96. then
  97. project_release_install_archive_check "$project" "$TOOLS" "$@"
  98. else
  99. project_release_install_archive_check "$project" "$IMAGES" "$@"
  100. fi
  101. project_release_check_sources_git "$project" "$repository" "$@"
  102. }
  103. clean() {
  104. project_clean "$project" "$@"
  105. }