.IGNORE:

SHELL = /bin/sh

RNPL = src
AUX  = etc doc \
       examples/wave1d/c   examples/wave2d/c   examples/wave3d/c \
       examples/wave1d/f77 examples/wave2d/f77 examples/wave3d/f77
       
all: rnpl aux
full: rnpl aux test

rnpl:
	echo; echo "Compiling and installing RNPL" 
	(cd $(RNPL); make install)

aux: 
	echo; echo "Compiling and installing utilities and example programs," 
	echo; echo "and LaTexing documentation"
	for f in $(AUX); do \
		(cd $$f; make all) \
	done

test:
	echo; echo "Running and evaluating tests"
	(cd etc; ./checkx)

makex:
	echo; echo "Making expected results for tests"
	(cd etc; ./makex)

clean:
	echo; echo "Cleaning up"
	rm Makefile config.cache config.log config.status > /dev/null 2>&1
	(cd $(RNPL); make clean)
	for f in $(AUX); do \
      (cd $$f; make clean) \
	done
