From: Andre Noll Date: Thu, 9 May 2024 13:20:25 +0000 (+0200) Subject: Add phony targets distclean and maintainer-clean. X-Git-Tag: v1.0.2~5 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=e856f6af53b827c183dbabd0e17d4e7e466e41a0;p=dss.git Add phony targets distclean and maintainer-clean. With the patch applied, "make clean" keeps files generated by lopsub and m4, "make distclean" removes the build directory, and "make maintainer-clean" removes all untracked files except Makefile.local. --- diff --git a/Makefile b/Makefile index c06fdec..462aba7 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,7 @@ RM := rm -f LSG := lopsubgen GROFF := groff -m man -Thtml -P -l -P -r GZIP := gzip -cfn9 +GIT := git M4 := m4 \ -D "AUTHOR=$(AUTHOR)" \ -D "PACKAGE=$(PACKAGE)" \ @@ -114,7 +115,7 @@ $(B)/%.o: %.c $(call SAY, CC $<) $(CC_CMD) -.PHONY: all www clean install README +.PHONY: all www clean distclean maintainer-clean install README .PRECIOUS: $(B)/%.lsg.c $(B)/%.lsg.h $(B)/%.suite $(B)/%.1 $(B)/$(PACKAGE).suite: $(PACKAGE).suite.m4 Makefile $(call SAY, M4 $<) @@ -139,7 +140,13 @@ $(B)/index.html: index.html.m4 Makefile $(M4) $< > $@ clean: $(call SAY, CLEAN) - $(RM) -r $(B) $(all) + $(RM) $(B)/*.o $(B)/*.d $(all) $(www) +distclean: clean + $(call SAY, DISTCLEAN) + $(RM) -r $(B) +maintainer-clean: distclean + $(call SAY, MAINTANER-CLEAN) + $(GIT) clean -dfqxe Makefile.local ifneq ($(findstring strip, $(MAKECMDGOALS)),) strip_option := -s