From a4d3c848ea94d230b53b5923a69a6de879e09a13 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 2 Jun 2004 19:40:49 +0000 Subject: [PATCH] rjk's `make install' patch. git-svn-id: svn://svn.tartarus.org/sgt/halibut@4267 cda61777-01e9-0310-a592-d414129be87e --- Makefile | 15 ++++++++++++--- doc/Makefile | 6 ++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 719e9b4..fd6f932 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,11 @@ # - the Makefile uses GNU ifdef / ifndef commands and GNU make `%' # pattern rules +prefix=/usr/local +exec_prefix=$(prefix) +bindir=$(exec_prefix)/bin +INSTALL=install -c + ifdef RELEASE ifndef VERSION VERSION := $(RELEASE) @@ -35,9 +40,9 @@ BUILDDIR := build endif endif -all: +all install: @test -d $(BUILDDIR) || mkdir $(BUILDDIR) - @make -C $(BUILDDIR) -f ../Makefile REALBUILD=yes + @make -C $(BUILDDIR) -f ../Makefile $@ REALBUILD=yes spotless: topclean @test -d $(BUILDDIR) || mkdir $(BUILDDIR) @@ -96,7 +101,7 @@ else VDEF = `(cd $(SRC); md5sum -c manifest && cat version)` endif -halibut: +all: halibut SRC := ../ @@ -131,6 +136,10 @@ spotless:: clean clean:: rm -f *.o halibut core +install: + $(INSTALL) -m 755 halibut $(bindir)/halibut + $(MAKE) -C ../doc install prefix="$(prefix)" INSTALL="$(INSTALL)" + FORCE: # phony target to force version.o to be rebuilt every time -include $(DEPS) diff --git a/doc/Makefile b/doc/Makefile index 7530825..cfdd943 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,3 +1,6 @@ +mandir=$(prefix)/man +man1dir=$(mandir)/man1 + CHAPTERS := $(SITE) blurb intro running input output licence manpage index INPUTS = $(patsubst %,%.but,$(CHAPTERS)) @@ -13,5 +16,8 @@ index.html: $(INPUTS) $(HALIBUT) halibut.1: manpage.but $(HALIBUT) --man=halibut.1 manpage.but +install: + $(INSTALL) -m 644 halibut.1 $(man1dir)/halibut.1 + clean: rm -f *.html *.txt *.hlp *.cnt *.1 *.info* *.ps *.pdf -- 2.11.0