From 7793ddf23c4bc3ca3dcbe7c4e786426815f35b2b Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 19 Apr 2022 16:00:09 -0400 Subject: Makefile: Replace flags.sh with a two-line recipe --- Makefile | 3 ++- flags.sh | 14 -------------- 2 files changed, 2 insertions(+), 15 deletions(-) delete mode 100755 flags.sh diff --git a/Makefile b/Makefile index acc5cbf..a24fa72 100644 --- a/Makefile +++ b/Makefile @@ -243,7 +243,8 @@ build/tests/%.o: tests/%.c build/FLAGS | build/tests # Save the full set of flags to rebuild everything when they change build/FLAGS: FORCE | build - @./flags.sh $@ $(CC) : $(ALL_CFLAGS) : $(ALL_LDFLAGS) : $(ALL_LDLIBS) + @echo $(CC) : $(ALL_CFLAGS) : $(ALL_LDFLAGS) : $(ALL_LDLIBS) >$@.tmp + @test -e $@ && cmp -s $@ $@.tmp && rm $@.tmp || mv $@.tmp $@ .PHONY: FORCE # Make sure that "make release" builds everything, but "make release build/main.o" doesn't diff --git a/flags.sh b/flags.sh deleted file mode 100755 index 5711a18..0000000 --- a/flags.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -set -eu - -OUT="$1" -shift - -echo "$@" >"$OUT.tmp" - -if [ -e "$OUT" ] && cmp -s "$OUT" "$OUT.tmp"; then - rm "$OUT.tmp" -else - mv "$OUT.tmp" "$OUT" -fi -- cgit v1.2.3