-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (35 loc) · 1.02 KB
/
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
44
45
46
47
48
49
CC = clang $(N) $(N_THREADS)
CFLAGS = -Ofast -march=native -Rpass=loop-vectorize -Rpass-missed=loop-vectorize -Rpass-analysis=loop-vectorize -ffp-contract=fast -cl-single-precision-constant -fopenmp
WFLAGS = -std=c11 -Wall -Wextra -g
LDFLAGS = -lm
# TARGETS = tiny_md viz
TARGETS = tiny_md
SOURCES = $(shell echo *.c)
OBJECTS = core.o wtime.o
all: $(TARGETS)
viz: viz.o $(OBJECTS)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lGL -lGLU -lglut
tiny_md: tiny_md.o $(OBJECTS)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
%.o: %.c
$(CC) $(WFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
clean:
rm -f $(TARGETS) *.o *.xyz *.log .depend
.depend: $(SOURCES)
$(CC) -MM $^ > $@
test:
python3 test/test_main.py
rebuild-and-test:
make clean
make
make test
benchmark:
python3 benchmark/main.py $(name) --n-values 256 500 864 1372 2048 --num-runs 3
plot:
python3 benchmark/main.py $(name) --mode plot
rebuild-and-benchmark:
make clean
make
make benchmark
-include .depend
.PHONY: clean all test benchmark rebuild-and-test rebuild-and-benchmark plot