# Makefile.in -- 
# Created: Mon May 26 09:57:04 1997 by faith@acm.org
# Revised: Sun Mar  8 08:02:35 1998 by faith@acm.org
# Copyright 1997, 1998 Rickard E. Faith (faith@acm.org)
# 
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 1, or (at your option) any
# later version.
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
# 
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 675 Mass Ave, Cambridge, MA 02139, USA.
# 
# $Id: Makefile.in,v 1.8 2002/09/16 12:48:39 cheusov Exp $
# 



ifneq (,)
This makefile requires GNU Make.
endif

.SUFFIXES:	

srcdir=		@srcdir@
VPATH=		@srcdir@
prefix=		@prefix@
subdirs=        @allsubdirs@ regex
exec_prefix=	@exec_prefix@
man1_prefix=	$(prefix)/man/man1

SHELL=		/bin/sh

NROFF=          @NROFF@
TROFF=          @TROFF@
COL=            @COL@
EXPAND=         @EXPAND@

INSTALL=	@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
INSTALL_DATA=	@INSTALL_DATA@

dicf: dicf.txt

all: rfc.txt

rfc.txt: rfc.ms toc.ms
	@echo "Building table of contents, pass 1"
	@echo "" > rfc.toc
	@$(NROFF) -ms toc.ms | @AWK@ '/STARTTOC/ { p = 1 } \
		/\..\..\../ { if (p == 1) print }' > rfc.toc.new
	@cp rfc.toc.new rfc.toc
	@echo "Building table of contents, pass 2"
	@$(NROFF) -ms toc.ms | @AWK@ '/STARTTOC/ { p = 1 } \
		/\..\..\../ { if (p == 1) print }' > rfc.toc.new
	@cp rfc.toc.new rfc.toc
	@echo "Building table of contents, pass 3 (verification)"
	@$(NROFF) -ms toc.ms | @AWK@ '/STARTTOC/ { p = 1 } \
		/\..\..\../ { if (p == 1) print }' > rfc.toc.new
	@cmp -s rfc.toc.new rfc.toc || echo "WARNING: Contents Changed!"
	@echo "Building document..."
	$(NROFF) -ms rfc.ms | ./rfc.sh | $(EXPAND) > rfc.txt

dicf.txt: dicf.ms dicftoc.ms
	@echo "Building table of contents, pass 1"
	@echo "" > dicf.toc
	@$(NROFF) -ms dicftoc.ms | @AWK@ '/STARTTOC/ { p = 1 } \
		/\..\..\../ { if (p == 1) print }' > dicf.toc.new
	@cp dicf.toc.new dicf.toc
	@echo "Building table of contents, pass 2"
	@$(NROFF) -ms dicftoc.ms | @AWK@ '/STARTTOC/ { p = 1 } \
		/\..\..\../ { if (p == 1) print }' > dicf.toc.new
	@cp dicf.toc.new dicf.toc
	@echo "Building table of contents, pass 3 (verification)"
	@$(NROFF) -ms dicftoc.ms | @AWK@ '/STARTTOC/ { p = 1 } \
		/\..\..\../ { if (p == 1) print }' > dicf.toc.new
	@cmp -s dicf.toc.new dicf.toc || echo "WARNING: Contents Changed!"
	@echo "Building document..."
	$(NROFF) -ms dicf.ms | ./rfc.sh | $(EXPAND) > dicf.txt

# This is pretty ugly
rfc.ps: rfc.ms
	$(TROFF) -ms rfc.ms > rfc.ps

.PHONY: clean distclean tags
clean:
	-rm -f *.ps *.txt rfc.toc rfc.toc.new

distclean: clean
	-rm -f Makefile

tags:
	etags *.[ch]

# This is from the textutils-1.11 lib/Makefile.in
subdir=doc
Makefile: Makefile.in ../config.status
	cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
