synopsis	:= ../../bin/synopsis -c config.py
synopsis_one	:= $(synopsis) -Wc,parser=C++,formatter=HTML,linker=Linker

all: html pdf employee templates shapes

ascii:	GapBuffer.hh
	../../bin/synopsis -p C++ -Wp,-C -f ASCII $?

dump:	GapBuffer.hh
		../../bin/synopsis -p C++ -Wp,-C -f DUMP $?

test:	test.cc
		$(synopsis_one) -o html $?

templates: templates.cc
	$(synopsis_one) -o templates $?

GapBuffer.syn GapBuffer.hh-xref:	GapBuffer.hh
		$(synopsis) -Wc,parser=C++,linker=Linker -Wp,-x,GapBuffer.hh-xref,-s,GapBuffer.hh-links -o GapBuffer.syn $?

GapBuffer.xref:	GapBuffer.hh-xref
		../../bin/compile-xref -o $@ $?

html:	GapBuffer.xref GapBuffer.syn
		$(synopsis) -Wc,formatter=XrefHTML -o html GapBuffer.syn

sxr:	GapBuffer.xref GapBuffer.syn
		$(synopsis) -Wc,formatter=SxrHTML -o sxr GapBuffer.syn

test-xref: GapBuffer.xref
		../../bin/search-xref GapBuffer.xref name curs

htmls:	GapBuffer.hh
		../../bin/synopsis -p C++ -Wp,-m -f HTML_Simple -Wf,-s,style.css -o gap_htmls.html $?

GapBuffer.texi:	GapBuffer.hh
		../../bin/synopsis -c config.py -Wc,parser=C++,formatter=TexInfo,linker=Linker -o $@ $?

texi:	GapBuffer.texi

pdf:	texi
		texi2pdf GapBuffer-Manual.texi

employee:	employee.cc
		$(synopsis) -Wc,parser=C++,linker=Linker-employee,formatter=HTML -o employee $?

module:	module.cc
		$(synopsis) -Wc,parser=C++,linker=Linker-module,formatter=HTML -o module $?

uml:	shapes.ps

shapes.ps:	shapes.cc
		../../bin/synopsis -p C++ -Wp,-m -f Dot -Wf,-f,ps -Wf,-i -Wf,-O -Wf,-A -o $@ $?

shapes:		shapes.cc
		echo $(synopsis) -o shapes $?
		$(synopsis_one) -o shapes $?


clean:
		rm -rf *~ *.html *.ps *.syn core *.aux *.fn *.cp *.tp *.vr *.log *.ky *.pg \
		       *.fns *.tps *.vrs *.pdf html GapBuffer.texi employee module *.pyc *.pyo \
		       GapBuffer.hh-xref GapBuffer.hh-links GapBuffer.syn GapBuffer.xref sxr \
		       GapBuffer shapes ExtraFiles ExtraLinks ExtraXRef ExtraHTML

distclean:	clean
