mosys 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. usage() {
  17. project_usage_actions "$project"
  18. }
  19. dependencies() {
  20. project_dependencies "$project" "$@"
  21. }
  22. dependencies_check() {
  23. project_dependencies_check "$project" "$@"
  24. }
  25. download() {
  26. local repository=$project
  27. project_download_git "$project" "$repository" "https://chromium.googlesource.com/chromiumos/platform/mosys" "$@"
  28. }
  29. download_check() {
  30. local repository=$project
  31. project_download_check_git "$project" "$repository" "$@"
  32. }
  33. extract() {
  34. local repository=$project
  35. project_extract "$project" "$@"
  36. }
  37. extract_check() {
  38. local repository=$project
  39. project_extract_check "$project" "$@"
  40. }
  41. update() {
  42. local repository=$project
  43. project_update_git "$project" "$repository" "$@"
  44. }
  45. update_check() {
  46. local repository=$project
  47. project_update_check_git "$project" "$repository" "$@"
  48. }
  49. build() {
  50. local repository=$project
  51. project_sources_directory_missing_empty_error "$project" "$repository" "$@"
  52. local sources_path=$(project_sources_path "$project" "$repository" "$@")
  53. local build_path=$(project_build_path "$project" "$@")
  54. local flashmap_build_path=$(project_build_path "flashmap" "$@")
  55. if git_project_check "$repository"
  56. then
  57. git_project_checkout "$project" "$repository" "$@"
  58. fi
  59. mkdir -p "$build_path"
  60. make -C "$sources_path" objtree="$build_path" "defconfig"
  61. make -C "$sources_path" objtree="$build_path" EXTRA_CFLAGS="-I $flashmap_build_path/lib" FMAP_LINKOPT="-I $flashmap_build_path/lib -L $flashmap_build_path/lib -lfmap" -j$TASKS
  62. cp "$sources_path/mosys" "$build_path"
  63. make -C "$sources_path" "clean"
  64. }
  65. build_check() {
  66. project_build_check "$project" "$@"
  67. }
  68. install() {
  69. project_install "$project" "$@"
  70. }
  71. install_check() {
  72. project_install_check "$project" "$@"
  73. }
  74. release() {
  75. local repository=$project
  76. project_release_install_archive "$project" "$TOOLS" "$@"
  77. project_release_sources_git "$project" "$repository" "$@"
  78. }
  79. release_check() {
  80. local repository=$project
  81. project_release_install_archive_check "$project" "$TOOLS" "$@"
  82. project_release_check_sources_git "$project" "$repository" "$@"
  83. }
  84. clean() {
  85. project_clean "$project" "$@"
  86. }