# Macaulay2/packages/Macaulay2Doc/basictests/Makefile.  Generated from Makefile.in by configure.

# DOTS is the path to M2/Macaulay2 from this directory
DOTS ?= ../../..

include $(DOTS)/../include/config.Makefile


CPPFLAGS := -I$(DOTS)/../include $(CPPFLAGS) 
CPPFLAGS += -I$(DOTS)/../libraries/final/include

LDFLAGS += -L$(DOTS)/../libraries/final/lib

TESTRESULTS := $(notdir $(patsubst %.m2, %.okay, $(wildcard ./*.m2)))

all:
all:check
check: $(TESTRESULTS) check-gc

$(TESTRESULTS) : /builddir/build/BUILD/Macaulay2-1.5/StagingArea/i686-Linux-Fedora-19/bin/M2

ARGS := --silent -q --stop --no-loaddata --no-setup -e 'srcdir = "./"'

ifeq "no" "no"
TLIMIT ?= 20
MLIMIT ?= 600000
VLIMIT ?= 600000
else
TLIMIT ?= 60
MLIMIT ?= 700000
VLIMIT ?= 700000
endif

# make the stack limit always the same as it would be under MacOS
SLIMIT ?= 8192

LIMIT :=
ifeq (yes,yes)
LIMIT += ulimit -t $(TLIMIT) ;
endif
ifeq (yes,yes)
LIMIT += ulimit -m $(MLIMIT) ;
endif
ifeq (yes,yes)
LIMIT += ulimit -v $(VLIMIT) ;
endif
ifeq (yes,yes)
LIMIT += ulimit -s $(SLIMIT) ;
endif

%.okay : %.m2
	@ echo testing $<
	@ $(LIMIT) env /builddir/build/BUILD/Macaulay2-1.5/StagingArea/i686-Linux-Fedora-19/bin/M2 $(ARGS) $< -e 'exit 0'
	@ touch $@

clean::	; rm -f *.okay
LOADLIBES += -lgc
testgc:
check-gc: testgc.okay
testgc.okay : testgc ; ./testgc && touch $@
clean::; rm -f testgc
clean::; rm -rf *.dSYM
Makefile : Makefile.in ; cd $(DOTS)/.. && ./config.status Macaulay2/packages/Macaulay2Doc/basictests/Makefile
distclean :clean; rm -f Makefile
check: check-return-code
check-return-code :; if echo 'error "foo"' | /builddir/build/BUILD/Macaulay2-1.5/StagingArea/i686-Linux-Fedora-19/bin/M2 $(ARGS) 2>/dev/null 1>&2 ; then false ; else true ; fi

# Local Variables:
# compile-command: "make -C $M2BUILDDIR/Macaulay2/packages/Macaulay2Doc/basictests "
# End:
