-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (29 loc) · 1.79 KB
/
Copy pathMakefile
File metadata and controls
39 lines (29 loc) · 1.79 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
CC = gcc
CFLAGS = -g -Wall
ASM_FLAGS = $(CFLAGS) -static # specifically for compiling ASM files
# Executables
all: c-old-test asm-old-test c-opt-test asm-opt-test old-benchmark new-benchmark runall
# C implementation(old)
c-old-test: src/Old/hash-table-old.c tests/Old/hash-table-c-test-old.c
$(CC) $(CFLAGS) src/Old/hash-table-old.c tests/Old/hash-table-c-test-old.c -o c-old-test
# x86 implementation(old)
asm-old-test: src/Old/hash-table-old.s src/Old/hash-table-old.c tests/Old/hash-table-asm-test-old.c
$(CC) $(ASM_FLAGS) src/Old/hash-table-old.s src/Old/hash-table-old.c tests/Old/hash-table-asm-test-old.c -o asm-old-test
# C implementation(new)
c-opt-test: src/New/hash-table-opt.c src/Utils/str.c tests/New/hash-table-c-test-opt.c
$(CC) $(CFLAGS) src/New/hash-table-opt.c src/Utils/str.c tests/New/hash-table-c-test-opt.c -o c-opt-test
# x86 implementation(new)
asm-opt-test: src/New/hash-table-opt.s src/New/hash-table-opt.c src/Utils/str.c tests/New/hash-table-asm-test-opt.c
$(CC) $(ASM_FLAGS) src/New/hash-table-opt.s src/New/hash-table-opt.c src/Utils/str.c tests/New/hash-table-asm-test-opt.c -o asm-opt-test
# Benchmark executables
# Old x86 implementation benchmark
old-benchmark: src/Old/hash-table-old.s src/Benchmarks/hash-table-benchmark-old.c
$(CC) $(ASM_FLAGS) src/Old/hash-table-old.s src/Benchmarks/hash-table-benchmark-old.c -o old-benchmark
# Optimized x86 implementation benchmark
new-benchmark: src/New/hash-table-opt.s src/Utils/str.c src/Benchmarks/hash-table-benchmark-opt.c
$(CC) $(ASM_FLAGS) src/New/hash-table-opt.s src/Utils/str.c src/Benchmarks/hash-table-benchmark-opt.c -o new-benchmark
# executable to run all tests
runall: src/runall.c
$(CC) $(C_FLAGS) src/runall.c -o runall
clean:
rm -f c-old-test asm-old-test c-opt-test asm-opt-test old-benchmark new-benchmark runall