tmp_ignore_makefiles.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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
  7. #
  8. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  9. # not use this file except in compliance with the License.
  10. # You may obtain a copy of the License at
  11. #
  12. # http://www.apache.org/licenses/LICENSE-2.0
  13. #
  14. # Unless required by applicable law or agreed to in writing, software
  15. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  16. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. # See the License for the specific language governing permissions and
  18. # limitations under the License.
  19. IGNORE=""
  20. # Parse arguments
  21. #
  22. until [ -z "$1" ]
  23. do
  24. case "$1" in
  25. -u|--undo)
  26. IGNORE="0"
  27. ;;
  28. -v|--verbose)
  29. # Be verbose
  30. VERBOSE="1"
  31. ;;
  32. -h|--help)
  33. # print help
  34. echo "Usage: $0"
  35. echo -e " -h|--help\t\tPrint this help."
  36. echo -e " -u|--undo\t\tRemove ignores and continue tracking."
  37. echo -e " -v|--verbose\t\tVerbose."
  38. exit 1
  39. ;;
  40. *)
  41. # print error
  42. echo "Unknown argument: '$1'"
  43. exit 1
  44. ;;
  45. esac
  46. shift
  47. done
  48. if [ "X" = "X$IGNORE" ];
  49. then
  50. [ $VERBOSE ] && echo "Ignoring Makefiles"
  51. git update-index --assume-unchanged Makefile library/Makefile programs/Makefile tests/Makefile
  52. else
  53. [ $VERBOSE ] && echo "Tracking Makefiles"
  54. git update-index --no-assume-unchanged Makefile library/Makefile programs/Makefile tests/Makefile
  55. fi