# $Header: /home/amb/cxref/doc/RCS/Makefile.in 1.2 1999/01/26 19:40:12 amb Exp $
#
# C Cross Referencing & Documentation tool. Version 1.5.
#
# Documentation Makefile.
#
# Written by Andrew M. Bishop
#
# This file Copyright 1995,96,99 Andrew M. Bishop
# It may be distributed under the GNU Public License, version 2, or
# any higher version.  See section COPYING of the GNU Public license
# for conditions under which this file may be redistributed.
#

# autoconf things

srcdir=@srcdir@
VPATH=@srcdir@

# The LaTeX and dvips programs

LATEX=@LATEX@
DVIPS=@DVIPS@

########

SOURCE_FILES= \
autoconfig.h  \
cxref.c       \
cxref.h       \
datatype.h    \
comment.c     \
file.c        \
func.c        \
preproc.c     \
type.c        \
var.c         \
xref.c        \
warn-raw.c    \
latex.c       \
latex-style.c \
html.c        \
rtf.c         \
sgml.c        \
slist.c       \
memory.h      \
memory.c      \
parse-yy.h    \
parse-yacc.h  \
parse-lex.c   \
parse-yacc.c 

########

all : sources docs
	@

########

sources :
#
# Create the cross reference files
#
	@for file in $(SOURCE_FILES) ; do \
	   echo Cross referencing $$file ; \
	   ( cd .. ; ./cxref -xref -Odoc -Ncxref $$file ) ; \
	done
#
# Create the source files using cxref
#
	@for file in $(SOURCE_FILES) ; do \
	   echo Documenting $$file ; \
	   ( cd .. ; ./cxref -warn-xref -xref -Odoc -Ncxref -latex2e -html32-src -rtf -sgml $$file ) ; \
	done
#
# Create the index using cxref
#
	@echo Indexing
	@( cd .. ; ./cxref -index-all -Odoc -Ncxref -latex2e -html32 -rtf -sgml )

########

docs :
#
# Create the final output using latex
#
	[ "x$(LATEX)" = "x" ] || $(LATEX) cxref.tex > /dev/null 2>&1
#
# Create the cross references using latex
#
	[ "x$(LATEX)" = "x" ] || $(LATEX) cxref.tex

########

clean :
	-rm -f *~ \
	*.sty *.tex *.html *.rtf *.sgml \
	cxref.function cxref.include cxref.typedef cxref.variable \
	cxref.aux cxref.dvi cxref.log cxref.toc

####

distclean : clean
	-rm -f Makefile

########
