-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (27 loc) · 813 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
#
# Student makefile for Cache Lab
#
CC = gcc
CFLAGS = -g -Wall -Werror -std=c99
all: csim test-trans tracegen
# Generate a handin tar file each time you compile
-tar -cvf ${USER}-handin.tar csim.c trans.c
csim: csim.c cachelab.c cachelab.h
$(CC) $(CFLAGS) -c -o cachelab.o cachelab.c -lm
g++ -g -c -o csim.o csim.c -lm -l c
g++ -g -o csim csim.o cachelab.o -lm -l c
test-trans: test-trans.c trans.o cachelab.c cachelab.h
$(CC) $(CFLAGS) -o test-trans test-trans.c cachelab.c trans.o
tracegen: tracegen.c trans.o cachelab.c
$(CC) $(CFLAGS) -O0 -o tracegen tracegen.c trans.o cachelab.c
trans.o: trans.c
$(CC) $(CFLAGS) -O0 -c trans.c
#
# Clean the src dirctory
#
clean:
rm -rf *.o
rm -f csim cachelab.o csim.o
rm -f test-trans tracegen
rm -f trace.all trace.f*
rm -f .csim_results .marker