From 2a24f429dffbc4c928d46e95ffdf3b8fe01a7eab Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 17 Jan 2025 18:43:29 -0800 Subject: Makefile: tidy up clean targets. * Makefile (clean): Do not remove the run.sh file here. That is a temporary file that install-tests should be cleaning away when done, which we can remove in distclean. (clean-doc, clean-tests): New targets, which let us clean up generated documentation files and the test-generated state information in tst. (distclean): Do not remove the documentation stuff here; rely on clean-doc. Also depend on clean-tests. Do remove run.sh here. (install-tests): Add missing .PHONY. Remove run.sh. --- Makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5226fac6..38de7214 100644 --- a/Makefile +++ b/Makefile @@ -358,13 +358,20 @@ clean-c: rm -f y.tab.h.old rm -f $(PROG)-win$(EXE) $(PROG)-win-dbg$(EXE) .build_id rm -rf opt dbg tst - rm -f $(EXTRA_OBJS-y) run.sh + rm -f $(EXTRA_OBJS-y) clean-tlo: rm -f $(STDLIB_TLOS) -distclean: clean - rm -f config.h config.make reconfigure txr-manpage.html txr-manpage.pdf +clean-doc: + rm -f txr-manpage.html txr-manpage.pdf + +clean-tests: + rm -rf tst + +distclean: clean clean-tests clean-doc + rm -f config.h config.make reconfigure run.sh + endif TESTS_OK := $(addprefix tst/,\ @@ -546,6 +553,7 @@ zip: install # # Install the tests as well as the script to run them # +.PHONY: install-tests install-tests: $(call ABBREV3,INSTALL,$(DESTDIR)$(datadir),tests) $(call SH,rm -rf tst) @@ -559,6 +567,7 @@ install-tests: make -s -n tests VERBOSE=y TXR=$(bindir)/txr) \ > run.sh) $(call INSTALL,0755,run.sh,$(DESTDIR)$(datadir)/tests) + $(call SH,rm -rf run.sh) # # Generate web page from man page -- cgit v1.2.3