LISP=gcl
TEST=${HOME}
# TEST=/u8/temp
# TEST=/public/tmp/wfs
NQTHM=${HOME}/nqthm
TMP=$(TEST)/tmptest

# (cd gcl ; make -f xbin/maketest) # does compilation and test of nqthm
# (cd gcl ; make -f xbin/maketest "TAR=/usr2/ftp/gcl.tar.Z") # does compilation of gcl and runs test of nqthm in the resulting lisp

all:	
	xbin/setup-tmptest $(TMP) $(TEST) $(NQTHM)
	(cd $(TMP) ; echo '(load "nqthm.lisp")(compile-nqthm)' | ${LISP})
	make -f xbin/maketest run-test "LISP=${LISP}"
	make -f xbin/maketest sgc "LISP=${LISP}"

# untar the tar file ${TAR} in ${TEST}/tmp/gcl  and make
# then make -f xbin/maketest all
make:
	xbin/test1 ${TEST} ${TAR}	
	
run-test:
	(cd $(TMP) ; echo '(load "nqthm.lisp")(load-nqthm)' \
	'(SETQ *THM-SUPPRESS-DISCLAIMER-FLG* T)' \
	'(load "little.lisp")' | ${LISP})

# we run the compiler 10 times with sgc on and compare with the result with
# sgc off.
sgc:
	cp lsp/sloop.lsp /tmp
	echo '(compile-file "/tmp/sloop.lsp" :c-file t :o-file nil)' | ${LISP}
	mv /tmp/sloop.c /tmp/sloop-reg.c
	echo '(setq si::*notify-gbc* t)(si::sgc-on t)' \
	'(dotimes (i 10) (compile-file "/tmp/sloop.lsp" :c-file t :o-file nil)' \
	'(if (not (eql 0 (system "diff /tmp/sloop.c /tmp/sloop-reg.c")))' \
	'(error ">>>>ERROR: The compilation DIFFERED")))' | ${LISP}
	diff /tmp/sloop.c /tmp/sloop-reg.c
	rm -f /tmp/sloop.lsp /tmp/sloop.c /tmp/sloop-reg.c

	



