TARGETS	= $(OBJDIR)terminal.1 $(OBJDIR)terminal.html
OBJDIR	=
PREFIX	= /usr/local
DESTDIR	=
RM	= rm -f
LN	= ln -f
MKDIR	= mkdir -m 0755 -p
INSTALL	= install


all: $(TARGETS)

$(OBJDIR)terminal.1: docbook.sh terminal.xml
	./docbook.sh -P "$(PREFIX)" -- "$(OBJDIR)terminal.1"

$(OBJDIR)terminal.html: docbook.sh manual.css.xml terminal.css.xml terminal.xml
	./docbook.sh -P "$(PREFIX)" -- "$(OBJDIR)terminal.html"

clean:
	./docbook.sh -c -P "$(PREFIX)" -- "$(OBJDIR)terminal.1"
	./docbook.sh -c -P "$(PREFIX)" -- "$(OBJDIR)terminal.html"

distclean: clean
	$(RM) -- $(TARGETS)

install: all
	./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)terminal.1"
	./docbook.sh -P "$(DESTDIR)$(PREFIX)" -i -- "$(OBJDIR)terminal.html"

uninstall:
	./docbook.sh -P "$(DESTDIR)$(PREFIX)" -u -- "terminal.1"
	./docbook.sh -P "$(DESTDIR)$(PREFIX)" -u -- "terminal.html"

.PHONY: all clean distclean install uninstall
