Assembly code.
[jonesforth.git] / Makefile
1 # $Id: Makefile,v 1.7 2007-10-10 13:01:05 rich Exp $
2
3 SHELL   := /bin/bash
4
5 all:    jonesforth
6
7 jonesforth: jonesforth.S
8         gcc -m32 -nostdlib -static -Wl,-Ttext,0 -Wl,--build-id=none -o $@ $<
9
10 run:
11         cat jonesforth.f $(PROG) - | ./jonesforth
12
13 clean:
14         rm -f jonesforth *~ core .test_*
15
16 # Tests.
17
18 TESTS   := $(patsubst %.f,%.test,$(wildcard test_*.f))
19
20 test check: $(TESTS)
21
22 test_%.test: test_%.f jonesforth
23         @echo -n "$< ... "
24         @rm -f .$@
25         @cat <(echo ': TEST-MODE ;') jonesforth.f $< <(echo 'TEST') | \
26           ./jonesforth 2>&1 | \
27           sed 's/DSP=[0-9]*//g' > .$@
28         @diff -u .$@ $<.out
29         @rm -f .$@
30         @echo "ok"
31
32 # Performance.
33
34 perf_dupdrop: perf_dupdrop.c
35         gcc -O3 -Wall -Werror -o $@ $<
36
37 .SUFFIXES: .f .test
38 .PHONY: test check
39
40 remote:
41         scp jonesforth.S jonesforth.f rjones@oirase:Desktop/
42         ssh rjones@oirase sh -c '"rm -f Desktop/jonesforth; \
43           gcc -m32 -nostdlib -static -Wl,-Ttext,0 -o Desktop/jonesforth Desktop/jonesforth.S; \
44           cat Desktop/jonesforth.f - | Desktop/jonesforth arg1 arg2 arg3"'