-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
42 lines (32 loc) · 998 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
CC ?= gcc
CFLAGS ?= -std=gnu99 -Wall -O0
SRCS = main.c
EXEC = natural-mergesort natural-mergesort_change gen_testcase calculate
all: $(EXEC)
natural-mergesort: $(SRCS) natural-mergesort.h natural-mergesort.c
$(CC) $(CFLAGS) -DIMPL="\"$@.h\"" -o $@ $(SRCS) $@.c
natural-mergesort_change: $(SRCS) natural-mergesort_change.h natural-mergesort_change.c
$(CC) $(CFLAGS) -DIMPL="\"$@.h\"" -o $@ $(SRCS) $@.c
gen_testcase: gen_testcase.c
$(CC) $(CFLAGS) -o $@ $@.c
test: $(EXEC)
perf stat --repeat 100 \
-e cache-misses,cache-references,instructions,cycles \
./natural-mergesort
test1: $(EXEC)
perf stat --repeat 100 \
-e cache-misses,cache-references,instructions,cycles \
./natural-mergesort_change
gendata:
for i in `seq 0 1 100`; do \
./natural-mergesort;\
./natural-mergesort_change;\
done
cal:
./calculate
plot:
gnuplot runtime.gp
.PHONY: clean
clean:
rm -f \
$(EXEC) runtime.png orig_runtime.txt opt_runtime.txt orig_ans.txt output.txt