X-Git-Url: http://git.annexia.org/?p=jonesforth.git;a=blobdiff_plain;f=Makefile;h=f5a74941b2ba9873f019afff703fd6fd05aaf745;hp=21ad0d6156095ac3418b3795fd7c49443b260ba6;hb=465979550d58288f6bee28c49064d9c841a6f45f;hpb=c503d1950a0ae76db7257ca63d16034752c071da diff --git a/Makefile b/Makefile index 21ad0d6..f5a7494 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,44 @@ -# $Id: Makefile,v 1.4 2007-09-25 21:45:26 rich Exp $ +# $Id: Makefile,v 1.7 2007-10-10 13:01:05 rich Exp $ -all: - gcc -m32 -nostdlib -static -Wl,-Ttext,0 -o jonesforth jonesforth.S +SHELL := /bin/bash + +all: jonesforth + +jonesforth: jonesforth.S + gcc -m32 -nostdlib -static -Wl,-Ttext,0 -Wl,--build-id=none -o $@ $< run: - cat jonesforth.f - | ./jonesforth + cat jonesforth.f $(PROG) - | ./jonesforth + +clean: + rm -f jonesforth *~ core .test_* + +# Tests. + +TESTS := $(patsubst %.f,%.test,$(wildcard test_*.f)) + +test check: $(TESTS) + +test_%.test: test_%.f jonesforth + @echo -n "$< ... " + @rm -f .$@ + @cat <(echo ': TEST-MODE ;') jonesforth.f $< <(echo 'TEST') | \ + ./jonesforth 2>&1 | \ + sed 's/DSP=[0-9]*//g' > .$@ + @diff -u .$@ $<.out + @rm -f .$@ + @echo "ok" + +# Performance. + +perf_dupdrop: perf_dupdrop.c + gcc -O3 -Wall -Werror -o $@ $< + +.SUFFIXES: .f .test +.PHONY: test check remote: scp jonesforth.S jonesforth.f rjones@oirase:Desktop/ ssh rjones@oirase sh -c '"rm -f Desktop/jonesforth; \ gcc -m32 -nostdlib -static -Wl,-Ttext,0 -o Desktop/jonesforth Desktop/jonesforth.S; \ - cat Desktop/jonesforth.f - | Desktop/jonesforth"' + cat Desktop/jonesforth.f - | Desktop/jonesforth arg1 arg2 arg3"'