summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-01-24 16:17:45 +0100
committerLouis Burda <quent.burda@gmail.com>2023-01-24 16:17:45 +0100
commit65daf1cb353f4ba5e2f08ccbce6b0d5220b0099a (patch)
tree87ab9ad37716cf5c0c110e905e95113de460d607 /Makefile
parente4762c2cdefacf13d26967b7e5f0735c2748026b (diff)
downloadcachepc-65daf1cb353f4ba5e2f08ccbce6b0d5220b0099a.tar.gz
cachepc-65daf1cb353f4ba5e2f08ccbce6b0d5220b0099a.zip
Create flat binaries to support more complex guests
Diffstat (limited to 'Makefile')
-rwxr-xr-xMakefile31
1 files changed, 20 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 76da9c0..4e15d6f 100755
--- a/Makefile
+++ b/Makefile
@@ -6,9 +6,11 @@ JOBS ?= $(CORES)
PWD := $(shell pwd)
BINS = test/eviction test/kvm-eviction
-BINS += test/kvm-step test/kvm-pagestep
-# BINS += test/qemu-eviction_guest test/qemu-eviction_host
-# BINS += test/qemu-aes_guest test/qemu-aes_host
+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-aes_guest test/qemu-aes
BINS += util/debug util/reset
CFLAGS = -I . -I linux/usr/include
@@ -17,7 +19,8 @@ CFLAGS += -fsanitize=address
LDLIBS = -lpthread
-CACHEPC_UAPI = cachepc/uapi.h cachepc/const.h
+TEST_SRCS = test/util.c test/util.h test/kvm.c test/kvm.h
+TEST_SRCS += cachepc/uapi.h cachepc/const.h
all: build $(BINS)
@@ -57,19 +60,25 @@ prep:
util/%: util/%.c $(CACHEPC_UAPI)
-test/eviction: test/eviction.c test/util.c $(CACHEPC_UAPI)
+test/%.o: test/%.c
+ $(CC) -c -o $@ $^ $(CFLAGS)
+
+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)
$(CC) -o $@ $(filter %.c,$^) $(filter %.S,$^) $(CFLAGS) $(LDLIBS)
-test/kvm-eviction: test/kvm-eviction.c test/kvm-eviction_guest.S test/util.c \
- test/util.h test/kvm.c test/kvm.h test/kvm-eviction.h $(CACHEPC_UAPI)
+test/kvm-eviction: test/kvm-eviction.c test/kvm-eviction.h $(TEST_SRCS)
$(CC) -o $@ $(filter %.c,$^) $(filter %.S,$^) $(CFLAGS) $(LDLIBS)
-test/kvm-step: test/kvm-step.c test/kvm-step_guest.S \
- test/util.c test/util.h test/kvm.c test/kvm.h $(CACHEPC_UAPI)
+test/kvm-step: test/kvm-step.c $(TEST_SRCS)
$(CC) -o $@ $(filter %.c,$^) $(filter %.S,$^) $(CFLAGS) $(LDLIBS)
-test/kvm-pagestep: test/kvm-pagestep.c test/kvm-pagestep_guest.S \
- test/util.c test/util.h test/kvm.c test/kvm.h $(CACHEPC_UAPI)
+test/kvm-pagestep: test/kvm-pagestep.c $(TEST_SRCS)
$(CC) -o $@ $(filter %.c,$^) $(filter %.S,$^) $(CFLAGS) $(LDLIBS)
.PHONY: all clean host build load prep