Add uninstall target

Removes all files from their installed locations.
This commit is contained in:
Tom Willemsen 2013-01-06 15:30:50 +01:00
parent 759b8b0cf9
commit e2999eed45
4 changed files with 28 additions and 4 deletions

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -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 $^