diff options
-rw-r--r-- | test/monniaux/clock.c | 4 | ||||
-rw-r--r-- | test/monniaux/clock.h | 2 | ||||
-rw-r--r-- | test/monniaux/ncompress/Makefile | 44 | ||||
-rw-r--r-- | test/monniaux/ncompress/compress42.c | 5 |
4 files changed, 42 insertions, 13 deletions
diff --git a/test/monniaux/clock.c b/test/monniaux/clock.c index e91adc99..d72528d8 100644 --- a/test/monniaux/clock.c +++ b/test/monniaux/clock.c @@ -22,3 +22,7 @@ cycle_t get_total_clock(void) { void print_total_clock(void) { printf("cycles: %lu\n", total_clock); } + +void printerr_total_clock(void) { + fprintf(stderr, "cycles: %lu\n", total_clock); +} diff --git a/test/monniaux/clock.h b/test/monniaux/clock.h index b5ee65a4..43fd7c5c 100644 --- a/test/monniaux/clock.h +++ b/test/monniaux/clock.h @@ -1,6 +1,8 @@ typedef unsigned long cycle_t; +void clock_prepare(void); void clock_stop(void); void clock_start(void); cycle_t get_total_clock(void); void print_total_clock(void); +void printerr_total_clock(void); diff --git a/test/monniaux/ncompress/Makefile b/test/monniaux/ncompress/Makefile index 37743851..960d04d0 100644 --- a/test/monniaux/ncompress/Makefile +++ b/test/monniaux/ncompress/Makefile @@ -22,35 +22,53 @@ all: check %.ccomp.k1c.o: %.ccomp.k1c.s $(K1C_CCOMP) $(K1C_CCOMPFLAGS) -c $< -o $@ +%.gcc.host.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ + all: compress.gcc.host compress.ccomp.host compress.gcc.k1c compress.ccomp.k1c -compress.gcc.host : compress42.c - $(CC) $(CFLAGS) $< -o $@ +compress.gcc.host : compress42.c ../clock.gcc.host.o + $(CC) $(CFLAGS) $+ -o $@ -compress.ccomp.host : compress42.c - $(CCOMP) $(CCOMPFLAGS) $< -o $@ +compress.ccomp.host : compress42.c ../clock.gcc.host.o + $(CCOMP) $(CCOMPFLAGS) $+ -o $@ -compress.gcc.k1c : compress42.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS) $< -o $@ +compress.gcc.k1c : compress42.gcc.k1c.o ../clock.gcc.k1c.o + $(K1C_CC) $(K1C_CFLAGS) $+ -o $@ -compress.ccomp.k1c : compress42.ccomp.k1c.o - $(K1C_CCOMP) $(K1C_CCOMPFLAGS) $< -o $@ +compress.ccomp.k1c : compress42.ccomp.k1c.o ../clock.gcc.k1c.o + $(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@ INFILE=Makefile COMPRESSED=foo.gcc.host.Z foo.gcc.host.Z: compress.gcc.host $(INFILE) - ./compress.gcc.host <$(INFILE) >$@ + ./compress.gcc.host <$(INFILE) >foo.gcc.host.Z 2> foo.gcc.host.Z.out foo.ccomp.k1c.Z: compress.ccomp.k1c $(INFILE) - $(EXECUTE) ./compress.ccomp.k1c <$(INFILE) >$@ + $(EXECUTE) ./compress.ccomp.k1c <$(INFILE) >foo.ccomp.k1c.Z 2> foo.ccomp.k1c.Z.out + +foo.gcc.k1c.Z: compress.gcc.k1c $(INFILE) + $(EXECUTE) ./compress.gcc.k1c <$(INFILE) >foo.gcc.k1c.Z 2> foo.gcc.k1c.Z.out foo.gcc.host.txt: compress.gcc.host $(COMPRESSED) - ./compress.gcc.host -d <$(COMPRESSED) >$@ + ./compress.gcc.host -d <$(COMPRESSED) >foo.gcc.host.txt 2> foo.gcc.host.txt.out foo.ccomp.k1c.txt: compress.gcc.host $(COMPRESSED) - $(EXECUTE) ./compress.ccomp.k1c -d <$(COMPRESSED) >$@ + $(EXECUTE) ./compress.ccomp.k1c -d <$(COMPRESSED) >foo.ccomp.k1c.txt 2> foo.ccomp.k1c.txt.out + +foo.gcc.k1c.txt: compress.gcc.host $(COMPRESSED) + $(EXECUTE) ./compress.gcc.k1c -d <$(COMPRESSED) >foo.gcc.k1c.txt 2> foo.gcc.k1c.txt.out -check: foo.gcc.host.Z foo.ccomp.k1c.Z foo.gcc.host.txt foo.ccomp.k1c.txt +check: foo.gcc.host.Z foo.gcc.host.txt foo.ccomp.k1c.Z foo.ccomp.k1c.txt foo.gcc.k1c.Z foo.gcc.k1c.txt cmp foo.gcc.host.Z foo.ccomp.k1c.Z + cmp foo.gcc.host.Z foo.gcc.k1c.Z cmp foo.gcc.host.txt foo.ccomp.k1c.txt + cmp foo.gcc.host.txt foo.gcc.k1c.txt + +clean: + rm -f *.Z *.txt *.out *.o *.s *.host *.k1c + +.PHONY: clean + +.SECONDARY: %.s diff --git a/test/monniaux/ncompress/compress42.c b/test/monniaux/ncompress/compress42.c index a5b394b9..681dbbff 100644 --- a/test/monniaux/ncompress/compress42.c +++ b/test/monniaux/ncompress/compress42.c @@ -133,6 +133,7 @@ /* FIXME DMonniaux */ #define INT_MOD(x, y) ((long) (x) % (y)) +#include "../clock.h" #ifdef _MSC_VER # define WINDOWS @@ -712,6 +713,8 @@ main(argc, argv) REG1 int argc; REG2 char *argv[]; { + clock_prepare(); + clock_start(); REG3 char **filelist; REG4 char **fileptr; int seen_double_dash = 0; @@ -887,6 +890,8 @@ nextarg: continue; else decompress(0, 1); } + clock_stop(); + printerr_total_clock(); exit((exit_code== -1) ? 1:exit_code); } |