summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-01-26 04:24:19 +0100
committerLouis Burda <quent.burda@gmail.com>2023-01-26 04:24:19 +0100
commit5e21196a9c7ee8eee921d74f6b5eef2f1980ec97 (patch)
treebaea207295fe1ad257506a8de08c1b64f06fbd4e /Makefile
parentcb7c6b3d6767335d13892451c141cfb717807712 (diff)
downloadcachepc-5e21196a9c7ee8eee921d74f6b5eef2f1980ec97.tar.gz
cachepc-5e21196a9c7ee8eee921d74f6b5eef2f1980ec97.zip
Basic qemu eviction test with signalled stepping and added rip syscall
Diffstat (limited to 'Makefile')
-rwxr-xr-xMakefile27
1 files changed, 16 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index c54743e..59143c9 100755
--- a/Makefile
+++ b/Makefile
@@ -9,13 +9,15 @@ BINS = test/eviction test/kvm-eviction
BINS += test/kvm-eviction-with_guest test/kvm-eviction-without_guest
BINS += test/kvm-step test/kvm-step_guest
BINS += test/kvm-pagestep test/kvm-pagestep_guest
-# BINS += test/qemu-eviction_guest test/qemu-eviction
+BINS += test/qemu-eviction test/qemu-eviction_guest
# BINS += test/qemu-aes_guest test/qemu-aes
BINS += util/debug util/reset
CFLAGS = -I . -I linux/usr/include
CFLAGS += -g -Wunused-variable -Wunknown-pragmas -Wunused-function
-CFLAGS += -fsanitize=address
+
+HOST_CFLAGS = $(CFLAGS) -fsanitize=address
+GUEST_CFLAGS = $(CFLAGS) -static
LDLIBS = -lpthread
@@ -67,19 +69,22 @@ test/%.o: test/%.c
test/%.o: test/%.S
$(CC) -c -o $@ $^ $(CFLAGS)
-test/%_guest: test/%_guest.o test/guest.lds
- $(LD) -Ttest/guest.lds -o $@ $<
-
-test/eviction: test/eviction.c test/util.c $(TEST_SRCS)
+test/%: test/%.c $(TEST_SRCS)
$(CC) -o $@ $(filter %.c,$^) $(filter %.S,$^) $(CFLAGS) $(LDLIBS)
+test/kvm-%_guest: test/kvm-%_guest.o test/guest.lds
+ $(LD) -Ttest/kvm-guest.lds -o $@ $<
+
+test/kvm-%: test/kvm-%.c $(TEST_SRCS)
+ $(CC) -o $@ $(filter %.c,$^) $(filter %.S,$^) $(HOST_CFLAGS) $(LDLIBS)
+
test/kvm-eviction: test/kvm-eviction.c test/kvm-eviction.h $(TEST_SRCS)
- $(CC) -o $@ $(filter %.c,$^) $(filter %.S,$^) $(CFLAGS) $(LDLIBS)
+ $(CC) -o $@ $(filter %.c,$^) $(filter %.S,$^) $(HOST_CFLAGS) $(LDLIBS)
-test/kvm-step: test/kvm-step.c $(TEST_SRCS)
- $(CC) -o $@ $(filter %.c,$^) $(filter %.S,$^) $(CFLAGS) $(LDLIBS)
+test/qemu-%: test/qemu-%.c $(TEST_SRCS)
+ $(CC) -o $@ $(filter %.c,$^) $(filter %.S,$^) $(HOST_CFLAGS) $(LDLIBS)
-test/kvm-pagestep: test/kvm-pagestep.c $(TEST_SRCS)
- $(CC) -o $@ $(filter %.c,$^) $(filter %.S,$^) $(CFLAGS) $(LDLIBS)
+test/qemu-%_guest: test/qemu-%_guest.c
+ $(CC) -o $@ $(filter %.c,$^) $(filter %.S,$^) $(GUEST_CFLAGS) $(LDLIBS)
.PHONY: all clean host build load prep