-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (54 loc) · 2 KB
/
Makefile
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
LIB_DIRS := libfr libpht2b
MOD_DIRS := kernel-pmc
BRANCHSCOPE_DIRS := $(wildcard BranchScope/*)
BRANCHBOOZLE_DIRS := $(wildcard Branchboozle/*)
#-------------------------------------------------------------------------------
MICRO_ARCH := skylake
CLEAN_LIB_DIRS = $(LIB_DIRS:%=clean-%)
CLEAN_MOD_DIRS = $(MOD_DIRS:%=clean-%)
CLEAN_BRANCHSCOPE_DIRS = $(BRANCHSCOPE_DIRS:%=clean-%)
CLEAN_BRANCHBOOZLE_DIRS = $(BRANCHBOOZLE_DIRS:%=clean-%)
.PHONY: $(LIB_DIRS) $(CLEAN_LIB_DIRS)
.PHONY: $(MOD_DIRS) $(CLEAN_MOD_DIRS)
.PHONY: $(BRANCHSCOPE_DIRS) $(CLEAN_BRANCHSCOPE_DIRS)
.PHONY: $(BRANCHBOOZLE_DIRS) $(CLEAN_BRANCHBOOZLE_DIRS)
.PHONY: all clean
.SILENT:
all: $(BRANCHSCOPE_DIRS) $(BRANCHBOOZLE_DIRS)
echo "============================== Micro-architecture [${MICRO_ARCH}]"
$(MOD_DIRS):
echo "============================== Building Kernel Module"
$(MAKE) -C $@ $(MICRO_ARCH)
$(LIB_DIRS):
echo "============================== Building Library [${@}]"
$(MAKE) -C $@ $(MICRO_ARCH)
$(BRANCHSCOPE_DIRS): $(MOD_DIRS) $(LIB_DIRS)
echo "------------------------------ Building BranchScope [${notdir $@}]"
$(MAKE) -C $@ $(MICRO_ARCH)
$(BRANCHBOOZLE_DIRS): $(MOD_DIRS) $(LIB_DIRS)
echo "------------------------------ Building Branchboozle [${notdir $@}]"
$(MAKE) -C $@ $(MICRO_ARCH)
.SILENT:
clean: $(CLEAN_LIB_DIRS) $(CLEAN_MOD_DIRS) $(CLEAN_BRANCHSCOPE_DIRS) $(CLEAN_BRANCHBOOZLE_DIRS)
$(CLEAN_LIB_DIRS):
$(MAKE) -C $(@:clean-%=%) clean
$(CLEAN_MOD_DIRS):
$(MAKE) -C $(@:clean-%=%) clean
$(CLEAN_BRANCHSCOPE_DIRS):
$(MAKE) -C $(@:clean-%=%) clean
$(CLEAN_BRANCHBOOZLE_DIRS):
$(MAKE) -C $(@:clean-%=%) clean
#---- Micro-architecture specific, default is Skylake
.PHONY: sandybridge ivybridge haswell kabylake coffeelake zen
sandybridge: MICRO_ARCH := sandybridge
sandybridge: all
ivybridge: MICRO_ARCH := ivybridge
ivybridge: all
haswell: MICRO_ARCH := haswell
haswell: all
kabylake: MICRO_ARCH := kabylake
kabylake: all
coffeelake: MICRO_ARCH := coffeelake
coffeelake: all
zen: MICRO_ARCH := zen
zen: all