# $Header: /home/amb/cxref/doc/RCS/Makefile 1.8 1996/06/29 16:42:24 amb Exp $
#
# C Cross Referencing & Documentation tool. Version 1.2
#
# Documentation Makefile.
#
# Written by Andrew M. Bishop
#
# This file Copyright 1995,96 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.
#

LATEX=latex

DOCS=cxref.dvi

########

SOURCE_FILES= \
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        \
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 -latex -html $$file ) ; \
	   rm -f $(DOCS) ; \
	done
#
# Create the index using cxref
#
	@echo Indexing
	@( cd .. ; ./cxref -index-all -Odoc -Ncxref -latex -html )
	@rm -f $(DOCS)

########

docs : $(DOCS)
	@

########

cxref.dvi :
#
# Create the final output using latex
#
	$(LATEX) cxref.tex
#
# Create the cross references using latex
#
	$(LATEX) cxref.tex

########

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

########
