-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
112 lines (90 loc) · 3.55 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
ifeq ($(TARGET),cross)
CC=riscv64-unknown-linux-gnu-g++
AR=riscv64-unknown-linux-gnu-ar
else
CC=g++
AR=ar
endif
# default to use code of scheduling, set the scheduler policy in monitor header
OPTIONS=-static -Dscheduler
ifneq ($(BIND),no)
OPTIONS+=-Dbinding
endif
OPTIONS=-static -Dbinding -Dscheduler -std=c++11
OBJ_FOLDER= ./obj
SRC_FOLDER= ./src
DOCS_FOLDER= ./docs
BIN_FOLDER= ./bin
all:example
lib: src/monitor.cc src/monitor.h src/worker.cc src/worker.h
mkdir -p $(OBJ_FOLDER)
$(CC) $(OPTIONS) -c -o $(OBJ_FOLDER)/monitor.o $(SRC_FOLDER)/monitor.cc -I$(SRC_FOLDER)
$(CC) $(OPTIONS) -c -o $(OBJ_FOLDER)/worker.o $(SRC_FOLDER)/worker.cc -I$(SRC_FOLDER)
$(AR) rvs $(OBJ_FOLDER)/lib.a $(OBJ_FOLDER)/monitor.o $(OBJ_FOLDER)/worker.o
libd: src/monitor.cc src/monitor.h src/worker.cc src/worker.h
mkdir -p $(OBJ_FOLDER)
$(CC) $(OPTIONS) -Ddebug -c -o $(OBJ_FOLDER)/monitor.o $(SRC_FOLDER)/monitor.cc -I$(SRC_FOLDER)
$(CC) $(OPTIONS) -c -o $(OBJ_FOLDER)/worker.o $(SRC_FOLDER)/worker.cc -I$(SRC_FOLDER)
$(AR) rvs $(OBJ_FOLDER)/lib.a $(OBJ_FOLDER)/monitor.o $(OBJ_FOLDER)/worker.o
libinstr: src/monitor.cc src/monitor.h src/worker.cc src/worker.h
mkdir -p $(OBJ_FOLDER)
$(CC) $(OPTIONS) -Dinstr -c -o $(OBJ_FOLDER)/monitor.o $(SRC_FOLDER)/monitor.cc -I$(SRC_FOLDER)
$(CC) $(OPTIONS) -c -o $(OBJ_FOLDER)/worker.o $(SRC_FOLDER)/worker.cc -I$(SRC_FOLDER)
$(AR) rvs $(OBJ_FOLDER)/lib.a $(OBJ_FOLDER)/monitor.o $(OBJ_FOLDER)/worker.o
libactive: src/monitor.cc src/monitor.h src/worker.cc src/worker.h
mkdir -p $(OBJ_FOLDER)
$(CC) $(OPTIONS) -Dactive -c -o $(OBJ_FOLDER)/monitor.o $(SRC_FOLDER)/monitor.cc -I$(SRC_FOLDER)
$(CC) $(OPTIONS) -c -o $(OBJ_FOLDER)/worker.o $(SRC_FOLDER)/worker.cc -I$(SRC_FOLDER)
$(AR) rvs $(OBJ_FOLDER)/lib.a $(OBJ_FOLDER)/monitor.o $(OBJ_FOLDER)/worker.o
libactiveinstr: src/monitor.cc src/monitor.h src/worker.cc src/worker.h
mkdir -p $(OBJ_FOLDER)
$(CC) $(OPTIONS) -Dactive -Dinstr -c -o $(OBJ_FOLDER)/monitor.o $(SRC_FOLDER)/monitor.cc -I$(SRC_FOLDER)
$(CC) $(OPTIONS) -c -o $(OBJ_FOLDER)/worker.o $(SRC_FOLDER)/worker.cc -I$(SRC_FOLDER)
$(AR) rvs $(OBJ_FOLDER)/lib.a $(OBJ_FOLDER)/monitor.o $(OBJ_FOLDER)/worker.o
libdemo: src/monitor.cc src/monitor.h src/worker.cc src/worker.h
mkdir -p $(OBJ_FOLDER)
$(CC) $(OPTIONS) -Ddemo -c -o $(OBJ_FOLDER)/monitor.o $(SRC_FOLDER)/monitor.cc -I$(SRC_FOLDER)
$(CC) $(OPTIONS) -Ddemo -c -o $(OBJ_FOLDER)/worker.o $(SRC_FOLDER)/worker.cc -I$(SRC_FOLDER)
$(AR) rvs $(OBJ_FOLDER)/lib.a $(OBJ_FOLDER)/monitor.o $(OBJ_FOLDER)/worker.o
example:lib
mkdir -p $(BIN_FOLDER)
$(CC) -O0 -o $(BIN_FOLDER)/example \
$(SRC_FOLDER)/example.cc \
$(OBJ_FOLDER)/lib.a
debugexample: libd
mkdir -p $(BIN_FOLDER)
$(CC) -O0 -o $(BIN_FOLDER)/debugexample \
$(SRC_FOLDER)/example.cc \
$(OBJ_FOLDER)/lib.a
instrexample:libinstr
mkdir -p $(BIN_FOLDER)
$(CC) -O0 -o $(BIN_FOLDER)/instrexample \
$(SRC_FOLDER)/example.cc \
$(OBJ_FOLDER)/lib.a
activeexample: libactive
mkdir -p $(BIN_FOLDER)
$(CC) -O0 -o $(BIN_FOLDER)/activeexample \
$(SRC_FOLDER)/example.cc \
$(OBJ_FOLDER)/lib.a
activeinstrexample: libactiveinstr
mkdir -p $(BIN_FOLDER)
$(CC) -O0 -o $(BIN_FOLDER)/activeinstrexample \
$(SRC_FOLDER)/example.cc \
$(OBJ_FOLDER)/lib.a
demoexample: libdemo
mkdir -p $(BIN_FOLDER)
$(CC) -O0 -o $(BIN_FOLDER)/demoexample \
$(SRC_FOLDER)/example.cc \
$(OBJ_FOLDER)/lib.a
demo: libdemo
$(CC) $(OPTIONS) -O0 -o $(BIN_FOLDER)/demo \
$(SRC_FOLDER)/demo.cc \
$(OBJ_FOLDER)/lib.a
docs:
doxygen Doxyfile
cd ./docs/latex && make all
.PHONY: clean
clean:
rm -f $(OBJ_FOLDER)/*
rm -f $(BIN_FOLDER)/*
rm -fr $(DOCS_FOLDER)