diff --git a/Makefile b/Makefile index 75355fb..4666695 100644 --- a/Makefile +++ b/Makefile @@ -2,11 +2,14 @@ export DESTDIR ?= /usr/local dirs = src doc conkeror install-dirs = $(addprefix install-,$(dirs)) +uninstall-dirs = $(addprefix uninstall-,$(dirs)) -.PHONY: all $(dirs) +.PHONY: all $(dirs) install $(install-dirs) uninstall $(uninstall-dirs) \ + dvi install-dvi pdf install-pdf ps install-ps all: $(dirs) install: $(install-dirs) +uninstall: $(uninstall-dirs) $(dirs): $(MAKE) -C $@ @@ -14,6 +17,9 @@ $(dirs): $(install-dirs): install-%: $(MAKE) -C $*/ install +$(uninstall-dirs): uninstall-%: + $(MAKE) -C $*/ uninstall + dvi: $(MAKE) -C doc/ dvi diff --git a/conkeror/Makefile b/conkeror/Makefile index 0f9dbb4..25ffd14 100644 --- a/conkeror/Makefile +++ b/conkeror/Makefile @@ -1,8 +1,11 @@ DESTDIR ?= /usr/local -.PHONY: all install +.PHONY: all install uninstall all: install: markam.js install -Dm 655 markam.js \ "$(DESTDIR)/share/conkeror/modules/markam.js" + +uninstall: + rm -f "$(DESTDIR)/share/conkeror/modules/markam.js" diff --git a/doc/Makefile b/doc/Makefile index edb2998..dbea1f8 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,6 +1,7 @@ DESTDIR ?= /usr/local -.PHONY: all html dvi pdf ps +.PHONY: all html dvi pdf ps install uninstall install-dvi install-pdf \ + install-ps all: markam.info @@ -9,6 +10,15 @@ install: markam.info install-info --dir-file="$(DESTDIR)/share/info/dir" \ "$(DESTDIR)/share/info/markam.info" +uninstall: + install-info --dir-file="$(DESTDIR)/share/info/dir" \ + --delete "$(DESTDIR)/share/info/markam.info" + rm -f "$(DESTDIR)/share/info/markam.info" + rm -f "$(DESTDIR)/share/doc/markam/dvi/markam.dvi" + rm -f "$(DESTDIR)/share/doc/markam/pdf/markam.pdf" + rm -f "$(DESTDIR)/share/doc/markam/ps/markam.ps" + rm -rf "$(DESTDIR)/share/doc/markam/html/" + install-dvi: markam.dvi install -Dm 655 markam.dvi \ "$(DESTDIR)/share/doc/markam/dvi/markam.dvi" diff --git a/src/Makefile b/src/Makefile index c181d97..961ad1b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,12 +2,14 @@ DESTDIR ?= /usr/local binaries = markam markam-convert install-binaries = $(addprefix install-,$(binaries)) +uninstall-binaries = $(addprefix uninstall-,$(binaries)) objects = paths.o common.o -.PHONY: all install +.PHONY: all install $(install-binaries) uninstall $(uninstall-binaries) all: $(binaries) install: $(install-binaries) +uninstall: $(uninstall-binaries) markam: markam.scm $(objects) csc $^ -o $@ @@ -18,5 +20,8 @@ markam-convert: markam-convert.scm $(objects) $(install-binaries): install-%: % install -Dm 755 $* "$(DESTDIR)/bin/$*" +$(uninstall-binaries): uninstall-%: + rm -f "$(DESTDIR)/bin/$*" + $(objects): %.o: %.scm csc -c $^