BASEDIR = $(PWD)/../../..

include $(BASEDIR)/include/Makefile_base

ALL_FTN_SRC    = $(shell ls *.ftn 2>/dev/null)
ALL_FTN90_SRC  = $(shell ls *.ftn90 2>/dev/null)
ALL_C_SRC      = $(shell ls *.c 2>/dev/null)

ALL_OBJ = $(patsubst %.ftn, %.o, $(ALL_FTN_SRC)) $(patsubst %.ftn90, %.o, $(ALL_FTN90_SRC))  $(patsubst %.c, %.o, $(ALL_C_SRC))

TESTMAIN = __NO_SUCH_TEST__

default: all

all: $(ALL_OBJ)

test: all
	$(BASEDIR)/scripts/runtests.ksh

testabs: all
	$(MK_ABS) $(TESTMAIN).Abs -bidon -main $(TESTMAIN) ;\

clean: clean0
	rm -f *.log POE_SCRIPT_* R_MpirunScript_*

#
# ALL dependencies ...
#

test_file_utils.o: test_file_utils.ftn90 ../utils4tests.hf
test_handle_error.o: test_handle_error.ftn90 ../utils4tests.hf
test_handle_error2.o: test_handle_error2.ftn90 ../utils4tests.hf
test_msg.o: test_msg.ftn90 ../msg.h ../utils4tests.hf
test_stop_mpi.o: test_stop_mpi.ftn90 ../stop_mpi.h ../utils4tests.hf
