2001-10-21 Michael Hope <michaelh@juju.net.nz>
[fw/sdcc] / support / tests / dhrystone / Makefile
index f97747e585c942703aab181cd2e373862cf5746d..62d194fa2e982ccf6e55d15d24705bac0bb9d051 100644 (file)
@@ -1,10 +1,30 @@
 # Simple Makefile for dhrystone and sdcc
+TOPDIR = ../../..
 
-CC = /home/michaelh/projects/sdcc/bin/sdcc -mz80 -v
-CFLAGS = -DREG= -DNOSTRUCTASSIGN -DNOENUM
+PROC = z80
 
-all: dhry
+CC = $(TOPDIR)/bin/sdcc
+
+# -DNOENUM is here to make the results more predictable
+CFLAGS += -DREG= -DNOSTRUCTASSIGN -DNOENUM -V -m$(PROC) --profile --dumpall --stack-auto
+
+OBJ = dhry.o
+
+all: dhry.bin
+
+dhry.ihx: dhry.c
+       $(CC) $(CFLAGS) dhry.c
+
+dhry.gb: dhry.c
+       $(CC) $(CFLAGS) dhry.c
+
+dhry.c: dhry.h
+
+dhry.bin: dhry.ihx
+       cat $< | $(TOPDIR)/bin/makebin > $@
+
+native:
+       gcc -g -O2 -DREG= -DNOSTRUCTASSIGN -DNOENUM -o dhry dhry.c
 
 clean:
-       rm -r *~ dhry
-       
+       rm -f *~ dhry *.o *.gb *.ihx *.rel *.dump* *.lst *.sym *.map *.asm *.bin *.gb