-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (52 loc) · 1.8 KB
/
Copy pathMakefile
File metadata and controls
69 lines (52 loc) · 1.8 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Definitions
CC = gcc
CC_FLAGS = -Wall -g3 -Iinclude -Iinclude/base -Iinclude/pipe -Iinclude/cache -pthread
EXTRA_FLAGS = -DEC
export EXTRA_FLAGS
CC_OPTIONS = -c
CC_SO_OPTIONS = -shared -fpic
CC_DL_OPTIONS = -rdynamic
RM = /bin/rm -f
MV = mv -f
LD = gcc
LIBS = -ldl
MD = gccmakedep
# Generic rules
%.o: %.c
${CC} ${CC_OPTIONS} ${CC_FLAGS} $<
# Targets
week4: tidy pipe test clean
week3: tidy pipe test clean
week2: tidy pipeminus test clean
week1: tidy test clean
pipe:
$(eval EXTRA_FLAGS += -DPIPE -UPARALLEL)
(cd src && make se)
${CC} ${CC_FLAGS} -I instr -o bin/se `/bin/ls src/base/*.o src/pipe/*.o src/cache/cache.o`
parallel:
$(eval EXTRA_FLAGS += -DPARALLEL -DPIPE)
(cd src && make se)
${CC} ${CC_FLAGS} -I instr -o bin/se `/bin/ls src/base/*.o src/pipe/*.o src/cache/cache.o`
pipeminus:
$(eval EXTRA_FLAGS += -UPIPE -UPARALLEL)
(cd src && make se)
${CC} ${CC_FLAGS} -I instr -o bin/se `/bin/ls src/base/*.o src/pipe/*.o src/cache/cache.o`
parallel_pipeminus:
$(eval EXTRA_FLAGS += -UPIPE -DPARALLEL)
(cd src && make se)
${CC} ${CC_FLAGS} -I instr -o bin/se `/bin/ls src/base/*.o src/pipe/*.o src/cache/cache.o`
test:
(cd src && make $@)
${CC} ${CC_FLAGS} -I instr -o bin/test-se src/testbench/test-se.o
${CC} ${CC_FLAGS} -I instr -o bin/test-csim src/testbench/test-csim.o
${CC} ${CC_FLAGS} -I instr -o bin/test-hw `/bin/ls src/base/elf_loader.o src/base/err_handler.o src/base/hw_elts.o src/base/interface.o src/base/machine.o src/base/mem.o src/base/proc.o src/base/ptable.o src/pipe/*.o src/cache/cache.o src/testbench/test-hw.o`
depend:
(cd src && make $@)
clean:
(cd src && make $@)
${RM} *.o *.so *.bak
tidy:
${RM} bin/se bin/test-se bin/test-csim bin/csim
count:
wc -l src/base/*.c src/pipe/*.c src/cache/*.c | tail -n 1
wc -l include/base/*.h include/pipe/*.h include/cache/*.h | tail -n 1