-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
30 lines (21 loc) · 789 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
# CC=clang++ -std=c++20 -g -Ofast -Wall -Wextra -Iincludes -D_GLIBCXX_DEBUG -fsanitize=address
CC=clang++ -std=c++20 -Ofast -Wall -Wextra -Wpedantic -Iincludes -DNDEBUG
DATASET=$(addprefix dataset/,t10k-labels-idx1-ubyte train-images-idx3-ubyte train-labels-idx1-ubyte t10k-images-idx3-ubyte)
BINARY=$(addprefix bin/,k-NN dnn tnn)
all: $(BINARY) $(DATASET)
bin/k-NN: $(addprefix obj/,k-NN.o dataset.o)
bin/dnn: $(addprefix obj/,dnn.o nn.o dataset.o)
bin/tnn: $(addprefix obj/,tnn.o nn.o dataset.o)
$(BINARY): bin/% : | bin/
$(CC) -o $@ $^
obj/%.o: src/%.cpp | obj/
$(CC) -c -o $@ $^
$(DATASET): dataset/% : | dataset/
curl 'http://yann.lecun.com/exdb/mnist/$*.gz' -o [email protected] 2>/dev/null
gunzip [email protected]
%/:
mkdir -p $*
clean:
rm -rf obj dataset bin
.PHONY: run clean
.SECONDARY: