From e027f3c7e6db96535e2515d6e65389a5079e0a82 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 27 May 2013 22:40:28 +0200 Subject: [PATCH] Add clean make target --- Makefile | 8 +++++++- doc/Makefile | 8 +++++++- gitto/Makefile | 6 +++++- src/Makefile | 5 ++++- zsh/Makefile | 4 +++- 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 0b51b8d..8bab8ce 100644 --- a/Makefile +++ b/Makefile @@ -7,12 +7,15 @@ export INSTALL_DATA = $(INSTALL) -m 644 dirs = doc src gitto zsh install-dirs = $(addprefix install-,$(dirs)) uninstall-dirs = $(addprefix uninstall-,$(dirs)) +clean-dirs = $(addprefix clean-,$(dirs)) -.PHONY: all $(dirs) install $(install-dirs) uninstall $(uninstall-dirs) +.PHONY: all $(dirs) install $(install-dirs) uninstall $(uninstall-dirs) \ + clean $(clean-dirs) all: $(dirs) install: $(install-dirs) uninstall: $(uninstall-dirs) +clean: $(clean-dirs) $(dirs): $(MAKE) -C $@/ @@ -22,3 +25,6 @@ $(install-dirs): install-%: $(uninstall-dirs): uninstall-%: $(MAKE) -C $*/ uninstall + +$(clean-dirs): clean-%: + $(MAKE) -C $*/ clean diff --git a/doc/Makefile b/doc/Makefile index 0e3f42c..c49e71d 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -4,7 +4,7 @@ TEXI2PDF = texi2pdf DVIPS = dvips .PHONY: all html dvi pdf ps install uninstall install-dvi install-pdf \ - install-ps + install-ps clean all: gitto.info @@ -51,3 +51,9 @@ gitto.pdf: gitto.texi gitto.ps: gitto.dvi $(DVIPS) gitto.dvi + +clean: + rm -f gitto.aux gitto.cp gitto.dvi gitto.fn gitto.fns gitto.info \ + gitto.ky gitto.log gitto.pdf gitto.pg gitto.ps gitto.toc \ + gitto.tp gitto.vr gitto.vrs + rm -rf html/ diff --git a/gitto/Makefile b/gitto/Makefile index 85657f4..ba060fc 100644 --- a/gitto/Makefile +++ b/gitto/Makefile @@ -8,7 +8,8 @@ objects = config.scm config.go git.scm git.go ui.scm ui.go main.scm \ install-objects = $(addprefix install-,$(objects)) uninstall-objects = $(addprefix uninstall-,$(objects)) -.PHONY: all install $(install-objects) uninstall $(uninstall-objects) +.PHONY: all install $(install-objects) uninstall $(uninstall-objects) \ + clean all: $(filter %.go,$(objects)) @@ -29,3 +30,6 @@ $(filter %.go,$(uninstall-objects)): uninstall-%: $(filter %.scm,$(uninstall-objects)): uninstall-%: rm -f "$(SITEDIR)/gitto/$*" + +clean: + rm -f *.go diff --git a/src/Makefile b/src/Makefile index 50ed2e4..668d440 100644 --- a/src/Makefile +++ b/src/Makefile @@ -8,7 +8,7 @@ objects = gitto-path.o all: libguile-gitto-path.so -.PHONY: install uninstall +.PHONY: install uninstall clean %.x: %.c guile-snarf -o $@ $< $(CFLAGS) @@ -26,3 +26,6 @@ install: install-gitto install-libguile-gitto-path uninstall: rm -f ${DESTDIR}/bin/gitto rm -f ${EXTDIR}/libguile-gitto-path.so + +clean: + rm -f *.o *.x *.so diff --git a/zsh/Makefile b/zsh/Makefile index 0c3a2c0..a7dd06c 100644 --- a/zsh/Makefile +++ b/zsh/Makefile @@ -1,6 +1,6 @@ DESTDIR ?= /usr/local -.PHONY: all install uninstall +.PHONY: all install uninstall clean all: @@ -9,3 +9,5 @@ install: uninstall: rm -f $(DESTDIR)/share/zsh/site-functions/_gitto + +clean: