TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
SRCDIR    = @srcdir@
VPATH     = @srcdir@
MODULE    = none

INCLUDES = \
	AUTHORS \
	LICENSE \
	WARRANTY

SOURCES = \
	wine.texinfo \
	$(INCLUDES)

INFOFILES = \
	wine.info \
	wine.info-1 \
	wine.info-2

HTMLFILES = \
	wine_toc.html \
	wine.html

DVIFILES = wine.dvi


all: $(INFOFILES) $(DVIFILES) $(HTMLFILES)

info: $(INFOFILES)

dvi: $(DVIFILES)

html: $(HTMLFILES)

@MAKE_RULES@

$(INFOFILES): $(SOURCES)
	makeinfo $(SRCDIR)/wine.texinfo

$(DVIFILES): $(SOURCES)
	texi2dvi $(SRCDIR)/wine.texinfo

$(HTMLFILES): $(SOURCES)
	makeinfo -E wine.texi $(SRCDIR)/wine.texinfo
	texi2html wine.texi 

$(INCLUDES):
	$(RM) $(INCLUDES)
	for i in $(INCLUDES); do $(LN_S) $(TOPSRCDIR)/$$i $$i || exit 1; done

install:: 
	$(INSTALL) -d $(mandir)/man$(prog_manext)
	$(INSTALL) -d $(mandir)/man$(conf_manext)
	$(INSTALL_DATA) wine.man $(mandir)/man$(prog_manext)/wine.$(prog_manext)
	$(INSTALL_DATA) wine.conf.man $(mandir)/man$(conf_manext)/wine.conf.$(conf_manext)

uninstall::
	$(RM) $(mandir)/man($prog_manext)/wine.$(prog_manext)
	$(RM) $(mandir)/man($conf_manext)/wine.conf.$(conf_manext)

# Not done by default because of makeinfo bugs
install_info: $(INFOFILES)
	[ -d $(infodir) ] || mkdir -p $(infodir)
	for i in $(INFOFILES); do $(INSTALL_DATA) $$i $(infodir)/$$i; done

uninstall_info:
	for i in $(INFOFILES); do $(RM) $(infodir)/$$i; done

clean::
	$(RM) $(INFOFILES) $(DVIFILES) $(INCLUDES)
	$(RM) wine.aux wine.cp wine.cps wine.fn wine.fns wine.ky wine.log \
		wine.pg wine.toc wine.tp wine.tps wine.vr wine.vrs \
		wine.texi
	$(RM) -r man3w

### Dependencies:
