From 1dab7b2285356e2b5268642c5d242104f8e5c21b Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Tue, 27 Feb 2024 22:50:19 -0800 Subject: [PATCH 1/2] Don't ignore the return value from `rm -rf` The `-f` option causes `rm` to silently ignore files that don't exist, so `rm -rf` will only fail if `rm` has trouble deleting a file that exists. We want `make` to fail in that situation. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f600179..256bbcf 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ uninstall: $(DESTDIR)$(PREFIX)/bin/keyd-usb-gadget.sh \ $(DESTDIR)$(PREFIX)/lib/systemd/system/keyd.service clean: - -rm -rf bin keyd.service src/vkbd/usb-gadget.service + rm -rf bin keyd.service src/vkbd/usb-gadget.service test: @cd t; \ for f in *.sh; do \ From 33c38a76fe57806c57c85fc9d7ddc6a6ad195fc9 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Fri, 5 Jan 2024 16:02:55 -0500 Subject: [PATCH 2/2] Use `mkdir -p` instead of ignoring return code We want `make` to fail if the directory doesn't exist and can't be made for some reason. --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 256bbcf..1e4e9ca 100644 --- a/Makefile +++ b/Makefile @@ -32,13 +32,13 @@ else endif all: - -mkdir bin + mkdir -p bin cp scripts/keyd-application-mapper bin/ $(CC) $(CFLAGS) -O3 $(COMPAT_FILES) src/*.c src/vkbd/$(VKBD).c -lpthread -o bin/keyd $(LDFLAGS) debug: CFLAGS="-g -fsanitize=address -Wunused" $(MAKE) compose: - -mkdir data + mkdir -p data ./scripts/generate_xcompose man: for f in docs/*.scdoc; do \ @@ -98,7 +98,7 @@ test: ./$$f; \ done test-io: - -mkdir bin + mkdir -p bin $(CC) \ -DDATA_DIR= \ -o bin/test-io \