2003-03-07 02:23:54 +03:00
|
|
|
include ../config.mak
|
|
|
|
|
2003-02-24 23:14:06 +03:00
|
|
|
CFLAGS=-Wall -O2 -g
|
|
|
|
LDFLAGS=
|
|
|
|
|
2003-03-07 02:23:54 +03:00
|
|
|
ifeq ($(ARCH),i386)
|
2003-03-06 01:24:26 +03:00
|
|
|
TESTS=hello test2 sha1 test-i386
|
2003-03-07 02:23:54 +03:00
|
|
|
endif
|
2003-03-01 20:13:26 +03:00
|
|
|
|
2003-02-24 23:14:06 +03:00
|
|
|
GEMU=../gemu
|
|
|
|
|
|
|
|
all: $(TESTS)
|
|
|
|
|
|
|
|
hello: hello.c
|
|
|
|
$(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
test2: test2.c
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
# i386 emulation test (dump various opcodes) */
|
2003-03-04 04:14:13 +03:00
|
|
|
test-i386: test-i386.c test-i386.h test-i386-shift.h test-i386-muldiv.h
|
2003-03-05 23:57:02 +03:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ $< -lm
|
2003-02-24 23:14:06 +03:00
|
|
|
|
|
|
|
test: test-i386
|
|
|
|
./test-i386 > test-i386.ref
|
|
|
|
$(GEMU) test-i386 > test-i386.out
|
|
|
|
@if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi
|
|
|
|
|
|
|
|
# speed test
|
|
|
|
sha1: sha1.c
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
speed: sha1
|
|
|
|
time ./sha1
|
|
|
|
time $(GEMU) sha1
|
|
|
|
|
2003-03-07 02:23:54 +03:00
|
|
|
clean:
|
|
|
|
rm -f *~ *.o $(TESTS)
|