1-include ../../../../../petscdir.mk
2CFLAGS           =
3CXXFLAGS         = ${AMREX_INCLUDE}
4FFLAGS		 =
5CPPFLAGS         =
6FPPFLAGS         =
7LOCDIR		 = src/ksp/ksp/tutorials/amrex/
8MANSEC           = KSP
9EXAMPLESC	 =
10EXAMPLESF	 =
11EXAMPLESCH	 = MyEB.H MyTest.H
12EXAMPLESFH       =
13OBJECTS          = main.o MyTest.o initEB.o
14
15include ${PETSC_DIR}/lib/petsc/conf/variables
16include ${PETSC_DIR}/lib/petsc/conf/rules
17
18# TODO: have configure determine  -Wl,-undefined,dynamic_lookup for all OS
19
20amrex: $(OBJECTS)
21	-${CXXLINKER} -o amrex $(OBJECTS) ${AMREX_LIB} -Wl,-undefined,dynamic_lookup ${PETSC_KSP_LIB}
22	${RM} $(OBJECTS)
23
24#-------------------------------------------------------------------------
25
26#  these tests are used by the makefile in PETSC_DIR for basic tests of the install and should not be removed
27testamrex: amrex
28	@if [ "${PETSC_WITH_BATCH}" != "" ]; then \
29           echo "Running with batch filesystem; to test run src/ksp/ksp/tutorials/amrex/amrex with" ; \
30           echo "your systems batch system"; \
31        elif [ "${MPIEXEC}" = "/bin/false" ]; then \
32           echo "*mpiexec not found*. Please run src/ksp/ksp/tutorials/amrex/amrex manually"; \
33        elif [ -f amrex ]; then \
34	   ${MPIEXEC} -n 1 ./amrex inputs.rt.2d.petsc | egrep -v "(AMReX|Timers)" > amrex_1.tmp 2>&1; \
35	   if (${DIFF} output/amrex_1.testout amrex_1.tmp > /dev/null 2>&1) then \
36           echo "example src/ksp/ksp/tutorials/amrex/amrex run successfully with 1 MPI process"; \
37	   else echo "Possible error running  example src/ksp/ksp/tutorials/amrex/amrex with 1 MPI process"; \
38           echo "See http://www.mcs.anl.gov/petsc/documentation/faq.html";\
39           cat amrex_1.tmp; fi;  \
40         ${RM} -f amrex_1.tmp; fi
41
42include ${PETSC_DIR}/lib/petsc/conf/test
43