# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@

# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

@SET_MAKE@

# $Id: Makefile.am,v 1.15 2008-12-22 09:37:22 guidod Exp $
# VPATH=$(pfedir) # NOTE: need to add $(srcdir) where appropriate

VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = doc
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/uses/ac_cond_with.m4 \
	$(top_srcdir)/uses/ac_set_default_paths_system.m4 \
	$(top_srcdir)/uses/ax_configure_args.m4 \
	$(top_srcdir)/uses/ax_enable_builddir_uname.m4 \
	$(top_srcdir)/uses/ax_expand_prefix.m4 \
	$(top_srcdir)/uses/ax_spec_file.m4 \
	$(top_srcdir)/uses/ax_spec_package_version.m4 \
	$(top_srcdir)/uses/ax_warning_default_pkgconfig.m4 \
	$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/uses/mkinstalldirs
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
DATA = $(noinst_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXTRAMODULES = @EXTRAMODULES@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
WITHDEF_CALL_THREADING = @WITHDEF_CALL_THREADING@
WITHDEF_MODULES = @WITHDEF_MODULES@
WITHDEF_SBR_CALL_THREADING = @WITHDEF_SBR_CALL_THREADING@
WITHDEF_SBR_THREADING = @WITHDEF_SBR_THREADING@
WITHOUT_CALL_THREADING = @WITHOUT_CALL_THREADING@
WITHOUT_MODULES = @WITHOUT_MODULES@
WITHOUT_SBR_CALL_THREADING = @WITHOUT_SBR_CALL_THREADING@
WITHOUT_SBR_THREADING = @WITHOUT_SBR_THREADING@
WITHVAL_CALL_THREADING = @WITHVAL_CALL_THREADING@
WITHVAL_MODULES = @WITHVAL_MODULES@
WITHVAL_SBR_CALL_THREADING = @WITHVAL_SBR_CALL_THREADING@
WITHVAL_SBR_THREADING = @WITHVAL_SBR_THREADING@
WITH_CALL_THREADING = @WITH_CALL_THREADING@
WITH_MODULES = @WITH_MODULES@
WITH_SBR_CALL_THREADING = @WITH_SBR_CALL_THREADING@
WITH_SBR_THREADING = @WITH_SBR_THREADING@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
am__leading_dot = @am__leading_dot@
am__tar = @am__tar@
am__untar = @am__untar@
ax_enable_builddir_sed = @ax_enable_builddir_sed@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = ${infodir}/../doc
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
subdirs = @subdirs@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
pfedir = $(top_srcdir)/pfe
dbkdir = $(top_srcdir)/dbk
DOCS = doc
SRCS = src
groups = ${infodir}/../groups
pkgdocdir = ${docdir}/$(PACKAGE)
pkghtdocs = ${groups}/$(PACKAGE3)/htdocs
PACKAGE3 = p/pf/pfe
XMLTO = xmlto $(XMLTO_FLAGS)

# `make install-man1` is in the default `make install` path,
# to add `make man1` to the default `make all` we use this:
noinst_DATA = pfe.1
DBKS = dbk
DBK = how-to-write-a-pfe-module.dbk \
	internal-decisions-about-headers.dbk \
	special-implementation-strategies.dbk \
	tuning.dbk literature.dbk license.dbk lgpl-license.dbk \
	dirk-zoller-readme.dbk locals.dbk wordset-modules.dbk \
	make-dist.dbk statesmart-words.dbk known-problems.dbk \
        quoted-parse-idea.dbk porting-sbr-threading.dbk \
        uppercasing.dbk header-fields.dbk posixcalls.dbk

DBK_EXTRA = doc-index.dbk threading.dbk pfe-manual.dbk
htm_FILES = pfe.htm index.htm documentation.htm authors.htm license.htm \
            changes.htm lgpl-license.htm

htm_EXTRA = body.htm
pfedoc_py_DIST = makedocs.py \
                 pfedoc/__init__.py  pfedoc/match.py  pfedoc/options.py \
                 pfedoc/functionheader.py        pfedoc/textfileheader.py \
                 pfedoc/functionprototype.py     pfedoc/textfile.py \
                 pfedoc/functionlisthtmlpage.py  pfedoc/commentmarkup.py \
                 pfedoc/functionlistreference.py pfedoc/dbk2htm.py \
                 pfedoc/forthheader.py           pfedoc/htm2dbk.py \
                 pfedoc/forthwordset.py          pfedoc/forthnotation.py \
                 pfedoc/forthwords.py            pfedoc/htmldocument.py  \
                 pfedoc/forthwordsethtmlpage.py  pfedoc/htmldirectory.py \
                 pfedoc/forthwordsetreference.py pfedoc/docbookdocument.py \
                 pfedoc/forthmodule.py           pfedoc/odtdocument.py \
                                                 pfedoc/odttypes.py 


# EXTRA_DIST = *.dbk *.htm *.ar *.pl *.pdf pfe.1 *.gif *.css src/Makefile
EXTRA_DIST = $(DBK) $(DBK_EXTRA) $(htm_FILES) $(htm_EXTRA) \
	     dpans.ar 4thtutor.ar help2man.pl Forthprimer.pdf \
	     pfe.1 4ring.gif PFE.css \
             src/Makefile src/PFE.css \
             $(pfedoc_py_DIST)


# --------------------------------------------------------- NEW XML STYLE
FORTHXML = forthheaders.xml forthwordsets.xml forthmodules.xml
SFHTDOCS = /home/groups/p/pf/pfe/htdocs/

# --------------------------------------------------------- NEW DBK STYLE
SORRY = "Sorry, the doc build system had been missing xmlg from xmlg.sf.net"
pfe_words_OPT = 
PYRUN = $(PYTHONFLAGS) $(PYTHON) $(PYTHONOPTIONS)
datehead = <hr><table border="0" width="100%"><tr><td> \
    <a href="mailto:guidod@gmx.de?subject=$(PACKAGE):">guidod@gmx.de</a> \
    </td><td align="right">

datetail = </td></tr></table>
borderhead = <table cellpadding="10"><tr><td>
bordertail = </td></tr></table>
DATESPEC = `date +%Y-%m-%d`
VERSIONSPEC = `sed -e '/Version:/!d' -e 's/.*://' $(top_srcdir)/pfe.spec`

# PKGHTDOCS=/groups/f/fr/freespace/htdocs/$(PACKAGE)
# PKGDOCDIR=${datadir}${PKGHTDOCS}
PKGHTDOCDIR = ${pkghtdocs}
all: all-am

.SUFFIXES:
.SUFFIXES: .htm .html
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
		&& exit 0; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  doc/Makefile'; \
	cd $(top_srcdir) && \
	  $(AUTOMAKE) --gnu  doc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
tags: TAGS
TAGS:

ctags: CTAGS
CTAGS:


distdir: $(DISTFILES)
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
	    fi; \
	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
	  else \
	    test -f $(distdir)/$$file \
	    || cp -p $$d/$$file $(distdir)/$$file \
	    || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	  `test -z '$(STRIP)' || \
	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:

clean-generic:

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean-am: clean-generic mostlyclean-am

distclean: distclean-am
	-rm -f Makefile
distclean-am: clean-am distclean-generic

dvi: dvi-am

dvi-am:

html: html-am

info: info-am

info-am:

install-data-am: install-data-local

install-dvi: install-dvi-am

install-exec-am:

install-html: install-html-am

install-info: install-info-am

install-man:

install-pdf: install-pdf-am

install-ps: install-ps-am

installcheck-am:

maintainer-clean: maintainer-clean-am
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-generic

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am:

.MAKE: install-am install-strip

.PHONY: all all-am check check-am clean clean-generic distclean \
	distclean-generic distdir dvi dvi-am html html-am info info-am \
	install install-am install-data install-data-am \
	install-data-local install-dvi install-dvi-am install-exec \
	install-exec-am install-html install-html-am install-info \
	install-info-am install-man install-pdf install-pdf-am \
	install-ps install-ps-am install-strip installcheck \
	installcheck-am installdirs maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
	pdf-am ps ps-am uninstall uninstall-am


docu: man3
install-data-local : install-man1

# doc: src/index.html wordsets.tar words.tar htmfiles.tar pfe.1
# doc: wordsets.tar words.tar htmfiles.tar pfe.1

../pfe/pfe$(EXEEXT) :
	(cd ../pfe && $(MAKE) `basename $@`)

pfe.1 : ../pfe/pfe$(EXEEXT) $(top_srcdir)/pfe.spec
	perl $(srcdir)/help2man.pl ../pfe/pfe$(EXEEXT) > $@ || true
	@ test -f $@ || head $(top_srcdir)/pfe.spec > $@

man1 : pfe.1
mans : man1 man3

install-mans : install-man1 install-man3
install-man1 : pfe.1 
	$(mkinstalldirs) $(DESTDIR)$(mandir)/man1
	for i in $(.ALLSRC) $^ ; do \
	$(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/man1/`basename $$i \
        | sed -e 's/.1$$//' -e '$(transform)' -e 's/$$/.1/'` \
        ; done
install-man3 : pfe-man3.ar
	$(mkinstalldirs) $(DESTDIR)$(mandir)/man3
	(p=`pwd` ; cd $(DESTDIR)$(mandir)/man3 && ar x $$p/pfe-man3.ar)
forthxml : $(FORTHXML)
forthheaders.xml: $(pfedir)/*.c
	$(PYRUN) $(srcdir)/pfedoc/forthheader.py $(pfedir)/*.c > $@
forthwordsets.xml: $(pfedir)/*.c
	$(PYRUN) $(srcdir)/pfedoc/forthwordset.py $(pfedir)/*.c > $@
forthmodules.xml: $(pfedir)/*.c
	$(PYRUN) $(srcdir)/pfedoc/forthmodule.py $(pfedir)/*.c > $@
clean-forthxml:
	- rm $(FORTHXML)

forthxmls : forthheaders/index.txt forthwordsets/index.txt forthmodules/index.txt
forthheaders/index.txt: $(pfedir)/*.c
	@ d=`dirname $@`; mkdir $$d 2>/dev/null \
	; for x in $?; do y=`basename $$x .c`.xml \
	; echo $(PYRUN) $(srcdir)/pfedoc/forthheader.py $$x ">" $$d/$$y \
	;      $(PYRUN) $(srcdir)/pfedoc/forthheader.py $$x > $$d/$$y \
	; { cat $@ 2>/dev/null; echo $$d/$$y; } | sort -u > $@.tmp \
	; mv $@.tmp $@ ; test -s $$d/$$y || rm $$d/$$y; done; true
forthwordsets/index.txt: $(pfedir)/*.c
	@ d=`dirname $@`; mkdir $$d 2>/dev/null \
	; for x in $?; do y=`basename $$x .c`.xml \
	; echo $(PYRUN) $(srcdir)/pfedoc/forthwordset.py $$x ">" $$d/$$y \
	;      $(PYRUN) $(srcdir)/pfedoc/forthwordset.py $$x > $$d/$$y \
	; { cat $@ 2>/dev/null; echo $$d/$$y; } | sort -u > $@.tmp \
	; mv $@.tmp $@ ; test -s $$d/$$y || rm $$d/$$y; done; true
forthmodules/index.txt: $(pfedir)/*.c
	@ d=`dirname $@`; mkdir $$d 2>/dev/null \
	; for x in $?; do y=`basename $$x .c`.xml \
	; echo $(PYRUN) $(srcdir)/pfedoc/forthmodule.py $$x ">" $$d/$$y \
	;      $(PYRUN) $(srcdir)/pfedoc/forthmodule.py $$x > $$d/$$y \
	; { cat $@ 2>/dev/null; echo $$d/$$y; } | sort -u > $@.tmp \
	; mv $@.tmp $@ ; test -s $$d/$$y || rm $$d/$$y; done; true
clean-forthxmls:
	- for x in */index.txt; do if test -f $$x; then : \
	; echo rm -r `dirname $$x`; rm -r `dirname $$x`; fi done 

# >> pkgdocdir
docs doc : $(DOCS).tar
install-docs install-doc: $(DOCS).tar 
	@ echo ':::' $(DOCS).tar '>>' :$(pkgdocdir)/$(VERSION)
	@ echo mkinstalldirs $(DESTDIR)$(pkgdocdir)/$(VERSION) \
	;            test -d $(DESTDIR)$(pkgdocdir)/$(VERSION) \
	||  $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(VERSION)
	@ echo un-tar '>>' :$(pkgdocdir)/$(VERSION)
	@ p=`pwd` ; cd $(DESTDIR)$(pkgdocdir)/$(VERSION) \
	; tar xf $$p/$(DOCS).tar ; cd $$p ; true
	-cp $(top_srcdir)/ChangeLog $(DESTDIR)$(pkgdocdir)/$(VERSION)
	-cp $(top_srcdir)/COPYING.LIB $(DESTDIR)$(pkgdocdir)/$(VERSION)
	@ echo ':::' ln -s $(pkgdocdir)/$(VERSION)/'*' $(pkgdocdir)/$(PACKAGE)/
	@ (cd $(DESTDIR)$(pkgdocdir)/ && ln -s $(VERSION)/* .) || true
install-sf:
	$(MAKE) install-docs DESTDIR=/tmp/pfe-doc-sourceforge-$$USER/
	sleep 4
	scp -r /tmp/pfe-doc-sourceforge-$$USER/$(pkgdocdir)/$(VERSION) \
        shell.sf.net:$(SFHTDOCS)
	ssh shell.sf.net "cd $(SFHTDOCS)/ && ln -sf $(VERSION)/* ."
	rm  -r /tmp/pfe-doc-sourceforge-$$USER/

# -------------- sf refdoc -------------

$(DOCS).tar : htmfiles.tar pfe-wordsets.tar pfe-manual.tar \
              pfe-wordsets.html pfe-words.html $(FORTHXML)
	@ if test -f $(DOCS)/all-$(DOCS).build ; then : \
	; echo rm -r $(DOCS) ; sleep 4 ; rm -r $(DOCS) \
	; fi
	mkdir $(DOCS) ; date > $(DOCS)/all-$(DOCS).build
	@ echo un-tar htmfiles.tar '>>' $(DOCS) \
	; cd $(DOCS) && tar xf ../htmfiles.tar
	@ echo un-tar pfe-wordsets.tar '>>' $(DOCS) \
	; cd $(DOCS) && tar xf ../pfe-wordsets.tar
	@ echo un-tar pfe-manual.tar '>>' $(DOCS) \
	; cd $(DOCS) && tar xf ../pfe-manual.tar
	@ if test -f $(srcdir)/dpans.ar \
	; then mkdir $(DOCS)/dpans \
	; echo un-ar dpans.ar '>>' $(DOCS)/dpans \
	; cp $(srcdir)/dpans.ar $(DOCS)/dpans \
	; (cd $(DOCS)/dpans && ar x dpans.ar) \
	; (cd $(DOCS)/dpans && ln -s dpans.htm index.html) \
	; rm  $(DOCS)/dpans/dpans.ar \
	; fi ; true
	@ if test -f $(top_srcdir)/dpans/dpansf.html \
	; then mkdir $(DOCS)/dpans \
	; echo cp "../dpans/*" '>>' $(DOCS)/dpans \
	; cp $(top_srcdir)/dpans/* $(DOCS)/dpans \
	; (cd $(DOCS)/dpans && ln -s dpans.htm index.html) \
	; fi ; true
	@ if test -f $(srcdir)/4thtutor.ar \
	; then mkdir $(DOCS)/4thtutor \
	; echo un-ar 4thtutor.ar '>>' $(DOCS)/4thtutor \
	; cp $(srcdir)/4thtutor.ar $(DOCS)/4thtutor \
	; (cd $(DOCS)/4thtutor && ar x 4thtutor.ar) \
	; (cd $(DOCS)/4thtutor && ln -s 4thtutor.htm index.html) \
	; rm  $(DOCS)/4thtutor/4thtutor.ar \
	; fi ; true
	@ if test -f $(srcdir)/Forthprimer.pdf \
	; then : \
	; echo cp Forthprimer.pdf '>>' $(DOCS) \
	; cp $(srcdir)/Forthprimer.pdf $(DOCS)/Forthprimer.pdf \
	; fi ; true
	-cp $(srcdir)/*.gif $(DOCS)
	- cp pfe-wordsets.html pfe-words.html $(DOCS)
	- cp $(FORTHXML) $(DOCS)
	@ echo tar $@ '<<' $(DOCS)
	@ (cd $(DOCS) && tar chf ../$@ .)
	@ echo rm -rf $(DOCS) -- skipped

clean: clean-doc
clean-docs clean-doc: 
	rm -f *.html *.xml
../dbk/index.html : $(srcdir)/*.dbk $(dbkdir)/*.dbk $(pfedir)/*.c
	if test -f $(srcdir)/dpans.ar ; then mkdir tmp ; mkdir tmp/dpans \
	; cp $(srcdir)/dpans.ar tmp/dpans \
	; (cd tmp/dpans && ar x dpans.ar && rm dpans.ar)\
	; (cd .. && ln -s doc/tmp/dpans .) ; fi ; true
	test -d ../dbk || mkdir ../dbk
	- test -h $(top_srcdir)/dpans || ln -s `pwd`/tmp/dpans $(top_srcdir)
	(p=`pwd` ; cd $(top_srcdir)/dbk \
	&& $(MAKE) -f pfe-fth.mk index.html pfe-fth.html \
	"DPANS=--dpans=../dpans --nofileref" "OUTPUT= -o $$p/../dbk")
	test -s ../dbk/index.html || echo $(SORRY) > ../dbk/index.html
	- rm -r tmp/dpans || true
docus : pfe-wordsets.html pfe-words.html pfe-words.docbook
pfe-wordsets.html pfe-words.html pfe-words.docbook : \
        $(srcdir)/*.dbk $(dbkdir)/*.dbk $(pfedir)/*.c \
        $(srcdir)/*.py $(srcdir)/pfedoc/*.py $(srcdir)/*.am
	$(PYRUN) $(srcdir)/makedocs.py $(pfedir)/*.c \
        "--package=$(PACKAGE)" "--version=$(VERSION)" \
        "--body=$(srcdir)/body.htm" $(pfe_words_OPT) 
man3: pfe-man3.ar
pfe-man3.ar : pfe-words.docbook
	- test ! -d man3  || mkdir man3; rm man3/*
	$(XMLTO) -o man3 man pfe-words.docbook
	ar -q "$@" man3/*
pfe-wordsets.tar : pfe-wordsets.html
	tar cf "$@" pfe-wordsets/*
pfe-manual.docbook : pfe-wordsets.docbook $(DBK) $(DBK_EXTRA)
	sed -e "s|../doc/|$(srcdir)/|" $(srcdir)/doc-index.dbk   \
	> doc-index.docbook
	sed -e "s|../doc/|$(srcdir)/|" \
	-e 's|"[^"]*/doc-index.dbk"|"doc-index.docbook"|' \
	$(srcdir)/pfe-manual.dbk  \
	> pfe-manual.docbook
pfe-manual/index.html : pfe-manual.docbook
	- test ! -d pfe-manual  || mkdir pfe-manual; rm pfe-manual/*
	$(XMLTO) --skip-validation -o pfe-manual html pfe-manual.docbook
pfe-manual.tar: pfe-manual/index.html
	tar cf "$@" pfe-manual/*
pfe-manual.pdf : pfe-manual.docbook
	$(XMLTO) --skip-validation pdf pfe-manual.docbook
pdfs: pfe-manual.pdf

# the pfe-manual rules do not work due to errors in `xmlto` / docbook-xsl
# --------------------------------------------------------- NEW HTM STYLE

htmfiles.tar : $(htm_FILES:.htm=.html)
	tar chf $@ $(htm_FILES:.htm=.html)

clean-htmfiles:
	-rm $(DBK:.dbk=.html) $(DBK:.dbk=.xml) index.html

htmfiles : $(htm_FILES:.htm=.html)
$(htm_FILES:.htm=.html) : body.htm
# %.html : %.htm
.htm.html:
	@  D=$(DATESPEC) ; V=$(VERSIONSPEC) ; test -z "$$V" && V="$(VERSION)" \
	; title=`sed -e '/<h2>/!d' -e 's:</h2>.*::' \
        -e 's:<[^<>]*>::g' -e 'q' $<` \
	; cat $(srcdir)/body.htm | sed \
        -e "/body>.*html>/d" \
	-e "s|<!--VERSION-->|$$V|" \
	-e "s|<!--DATE-->|$$D|" \
	-e "s|</title>| - $$title</title>|" \
	-e "/$@.>/s|\\([^<>]*\\)</a>|<b>\\1</b></a>|" \
	> $@
	@ echo $< '>>' $@; cat $< | sed -e "s/<!--VERSION-->/$(VERSION)/" \
	-e "s:</h2>\\(.*\\):</h2></td><td><i>\\1</i></td></tr></table>:" \
	-e 's:<h2>:<table width="100%"><tr valign="bottom"><td><h2>:' \
	-e 's:<td><i>:<td align="right"><br> <i>:' \
	-e 's:<P>:<p class="justify"><span class="justify">:g' \
	-e 's:</P>:</span></p>:g' \
	-e 's,<date>,<!--DATE: ,' -e 's,</date>, -->,' \
	-e 's,<!--border-->,$(borderhead)<!--BORDER-->,' >>$@
	@ if grep '<!--BORDER-->' $@ >/dev/null ; then : \
	; echo "$(bordertail)<!--/BORDER-->" >>$@ ; fi
	@ D=`grep '<!--DATE:' $@ | sed -e 's,.*<!--DATE: *,,' -e 's, *-->,,'` \
	; if test ".$$D" != "." ; then echo '$(datehead)' >>$@ \
	; echo "$$D" >> $@ ; echo "$(datetail)" >> $@ ;	fi
	@ cat $(srcdir)/body.htm | sed \
        -e "/body>.*html>/!d" \
	>>$@
install-htmfiles : $(htm_FILES:.htm=.html) 
	$(mkinstalldirs) $(DESTDIR)$(PKGDOCDIR)
	$(INSTALL_DATA) $(htm_FILES:.htm=.html) $(DESTDIR)$(PKGDOCDIR)
	- (cd $(DESTDIR)$(PKGDOCDIR) && ln -s $(PACKAGE).html index.html)

$(PACKAGE).htm : $(top_srcdir)/$(PACKAGE).spec
	- mv $(PACKAGE).htm $(PACKAGE)-tmp.htm
	- ../pfe/pfe --help    > $(PACKAGE)-tmp.hlp
	- ../pfe/pfe --version > $(PACKAGE)-tmp.ver
	grep -i summary $(PACKAGE).spec | sed -e 's,.*:,,' > $(PACKAGE)-tmp.sum
	echo " <h2> "`cat $(PACKAGE)-tmp.sum` \
	    " </h2> "`cat $(PACKAGE)-tmp.ver` > $@
	echo "<!--border--><date>generated "$(DATESPEC)"</date><pre>" >> $@
	cat $(PACKAGE)-tmp.hlp | sed -e "/^[a-z]/s:.*:<b>&</b>:" >>$@
	echo "</pre>" >> $@
	test -s $@ || mv $(PACKAGE)-tmp.htm $@
	- rm $(PACKAGE)-tmp.*

changes.htm : $(top_srcdir)/ChangeLog Makefile 
	echo "<pre>" > $@ ; cat $(top_srcdir)/ChangeLog \
	| sed -e "s,\\&,\\&amp\\;,g" \
	-e "s,<,\\&lt\\;,g" -e "s,>,\\&gt\\;,g" \
	-e "/^[A-Z].*[12][09][09][09]/s,\\(.*\\),<b>&</b>," \
	-e "/^[0-9]/s,\\(.*\\),<b>&</b>," >> $@ ; echo "</pre>" >>$@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
