From 58a7c046d22579cc5156fb34429e5ea7ea5a5526 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 6 Jan 2013 14:36:51 +0100 Subject: [PATCH] Add install target to Makefile Installs everything under `DESTDIR', which is `/usr/local' by default. --- Makefile | 10 +++++++++- conkeror/Makefile | 8 ++++++++ doc/Makefile | 8 ++++++++ doc/markam.texi | 5 +++++ src/Makefile | 13 +++++++++++-- 5 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 conkeror/Makefile diff --git a/Makefile b/Makefile index e796ed8..ebe51e9 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,15 @@ -dirs = src doc +export DESTDIR ?= /usr/local + +dirs = src doc conkeror +install-dirs = $(addprefix install-,$(dirs)) .PHONY: all $(dirs) all: $(dirs) +install: $(install-dirs) + $(dirs): $(MAKE) -C $@ + +$(install-dirs): install-%: + $(MAKE) -C $*/ install diff --git a/conkeror/Makefile b/conkeror/Makefile new file mode 100644 index 0000000..0f9dbb4 --- /dev/null +++ b/conkeror/Makefile @@ -0,0 +1,8 @@ +DESTDIR ?= /usr/local + +.PHONY: all install + +all: +install: markam.js + install -Dm 655 markam.js \ + "$(DESTDIR)/share/conkeror/modules/markam.js" diff --git a/doc/Makefile b/doc/Makefile index 29d7269..7e798bf 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,4 +1,12 @@ +DESTDIR ?= /usr/local + .PHONY: all all: markam.info + +install: markam.info + install -Dm 655 markam.info "$(DESTDIR)/share/info/markam.info" + install-info --dir-file="$(DESTDIR)/share/info/dir" \ + "$(DESTDIR)/share/info/markam.info" + markam.info: markam.texi diff --git a/doc/markam.texi b/doc/markam.texi index 7687705..1f22b48 100644 --- a/doc/markam.texi +++ b/doc/markam.texi @@ -35,6 +35,11 @@ The document was typeset with @insertcopying @end titlepage +@dircategory Individual utilities +@direntry +* Markam: (markam). Keeps bookmarks. +@end direntry + @c Output the table of the contents at the beginning. @contents diff --git a/src/Makefile b/src/Makefile index d3882e3..c181d97 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,13 +1,22 @@ +DESTDIR ?= /usr/local + +binaries = markam markam-convert +install-binaries = $(addprefix install-,$(binaries)) objects = paths.o common.o -.PHONY: all +.PHONY: all install + +all: $(binaries) +install: $(install-binaries) -all: markam markam-convert markam: markam.scm $(objects) csc $^ -o $@ markam-convert: markam-convert.scm $(objects) csc $^ -o $@ +$(install-binaries): install-%: % + install -Dm 755 $* "$(DESTDIR)/bin/$*" + $(objects): %.o: %.scm csc -c $^