-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (23 loc) · 798 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
CC ?= cc
INC = `pkg-config --cflags zbar sdl2 SDL2_ttf libavformat libavcodec libavutil`
CFLAGS ?= -g3 -D_XOPEN_SOURCE=700 -Og
ALLCFLAGS = $(CFLAGS) $(STDC) -D_XOPEN_SOURCE=700 -std=c17 $(INC)
LDFLAGS = `pkg-config --libs zbar sdl2 SDL2_ttf libavformat libavcodec libavutil`
BIN ?= kokanyctl
SRCDIR = src
BUILDDIR = build
SRC := $(wildcard $(SRCDIR)/*.c)
OBJ := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%.o,$(SRC))
.PHONY: clean rules
all: $(BIN) yolo/model.onnx
$(BIN): $(OBJ)
$(CC) $^ $(INC) $(ALLCFLAGS) $(LDFLAGS) -o $@
$(BUILDDIR)/%.c.o: $(SRCDIR)/%.c
mkdir -p $(BUILDDIR)
$(CC) $< -c $(INC) $(ALLCFLAGS) -o $@
yolo/model.onnx: yolo/model.pt
ultralytics export model=$< format=onnx $(UFLAGS) opset=12
rules:
install -m 660 rules/* /etc/udev/rules.d/
clean:
rm -rf $(BUILDDIR) $(BIN)