summaryrefslogtreecommitdiff
path: root/scripts/tmp_ignore_makefiles.sh
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-10-08 13:56:50 -0600
committerTom Rini <trini@konsulko.com>2024-10-08 13:56:50 -0600
commit0344c602eadc0802776b65ff90f0a02c856cf53c (patch)
tree236a705740939b84ff37d68ae650061dd14c3449 /scripts/tmp_ignore_makefiles.sh
Squashed 'lib/mbedtls/external/mbedtls/' content from commit 2ca6c285a0dd
git-subtree-dir: lib/mbedtls/external/mbedtls git-subtree-split: 2ca6c285a0dd3f33982dd57299012dacab1ff206
Diffstat (limited to 'scripts/tmp_ignore_makefiles.sh')
-rwxr-xr-xscripts/tmp_ignore_makefiles.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/scripts/tmp_ignore_makefiles.sh b/scripts/tmp_ignore_makefiles.sh
new file mode 100755
index 00000000000..455f892a214
--- /dev/null
+++ b/scripts/tmp_ignore_makefiles.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+# Temporarily (de)ignore Makefiles generated by CMake to allow easier
+# git development
+#
+# Copyright The Mbed TLS Contributors
+# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
+
+IGNORE=""
+
+# Parse arguments
+#
+until [ -z "$1" ]
+do
+ case "$1" in
+ -u|--undo)
+ IGNORE="0"
+ ;;
+ -v|--verbose)
+ # Be verbose
+ VERBOSE="1"
+ ;;
+ -h|--help)
+ # print help
+ echo "Usage: $0"
+ echo -e " -h|--help\t\tPrint this help."
+ echo -e " -u|--undo\t\tRemove ignores and continue tracking."
+ echo -e " -v|--verbose\t\tVerbose."
+ exit 1
+ ;;
+ *)
+ # print error
+ echo "Unknown argument: '$1'"
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+if [ "X" = "X$IGNORE" ];
+then
+ [ $VERBOSE ] && echo "Ignoring Makefiles"
+ git update-index --assume-unchanged Makefile library/Makefile programs/Makefile tests/Makefile
+else
+ [ $VERBOSE ] && echo "Tracking Makefiles"
+ git update-index --no-assume-unchanged Makefile library/Makefile programs/Makefile tests/Makefile
+fi