$MAKE=gmake
include local.mk

all: spin mslib scripts/mpi_spin_constants.pl bin/ms bin/mscc bin/mstest
	$(WRAPUP)

spin:
	cd Spin-M/Src*; $(MAKE)

mslib:
	cd src; $(MAKE)

scripts/mpi_spin_constants.pl: Makefile scripts/make_mpi_spin_constants.pl
	perl scripts/make_mpi_spin_constants.pl

bin/ms: Makefile scripts/make_ms.pl
	perl scripts/make_ms.pl

bin/mscc: Makefile scripts/make_mscc.pl
	perl scripts/make_mscc.pl

bin/mstest: Makefile scripts/make_mstest.pl
	perl scripts/make_mstest.pl

doc:
	cd doc; $(MAKE)

clean:
	cd src; $(MAKE) clean
	cd examples; $(MAKE) clean
	cd Spin-M/Src*; $(MAKE) clean
	rm -f bin/ms bin/mscc bin/mstest bin/*~  \
          scripts/mpi_spin_constants.pl scripts/*~ *~
	if [ -d bin ]; then rmdir bin; fi

develop: all doc

develop_clean: clean
	cd doc; $(MAKE) clean
