• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1LSRC := ../linux
2BROWSER := firefox
3
4CFLAGS += -I ${LSRC}/arch/x86/kernel/cpu/mcheck/ -g -Wall
5
6KFLAGS := -I ./kinclude
7
8EXE := tinjpage tsimpleinj tkillpoison tprctl tsoft tsoftinj thugetlb erst-inject
9EXE += ttranshuge
10EXEKERNEL := tring ttable
11
12OBJ := $(addsuffix .o,${EXE})
13OBJKERNEL := $(addsuffix .o,${EXEKERNEL})
14
15.PHONY: clean distclean see test hard soft standalone
16
17all: standalone
18
19standalone: ${EXE}
20
21kernel: ${EXEKERNEL}
22
23tcases: tcases.c ${LSRC}/arch/x86/kernel/cpu/mcheck/mce-severity.c ${LSRC}/arch/x86/kernel/cpu/mcheck/mce-internal.h
24	${CC} ${CFLAGS} ${KFLAGS} -o tcases tcases.c
25
26ttable: ttable.c ${LSRC}/arch/x86/kernel/cpu/mcheck/mce-severity.c ${LSRC}/arch/x86/kernel/cpu/mcheck/mce-internal.h
27	${CC} ${CFLAGS} ${KFLAGS} -o ttable ttable.c
28
29tprctl: tprctl.o
30
31tring: tring.o
32
33tring : LDFLAGS += -lpthread
34
35x.html: ttable
36	./ttable ${TFLAGS} > x.html
37
38include erst-inj/erst-inj.mk
39
40.PHONY: see
41
42see: x.html
43	${BROWSER} x.html
44
45tinjpage: LDFLAGS += -lpthread
46
47.PHONY: clean distclean
48
49clean:
50	rm -f ${EXE} ${OBJ}
51	rm -f ${EXEKERNEL} ${OBJKERNEL}
52	rm -f x.html unpoison-failed offlined
53	rm -f ~test* ~poison*
54
55distclean: clean
56
57test: soft hard
58
59hard: standalone
60	./tinjpage
61	./tsimpleinj
62	if ! ./tkillpoison ; then echo "killed as expected" ; exit 0 ; else echo "didn't get killed" ; exit 1 ; fi
63	./tprctl
64
65soft: standalone
66	./tsoft
67	./tsoftinj
68	echo "Running soft offliner for 60 seconds"
69	./random_offline -t 60
70
71test-kernel: tcases
72	./tcases
73
74test-erst: erst-inject
75	./erst-inject.sh
76