# - 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)
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)
VDEF = `(cd $(SRC); md5sum -c manifest && cat version)`
endif
-halibut:
+all: halibut
SRC := ../
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)
+mandir=$(prefix)/man
+man1dir=$(mandir)/man1
+
CHAPTERS := $(SITE) blurb intro running input output licence manpage index
INPUTS = $(patsubst %,%.but,$(CHAPTERS))
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