-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (38 loc) · 1.45 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
50
51
52
# Use OpenCV 4 is available, otherwise attempt using OpenCV 3
OPENCV_LIBS := $(shell pkg-config opencv4 --libs 2>/dev/null || pkg-config opencv --libs 2>/dev/null)
OPENCV_CFLAGS := $(shell pkg-config opencv4 --cflags 2>/dev/null || pkg-config opencv --cflags 2>/dev/null)
OPENMP := -fopenmp
CC := g
CFLAGS := -g -Wall $(OPENCV_CFLAGS)-O3 -D HASH_SIZE=32 -D WINDOW_SIZE=120
LIBS := $(OPENCV_LIBS)
OBJECTS := $(patsubst src/%.cpp, build/%.o, $(wildcard src/*.cpp))
TARGET := bin/main.exe
# === Build commands ===
all: $(TARGET)
$(TARGET): $(OBJECTS)
@mkdir -p ./bin/
$(CC) $(OPENMP) -o $(TARGET) $(LIBS) $(OBJECTS)
build/%.o: src/%.cpp
@mkdir -p ./build/
$(CC) $(OPENMP) $(CFLAGS) -c -o $@ $<
clean:
@rm -rf ./build && rm -f ./$(TARGET)
@echo "Build directory and binary executable successfully deleted"
# === Commands for quick testing (you won't have to enter any id's) ===
run: $(TARGET)
./$(TARGET) ZTHsrEG5jhA M_KWGJw6R24
run-verbose: $(TARGET)
VERBOSE=1 make run
test: $(TARGET)
python ./bin/run.py
test-verbose: $(TARGET)
VERBOSE=1 make test
# === The commands below have been used mainly for debugging/continous development purposes ===
run-watch: $(TARGET)
echo "src/main.cpp" | entr -c -s 'make run && make plot'
plot: images/out32.csv
python images/plot.py
plot-watch: images/out32.csv
echo "images/plot.py" | entr -c -s 'make plot'
download-videos:
youtube-dl -f 'bestvideo[height<=144][ext=mp4]' -o './videos/%(id)s.%(ext)s' $(YTVIDS)