seabios 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. usage() {
  20. project_usage_actions "$project"
  21. project_usage_arguments "$project" "$@"
  22. }
  23. download() {
  24. local repository="$project"
  25. project_download_git "$project" "$repository" 'https://git.seabios.org/seabios.git' "$@" || \
  26. project_download_git "$project" "$repository" 'https://review.coreboot.org/cgit/seabios.git/' "$@"
  27. }
  28. download_check() {
  29. local repository="$project"
  30. project_download_check_git "$project" "$repository" "$@"
  31. }
  32. extract() {
  33. project_extract "$project" "$@"
  34. }
  35. extract_check() {
  36. project_extract_check "$project" "$@"
  37. }
  38. update() {
  39. local repository="$project"
  40. project_update_git "$project" "$repository" "$@"
  41. }
  42. update_check() {
  43. local repository="$project"
  44. project_update_check_git "$project" "$repository" "$@"
  45. }
  46. build() {
  47. local target="$1"
  48. local repository="$project"
  49. project_sources_directory_missing_empty_error "$project" "$repository" "$@"
  50. if git_project_check "$repository"; then
  51. git_project_checkout "$project" "$repository" "$@"
  52. fi
  53. local project_path="$(project_path "$project")"
  54. local seabios_config_path="$(project_file_path "$project" "$CONFIGS" 'config' "$@")"
  55. local sources_path="$(project_sources_path "$project" "$repository" "$@")"
  56. local build_path="$(project_build_path "$project" "$@")"
  57. mkdir -p "$build_path"
  58. cp "$seabios_config_path" "$sources_path/.config"
  59. make -C "$sources_path" OUT="$build_path/" -j"$TASKS"
  60. make -C "$sources_path" distclean
  61. rm -f "$sources_path/.config"
  62. }
  63. build_check() {
  64. project_build_check "$project" "$@"
  65. }
  66. install() {
  67. project_install "$project" "$@"
  68. }
  69. install_check() {
  70. project_install_check "$project" "$@"
  71. }
  72. release() {
  73. local repository="$project"
  74. project_release_install_archive "$project" "$IMAGES" "$@"
  75. project_release_sources_git "$project" "$repository" "$@"
  76. }
  77. release_check() {
  78. local repository="$project"
  79. project_release_install_archive_check "$project" "$IMAGES" "$@"
  80. project_release_check_sources_git "$project" "$repository" "$@"
  81. }
  82. clean() {
  83. project_clean "$project" "$@"
  84. }