X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=Makefile;h=d47b4d2502ee144528cab227443ebf1b84f18582;hb=cea392870a443a3d773d18d1627fa94712387cf5;hp=ea0b9704b9bb7f1a46dd290ee1a39becfa67699d;hpb=279fbb489713c126aa4a8c55d56c48b65a08c721;p=rrq%2Fjonesforth.git diff --git a/Makefile b/Makefile index ea0b970..d47b4d2 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,47 @@ -# $Id: Makefile,v 1.2 2007-09-15 11:21:09 rich Exp $ +# $Id: Makefile,v 1.8 2007-10-11 07:45:35 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: - ./jonesforth + cat jonesforth.f $(PROG) - | ./jonesforth + +clean: + rm -f jonesforth perf_dupdrop *~ 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 $@ $< + +run_perf_dupdrop: jonesforth + cat <(echo ': TEST-MODE ;') jonesforth.f perf_dupdrop.f | ./jonesforth + +.SUFFIXES: .f .test +.PHONY: test check run run_perf_dupdrop + +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 arg1 arg2 arg3"'