-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (34 loc) · 1.17 KB
/
Makefile
File metadata and controls
47 lines (34 loc) · 1.17 KB
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
CC = g++
OPT = -g
WARN = -Wall
CFLAGS = $(OPT) $(WARN)
# List corresponding compiled object files here (.o files)
SIM_OBJ = cache.o
TESTCASES = testcase0 testcase1 testcase2 testcase3 testcase4 testcase5
#################################
# default rule
all: $(TESTCASES)
# generic rule for converting any .cc file to any .o file
.cc.o:
$(CC) $(CFLAGS) -c *.cc
#rule for creating the object files for all the testcases in the "testcases" folder
testcase:
$(MAKE) -C testcases
# rules for making testcases
testcase0: .cc.o testcase
$(CC) -o bin/testcase0 $(CFLAGS) $(SIM_OBJ) testcases/testcase0.o
testcase1: .cc.o testcase
$(CC) -o bin/testcase1 $(CFLAGS) $(SIM_OBJ) testcases/testcase1.o
testcase2: .cc.o testcase
$(CC) -o bin/testcase2 $(CFLAGS) $(SIM_OBJ) testcases/testcase2.o
testcase3: .cc.o testcase
$(CC) -o bin/testcase3 $(CFLAGS) $(SIM_OBJ) testcases/testcase3.o
testcase4: .cc.o testcase
$(CC) -o bin/testcase4 $(CFLAGS) $(SIM_OBJ) testcases/testcase4.o
testcase5: .cc.o testcase
$(CC) -o bin/testcase5 $(CFLAGS) $(SIM_OBJ) testcases/testcase5.o
# type "make clean" to remove all .o files plus the sim binary
clean:
rm -f testcases/*.o
rm -f *.o
rm -f bin/*