forked from cgvwzq/cachequery
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (26 loc) · 811 Bytes
/
Makefile
File metadata and controls
37 lines (26 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
TARGET = mod_cachequery
KERNEL := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
SOURCES := $(addprefix src/, main.c msrdrv.c parser.c cache.c config.c histogram.c lists.c)
$(TARGET)-objs += $(SOURCES:.c=.o)
# fix error with new gcc version
ccflags-y += -I/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.1/include
ccflags-y += -Wall
obj-m := $(TARGET).o
# list of supported cpus: i7-4790 i5-6500 i7-8550u
cpu ?= i5-7200u
EXTRA_CFLAGS += -DCPU=$(cpu)
all:
make -C $(KERNEL) M=$(PWD) modules
cp *.ko $(PWD)/out
qemu:
make -C ../../linux/obj/linux-x86-basic M=$(PWD) modules
sudo cp *.ko $(PWD)/out
clean:
make -C $(KERNEL) M=$(PWD) clean
install:
sudo rmmod mod_cachequery || true
sudo insmod mod_cachequery.ko
sudo chown -R $(USER) /sys/kernel/cachequery/
uninstall:
sudo rmmod mod_cachequery