From b7fa93f6b7ab5d562e0985eb06bdac8ba12ad892 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Tue, 22 Oct 2024 09:14:29 -0600 Subject: [PATCH] Use make's builtin RM variable At least as far as removing individual files goes, this is the best pattern for removing. I can't say the same for removing directories, but I went ahead and changed those to `$(RM) -r` anyway. Signed-off-by: Tristan Partin --- Makefile | 4 ++-- compute/Makefile | 2 +- pgxn/neon/Makefile | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 33cfda2661..8e3b755112 100644 --- a/Makefile +++ b/Makefile @@ -297,7 +297,7 @@ clean: postgres-clean neon-pg-clean-ext # This removes everything .PHONY: distclean distclean: - rm -rf $(POSTGRES_INSTALL_DIR) + $(RM) -r $(POSTGRES_INSTALL_DIR) $(CARGO_CMD_PREFIX) cargo clean .PHONY: fmt @@ -329,7 +329,7 @@ postgres-%-pgindent: postgres-%-pg-bsd-indent postgres-%-typedefs.list $(ROOT_PROJECT_DIR)/vendor/postgres-$*/src/tools/pgindent/pgindent --typedefs postgres-$*-typedefs-full.list \ $(ROOT_PROJECT_DIR)/vendor/postgres-$*/src/ \ --excludes $(ROOT_PROJECT_DIR)/vendor/postgres-$*/src/tools/pgindent/exclude_file_patterns - rm -f pg*.BAK + $(RM) pg*.BAK # Indent pxgn/neon. .PHONY: neon-pgindent diff --git a/compute/Makefile b/compute/Makefile index 08e3c7a68b..645880ce70 100644 --- a/compute/Makefile +++ b/compute/Makefile @@ -34,7 +34,7 @@ sql_exporter_autoscaling.yml: $(jsonnet_files) .PHONY: clean clean: - rm -f \ + $(RM) \ etc/neon_collector.yml \ etc/neon_collector_autoscaling.yml \ etc/sql_exporter.yml \ diff --git a/pgxn/neon/Makefile b/pgxn/neon/Makefile index f1229b2d73..1503b856f7 100644 --- a/pgxn/neon/Makefile +++ b/pgxn/neon/Makefile @@ -54,7 +54,7 @@ walproposer-lib: libwalproposer.a; .PHONY: libwalproposer.a libwalproposer.a: $(WALPROP_OBJS) - rm -f $@ + $(RM) $@ $(AR) $(AROPT) $@ $^ # needs vars: