ich9gen 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. extract() {
  24. local repository="$project"
  25. project_extract "$project" "$@"
  26. }
  27. extract_check() {
  28. local repository="$project"
  29. project_extract_check "$project" "$@"
  30. }
  31. update() {
  32. local repository="$project"
  33. project_update_git "$project" "$repository" "$@"
  34. }
  35. update_check() {
  36. local repository="$project"
  37. project_update_check_git "$project" "$repository" "$@"
  38. }
  39. build() {
  40. local repository="$project"
  41. project_sources_directory_missing_empty_error "$project" "$repository" "$@"
  42. if git_project_check "$repository"; then
  43. git_project_checkout "$project" "$repository" "$@"
  44. fi
  45. local sources_path="$(project_sources_path "$project" "$repository" "$@")"
  46. local build_path="$(project_build_path "$project" "$@")"
  47. mkdir -p "$build_path"
  48. make -C "$sources_path" -j"$TASKS" ich9gen
  49. (
  50. local macaddress="$(ich9gen_macaddress)"
  51. cd "$build_path"
  52. if [[ -n $macaddress ]]; then
  53. "$sources_path"/ich9gen --macaddress "$macaddress"
  54. else
  55. "$sources_path"/ich9gen
  56. fi
  57. )
  58. cp "$sources_path/ich9gen" "$build_path"
  59. make -C "$sources_path" clean
  60. }
  61. build_check() {
  62. project_build_check "$project" "$@"
  63. }
  64. install() {
  65. project_install "$project" "$@"
  66. }
  67. install_check() {
  68. project_install_check "$project" "$@"
  69. }
  70. release() {
  71. project_release_install_archive "$project" "$TOOLS" "$@"
  72. project_release_sources_archive_create "$project" "$@"
  73. }
  74. release_check() {
  75. project_release_install_archive_check "$project" "$TOOLS" "$@"
  76. project_release_sources_archive_exists_check "$project" "$@"
  77. }
  78. clean() {
  79. project_clean "$project" "$@"
  80. }