# Makefile for doc/
# $Id: Makefile.in,v 1.18 2002/03/09 21:14:14 wcc Exp $

SHELL = @SHELL@
top_srcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

@SET_MAKE@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@

DOCS = ABOUT AUTHORS BANS BOTNET BUG-REPORT compiling.FAQ CONTENTS \
first_script.txt KNOWN-PROBLEMS MODULES PARTYLINE patch.howto \
tcl-commands.doc text-substitutions.doc tricks UPDATES.pre1.5 UPDATES1.5 \
UPDATES1.6 USERS

MAN1 = man1/eggdrop.1

WEB_DOCS = $(srcdir)/html/*.html
SETTING_DOCS = core.settings CONTENTS
SETTING_MOD_DOCS = $(srcdir)/settings/mod.*

doofus:
	@echo ""
	@echo "Let's try this from the right directory..."
	@echo ""
	@cd .. && $(MAKE)

all: $(DOCS) $(MAN1)

clean:
	@rm -f *~

install:
	@if test ! -d $(DEST)/doc; then \
		echo "Creating a doc subdirectory."; \
		$(top_srcdir)/misc/mkinstalldirs $(DEST)/doc; \
	fi
	@if test ! -d $(DEST)/doc/man1; then \
		$(top_srcdir)/misc/mkinstalldirs $(DEST)/doc/man1; \
	fi
	@if test ! -d $(DEST)/doc/html; then \
		$(top_srcdir)/misc/mkinstalldirs $(DEST)/doc/html; \
	fi
	@if test ! -d $(DEST)/doc/settings; then \
		$(top_srcdir)/misc/mkinstalldirs $(DEST)/doc/settings; \
	fi
	@echo "Copying docs."
	@for i in $(DOCS); do \
		$(INSTALL_DATA) $(srcdir)/$$i $(DEST)/doc/; \
	done
	@for i in $(MAN1); do \
		$(INSTALL_DATA) $(srcdir)/$$i $(DEST)/doc/man1/; \
	done
	@for i in $(SETTING_DOCS); do \
		$(INSTALL_DATA) $(srcdir)/settings/$$i $(DEST)/doc/settings/; \
	done
	@if test "x`echo $(SETTING_MOD_DOCS)`" != "x$(SETTING_MOD_DOCS)"; then \
		for i in `echo $(SETTING_MOD_DOCS)`; do \
			$(INSTALL_DATA) $$i $(DEST)/doc/settings/; \
		done; \
	fi
	@if test "x`echo $(WEB_DOCS)`" != "x$(WEB_DOCS)"; then \
		for i in `echo $(WEB_DOCS)`; do \
			$(INSTALL_DATA) $$i $(DEST)/doc/html/; \
		done; \
	fi

#safety hash
