tmp_ignore_makefiles.sh 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/bin/bash
  2. # Temporarily (de)ignore Makefiles generated by CMake to allow easier
  3. # git development
  4. #
  5. # Copyright The Mbed TLS Contributors
  6. # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
  7. #
  8. # This file is provided under the Apache License 2.0, or the
  9. # GNU General Public License v2.0 or later.
  10. #
  11. # **********
  12. # Apache License 2.0:
  13. #
  14. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  15. # not use this file except in compliance with the License.
  16. # You may obtain a copy of the License at
  17. #
  18. # http://www.apache.org/licenses/LICENSE-2.0
  19. #
  20. # Unless required by applicable law or agreed to in writing, software
  21. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  22. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. # See the License for the specific language governing permissions and
  24. # limitations under the License.
  25. #
  26. # **********
  27. #
  28. # **********
  29. # GNU General Public License v2.0 or later:
  30. #
  31. # This program is free software; you can redistribute it and/or modify
  32. # it under the terms of the GNU General Public License as published by
  33. # the Free Software Foundation; either version 2 of the License, or
  34. # (at your option) any later version.
  35. #
  36. # This program is distributed in the hope that it will be useful,
  37. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  38. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  39. # GNU General Public License for more details.
  40. #
  41. # You should have received a copy of the GNU General Public License along
  42. # with this program; if not, write to the Free Software Foundation, Inc.,
  43. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  44. #
  45. # **********
  46. IGNORE=""
  47. # Parse arguments
  48. #
  49. until [ -z "$1" ]
  50. do
  51. case "$1" in
  52. -u|--undo)
  53. IGNORE="0"
  54. ;;
  55. -v|--verbose)
  56. # Be verbose
  57. VERBOSE="1"
  58. ;;
  59. -h|--help)
  60. # print help
  61. echo "Usage: $0"
  62. echo -e " -h|--help\t\tPrint this help."
  63. echo -e " -u|--undo\t\tRemove ignores and continue tracking."
  64. echo -e " -v|--verbose\t\tVerbose."
  65. exit 1
  66. ;;
  67. *)
  68. # print error
  69. echo "Unknown argument: '$1'"
  70. exit 1
  71. ;;
  72. esac
  73. shift
  74. done
  75. if [ "X" = "X$IGNORE" ];
  76. then
  77. [ $VERBOSE ] && echo "Ignoring Makefiles"
  78. git update-index --assume-unchanged Makefile library/Makefile programs/Makefile tests/Makefile
  79. else
  80. [ $VERBOSE ] && echo "Tracking Makefiles"
  81. git update-index --no-assume-unchanged Makefile library/Makefile programs/Makefile tests/Makefile
  82. fi