>From b8c4f07d4d4906f2b1bca16072d2677a5f337084 Mon Sep 17 00:00:00 2001 From: Mario Domenech Goulart Date: Thu, 8 Jul 2021 23:49:53 +0200 Subject: [PATCH] Make "make clean" also remove build configuration files The fact that "make clean" doesn't remove build configuration files (e.g., chicken-config.h) is a recurrent source of tricky-to-debug installation issues, specially for newcomers. This change: * makes `clean' remove build configuration files. * removes the `distclean' target (now `clean' does what `distclean' used to do). Ticket: #1755 --- NEWS | 3 +++ rules.make | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 899ddb2f..43ed13b2 100644 --- a/NEWS +++ b/NEWS @@ -76,6 +76,9 @@ still requires PLATFORM to be set, and it can still be provided manually, but it is no longer required in the common case. - Fix Linux to MingW cross-compilation (#1768, thanks to Théo Cavignac) + - The `clean' target for make now also removes build configuration files. + - The `distclean' target for make has been removed (now `clean' does what + `distclean' used to do). - Tools - Fixed a bug in chicken-install (#1744) that would cause diff --git a/rules.make b/rules.make index 83ab53cf..eba0dcde 100644 --- a/rules.make +++ b/rules.make @@ -952,7 +952,9 @@ html: # cleaning up -.PHONY: clean distclean spotless confclean testclean +.PHONY: clean spotless confclean testclean + +BUILD_CONFIG_FILES = chicken-config.h chicken-defaults.h chicken-install.rc chicken-uninstall.rc clean: -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(EXE) $(PROGRAM_PREFIX)csi$(PROGRAM_SUFFIX)$(EXE) $(PROGRAM_PREFIX)csc$(PROGRAM_SUFFIX)$(EXE) \ @@ -967,21 +969,19 @@ clean: $(PRIMARY_LIBCHICKEN) \ lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(A) \ $(IMPORT_LIBRARIES:=.import.so) $(LIBCHICKEN_IMPORT_LIBRARY) \ - $(foreach lib,$(DYNAMIC_IMPORT_LIBRARIES),chicken.$(lib).import.scm) + $(foreach lib,$(DYNAMIC_IMPORT_LIBRARIES),chicken.$(lib).import.scm) \ + $(BUILD_CONFIG_FILES) ifdef USES_SONAME -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX).so.$(BINARYVERSION) endif confclean: - -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) \ - chicken-config.h chicken-defaults.h chicken-install.rc chicken-uninstall.rc + -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(BUILD_CONFIG_FILES) -spotless: distclean testclean +spotless: clean testclean -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DISTFILES) \ buildid buildbranch -distclean: clean confclean - testclean: -$(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) \ $(SRCDIR)tests$(SEP)*.dll \ -- 2.20.1