summaryrefslogtreecommitdiffstats
path: root/flags.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-10-28 10:01:30 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-12-10 15:37:15 -0500
commit986a206965da3f5bf6fd11d3285b5e19b6e066d1 (patch)
tree031c2521994218ebd2f9a2b52e7b37fdfba4f320 /flags.sh
parent5920a1b5e19e529ab3a3972348a6d53bcd90acfc (diff)
downloadbfs-986a206965da3f5bf6fd11d3285b5e19b6e066d1.tar.xz
Makefile: Rebuild whenever the build flags change
This removes the need to do make clean before rebuilding with a new build type.
Diffstat (limited to 'flags.sh')
-rwxr-xr-xflags.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/flags.sh b/flags.sh
new file mode 100755
index 0000000..8180eb4
--- /dev/null
+++ b/flags.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e
+
+echo "$@" >.newflags
+
+if [ -e .flags ] && cmp -s .flags .newflags; then
+ rm .newflags
+else
+ mv .newflags .flags
+fi