-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (26 loc) · 860 Bytes
/
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
CC = g++
#OPT = -O3
OPT = -g
WARN = -Wall
CFLAGS = $(OPT) $(WARN)
# List all your .cc files here (source files, excluding header files)
SIM_SRC = main.cpp cache_L1.cpp cache_L2.cpp inclusive.cpp cache.h
# List corresponding compiled object files here (.o files)
SIM_OBJ = main.o cache_L1.o cache_L2.o inclusive.o
#################################
# default rule
all: sim_cache
@echo "my work is done here..."
# rule for making sim_cache
sim_cache: $(SIM_OBJ)
$(CC) -o sim_cache $(CFLAGS) $(SIM_OBJ) -lm
@echo "-----------DONE WITH SIM_CACHE-----------"
# generic rule for converting any .cc file to any .o file
.cc.o:
$(CC) $(CFLAGS) -c $*.cpp
# type "make clean" to remove all .o files plus the sim_cache binary
clean:
rm -f *.o sim_cache
# type "make clobber" to remove all .o files (leaves sim_cache binary)
clobber:
rm -f *.o