tmp_ignore_makefiles.sh 942 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. # Temporarily (de)ignore Makefiles generated by CMake to allow easier
  3. # git development
  4. IGNORE=""
  5. # Parse arguments
  6. #
  7. until [ -z "$1" ]
  8. do
  9. case "$1" in
  10. -u|--undo)
  11. IGNORE="0"
  12. ;;
  13. -v|--verbose)
  14. # Be verbose
  15. VERBOSE="1"
  16. ;;
  17. -h|--help)
  18. # print help
  19. echo "Usage: $0"
  20. echo -e " -h|--help\t\tPrint this help."
  21. echo -e " -u|--undo\t\tRemove ignores and continue tracking."
  22. echo -e " -v|--verbose\t\tVerbose."
  23. exit 1
  24. ;;
  25. *)
  26. # print error
  27. echo "Unknown argument: '$1'"
  28. exit 1
  29. ;;
  30. esac
  31. shift
  32. done
  33. if [ "X" = "X$IGNORE" ];
  34. then
  35. [ $VERBOSE ] && echo "Ignoring Makefiles"
  36. git update-index --assume-unchanged Makefile library/Makefile programs/Makefile tests/Makefile
  37. else
  38. [ $VERBOSE ] && echo "Tracking Makefiles"
  39. git update-index --no-assume-unchanged Makefile library/Makefile programs/Makefile tests/Makefile
  40. fi