SRC	= gmonitor3.1
RM      = rm -f

top_objdir = @top_objdir@
top_srcdir = @top_srcdir@
srcdir = @srcdir@

include $(top_objdir)/config.mk

all: html man

html:
	for i in / $(SRC); do \
		case $$i in /) continue;; esac; \
		$(MAKE) srcsubst=$${i}.docbook \
		htmlsubst=$${i}.html $${i}.html; \
	done

man:
	for i in / $(SRC); do \
		case $$i in /) continue;; esac; \
		$(MAKE) srcsubst=$${i}.docbook \
		mansubst=$${i} $${i}; \
	done

$(htmlsubst): $(srcsubst)
	jw -b html -u $(srcsubst)

$(mansubst): $(srcsubst)
	jw -b man $(srcsubst)

install:
	@for i in / $(SRC); do \
	  case $$i in /) continue;; esac; \
	  suffix=`expr $$i : '.*\.\([^.]*\)$$'`; \
	  ( set -x; $(INSTALL_DATA) $${i} $(mandir)/$(doclang)man$$suffix/$$i ); \
        done
	@for i in / $(SRC); do \
	  case $$i in /) continue;; esac; \
	  ( set -x; $(INSTALL_DATA) $${i}.html $(htmldir)/$(doclang)$${i}.html ); \
	done

clean:
	$(RM) *.refs *.links *~

veryclean: clean
	$(RM) *.html $(SRC)
