changeset 2233:3840cefa5222

Added install target.
author wilde@trapperkeeper.sha-bang.de
date Tue, 09 May 2006 17:05:49 +0200
parents ef3c039e7ab8
children 9ea93ff67a73
files Makefile doc/Makefile
diffstat 2 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Tue May 09 17:03:00 2006 +0200
+++ b/Makefile	Tue May 09 17:05:49 2006 +0200
@@ -1,11 +1,13 @@
-# This Makefile is only used by developers.
+PREFIX=/usr/local
+export PREFIX
 PYTHON=python
 
 all:
 	$(PYTHON) setup.py build_ext -i
 
-install:
-	@echo "Read the file README for install instructions."
+install: all
+	$(PYTHON) setup.py install --home="$(PREFIX)"
+	cd doc && $(MAKE) $(MFLAGS) install
 
 clean:
 	-$(PYTHON) setup.py clean --all # ignore errors of this command
--- a/doc/Makefile	Tue May 09 17:03:00 2006 +0200
+++ b/doc/Makefile	Tue May 09 17:05:49 2006 +0200
@@ -1,6 +1,9 @@
 SOURCES=$(wildcard *.[0-9].txt)
 MAN=$(SOURCES:%.txt=%)
 HTML=$(SOURCES:%.txt=%.html)
+PREFIX=/usr/local
+MANDIR=$(PREFIX)/man
+INSTALL=install -c
 
 all: man html
 
@@ -23,5 +26,12 @@
 %.html: %.txt
 	asciidoc -b html4 $*.txt || asciidoc -b html $*.txt
 
+install: man
+	for i in $(MAN) ; do \
+	  subdir=`echo $$i | sed -n 's/.\+\(\.[0-9]\)$$/man\1/p'` ; \
+	  mkdir -p $(MANDIR)/$$subdir ; \
+	  $(INSTALL) $$i $(MANDIR)/$$subdir ; \
+	done
+
 clean:
 	$(RM) $(MAN) $(MAN:%=%.xml) $(MAN:%=%.html) *.[0-9].gendoc.txt