#-------------------------------------------------------------------------------
SHELL = /bin/sh
CDBMERGE = $(HOME)/local/sh/cdbmerge
CDBTAGPDF = $(HOME)/local/sh/cdbtags
#-------------------------------------------------------------------------------
.PHONY: all
#-------------------------------------------------------------------------------
all: .symm-riemann .metric .metric-inv .connection .gen-gamma\
		.geodesic-ivp .geodesic-bvp .geodesic-rnc .geodesic-lsq\
		.check-gamma\
		.summary .reformat04 .reformat06
#-------------------------------------------------------------------------------
.symm-riemann: symm-riemann.cdbp symm-riemann.cfg
			make symm-riemann
.metric: metric.cdbp metric.cfg\
			.symm-riemann
			make metric
.metric-inv: metric-inv.cdbp metric-inv.cfg\
			.symm-riemann .metric
			make metric-inv
.connection: connection.cdbp connection.cfg\
			.metric .metric-inv 
			make connection
.gen-gamma: gen-gamma.cdbp gen-gamma.cfg\
			.connection
			make gen-gamma
.geodesic-ivp: geodesic-ivp.cdbp geodesic-ivp.cfg\
			.metric .metric-inv .connection
			make geodesic-ivp
.geodesic-bvp: geodesic-bvp.cdbp geodesic-bvp.cfg\
			.metric .metric-inv .connection .geodesic-ivp
			make geodesic-bvp
.geodesic-rnc: geodesic-rnc.cdbp geodesic-rnc.cfg\
			.metric .metric-inv .connection .geodesic-ivp .geodesic-bvp
			make geodesic-rnc
.geodesic-lsq: geodesic-lsq.cdbp geodesic-lsq.cfg\
			.metric .metric-inv .connection .geodesic-ivp .geodesic-bvp .geodesic-rnc
			make geodesic-lsq
.check-gamma: check-gamma.cdbp check-gamma.cfg\
			.metric .connection
			make check-gamma
.summary: summary.texp summary.cfg\
			.metric .metric-inv .connection .gen-gamma\
			.geodesic-ivp .geodesic-bvp .geodesic-rnc\
			.geodesic-lsq
			make summary
.reformat04: reformat04.cdbp reformat04.cfg\
			.metric .metric-inv .connection .gen-gamma\
			.geodesic-ivp .geodesic-bvp .geodesic-rnc\
			.geodesic-lsq
			make reformat04
.reformat06: reformat06.cdbp reformat06.cfg\
			.metric .metric-inv .connection .gen-gamma\
			.geodesic-ivp .geodesic-bvp .geodesic-rnc\
			.geodesic-lsq
			make reformat06
#-------------------------------------------------------------------------------
summary:
	$(CDBTAGPDF) $@
	touch .$@
#-------------------------------------------------------------------------------
%:
	$(CDBMERGE) $*
	touch .$*
#-------------------------------------------------------------------------------
clean:
	rm -f *.aux *.dvi *.log *.tmp *.xcd *.eqn tmp*.* core.*
#-------------------------------------------------------------------------------
veryclean:
	make clean
	rm -f .metric .metric-inv .connection .geodesic-* .check-gamma .gen-gamma\
	      .summary .reformat0* .symm-riemann
