aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/bitsliced-aes
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-02-05 17:54:19 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-02-05 17:54:19 +0100
commit68ae38729f271d88024dd642057fb33899e8816b (patch)
treead4f89381d59c0efa5b03e5ade36ddc875ce231f /test/monniaux/bitsliced-aes
parentb7f386c026a573708451ca20b015c021f3f82205 (diff)
downloadcompcert-kvx-68ae38729f271d88024dd642057fb33899e8816b.tar.gz
compcert-kvx-68ae38729f271d88024dd642057fb33899e8816b.zip
regular Makefiles
Diffstat (limited to 'test/monniaux/bitsliced-aes')
-rw-r--r--test/monniaux/bitsliced-aes/Makefile70
-rw-r--r--test/monniaux/bitsliced-aes/Makefile.ccomp40
-rw-r--r--test/monniaux/bitsliced-aes/main.c2
3 files changed, 45 insertions, 67 deletions
diff --git a/test/monniaux/bitsliced-aes/Makefile b/test/monniaux/bitsliced-aes/Makefile
index 65de1e2e..1c32801a 100644
--- a/test/monniaux/bitsliced-aes/Makefile
+++ b/test/monniaux/bitsliced-aes/Makefile
@@ -1,40 +1,56 @@
-src = $(wildcard *.c)
-obj = $(src:.c=.o)
+src = $(wildcard *.c) tests/tests.c
-CC=k1-mbr-gcc
-LDFLAGS = -Wl,--gc-sections
-CFLAGS = -O3 -fdata-sections -ffunction-sections # -DUNROLL_TRANSPOSE
-name = bitslice
+CCOMP=ccomp
+CCOMPFLAGS=-O3 -Wall
+K1C_CC=k1-mbr-gcc
+K1C_CFLAGS = -std=c99 -O3 -Wall -Wextra -Werror=implicit
+K1C_CCOMP = ../../../ccomp
+K1C_CCOMPFLAGS=-O3 -Wall
-%.s : %.c
- $(CC) $(CFLAGS) -S -o $@ $<
+%.host.gcc.o : %.c
+ $(CC) $(CFLAGS) -c -o $@ $<
-test: _test $(obj)
- $(CC) $(LDFLAGS) -o $(name) $(obj) ../clock.o $(LDFLAGS)
+%.host.ccomp.o : %.c
+ $(CCOMP) $(CCOMPFLAGS) -c -o $@ $<
-$(name): _testbench $(obj)
- $(CC) $(LDFLAGS) -o $@ $(obj) $(LDFLAGS)
+%.gcc.k1c.s: %.c
+ $(K1C_CC) $(K1C_CFLAGS) -S $< -o $@
-footprint: _footprint $(obj)
- $(CC) $(LDFLAGS) -o $(name) $(obj) $(LDFLAGS)
+%.gcc.k1c.o: %.gcc.k1c.s
+ $(K1C_CC) $(K1C_CFLAGS) -c $< -o $@
+%.ccomp.k1c.s: %.c
+ $(K1C_CCOMP) $(K1C_CCOMPFLAGS) -S $< -o $@
-_test: tests/tests.c
- $(eval obj+=$@.o)
- $(eval CFLAGS+= -DRUN_TESTS=1)
- $(CC) -c $(CFLAGS) -o $@.o $^
+%.ccomp.k1c.o: %.ccomp.k1c.s
+ $(K1C_CCOMP) $(K1C_CCOMPFLAGS) -c $< -o $@
-_footprint: tests/tests.c
- $(eval obj+=$@.o)
- $(eval CFLAGS+= -DRUN_TESTS=1 -DTEST_FOOTPRINT=1)
- $(CC) -c $(CFLAGS) -o $@.o $^
+%.gcc.host.o: %.c
+ $(CC) $(CFLAGS) -c $< -o $@
-_testbench: testbench/app.c
- $(eval obj+=_testbench.o)
- $(eval LDFLAGS+= -lcrypto)
- $(CC) -c $(CFLAGS) -o $@.o $^
+%.ccomp.host.o: %.c
+ $(CCOMP) $(CCOMPFLAGS) -c $< -o $@
+%.k1c.out : %.k1c
+ k1-cluster --cycle-based -- $< |tee $@
+
+%.host.out : %.host
+ ./$< |tee $@
+
+all: test.gcc.k1c.out test.ccomp.k1c.out test.gcc.host.out test.ccomp.host.out
+
+test.gcc.k1c: $(src:.c=.gcc.k1c.o) ../clock.gcc.k1c.o
+ $(K1C_CC) $(K1C_CFLAGS) -o $@ $+
+
+test.ccomp.k1c: $(src:.c=.ccomp.k1c.o) ../clock.gcc.k1c.o
+ $(K1C_CCOMP) $(K1C_CCOMPFLAGS) -o $@ $+
+
+test.gcc.host: $(src:.c=.gcc.host.o) ../clock.gcc.host.o
+ $(CC) $(CFLAGS) -o $@ $+
+
+test.ccomp.host: $(src:.c=.ccomp.host.o) ../clock.gcc.host.o
+ $(CCOMP) $(CCOMPFLAGS) -o $@ $+
clean:
- rm -f $(obj) _test.o _footprint.o _testbench.o $(name)
+ rm -f *.o *.k1c *.host */*.o *.s */*.s *.out
diff --git a/test/monniaux/bitsliced-aes/Makefile.ccomp b/test/monniaux/bitsliced-aes/Makefile.ccomp
deleted file mode 100644
index beb0ad39..00000000
--- a/test/monniaux/bitsliced-aes/Makefile.ccomp
+++ /dev/null
@@ -1,40 +0,0 @@
-src = $(wildcard *.c)
-obj = $(src:.c=.o)
-
-LDFLAGS = -Wl,--gc-sections
-CFLAGS = -O3 -D_DEFAULT_SOURCE # -DUNROLL_TRANSPOSE
-# CC=ccomp
-CC=../../../ccomp
-name = bitslice
-
-%.s : %.c
- $(CC) $(CFLAGS) -S -o $@ $<
-
-test: _test $(obj)
- $(CC) $(LDFLAGS) -o $(name) $(obj) ../clock.o $(LDFLAGS)
-
-$(name): _testbench $(obj)
- $(CC) $(LDFLAGS) -o $@ $(obj) $(LDFLAGS)
-
-footprint: _footprint $(obj)
- $(CC) $(LDFLAGS) -o $(name) $(obj) $(LDFLAGS)
-
-
-_test: tests/tests.c
- $(eval obj+=$@.o)
- $(eval CFLAGS+= -DRUN_TESTS=1)
- $(CC) -c $(CFLAGS) -o $@.o $^
-
-_footprint: tests/tests.c
- $(eval obj+=$@.o)
- $(eval CFLAGS+= -DRUN_TESTS=1 -DTEST_FOOTPRINT=1)
- $(CC) -c $(CFLAGS) -o $@.o $^
-
-_testbench: testbench/app.c
- $(eval obj+=_testbench.o)
- $(eval LDFLAGS+= -lcrypto)
- $(CC) -c $(CFLAGS) -o $@.o $^
-
-
-clean:
- rm -f $(obj) _test.o _footprint.o _testbench.o $(name)
diff --git a/test/monniaux/bitsliced-aes/main.c b/test/monniaux/bitsliced-aes/main.c
index 96d545ae..83588872 100644
--- a/test/monniaux/bitsliced-aes/main.c
+++ b/test/monniaux/bitsliced-aes/main.c
@@ -6,6 +6,8 @@
#include "utils.h"
#include "../clock.h"
+#define RUN_TESTS
+
#include "testbench/app.h"
#ifdef RUN_TESTS
#include "tests/tests.h"