blob: 621e5220b157dd7074a21c656a42c07b70c70fd3 [file] [log] [blame]
Shad Ansari47432b62021-09-27 22:46:25 +00001# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
2# SPDX-License-Identifier: LicenseRef-ONF-Member-1.01
3#
4define PROJECT_HELP_MSG
5Usage:
6 make help show this message
7 make clean remove intermediate files
Shad Ansari55ff1852021-09-27 20:05:54 +00008
Shad Ansari47432b62021-09-27 22:46:25 +00009 make ${VENV} make a virtualenv in the base directory
10 make python-reqs install python packages in requirements.pip
11 make git-config set local git configuration
12 make setup make python-reqs
13
14 make run launch network-video-recorder
15 make run-native run native application (no docker)
16 make run-native-no-show run native applicaiton (no docker) w/o video output
17endef
18export PROJECT_HELP_MSG
19
20SHELL = /bin/bash
21VENV = .venv
22PYTHON = $(VENV)/bin/python3
23PIP = $(VENV)/bin/pip
24IMAGE = person-detection-app
25
26help:
27 echo "$$PROJECT_HELP_MSG" | less
28
29
30$(VENV): $(VENV)/touchfile
31
32$(VENV)/touchfile: requirements.txt
33 test -d $(VENV) || python3 -m venv $(VENV)
34 . $(VENV)/bin/activate; pip install -Ur requirements.txt
35 touch $(VENV)/touchfile
36
37$(VENV)/bin/activate: requirements.txt
38 python3 -m venv $(VENV)
39 $(PIP) install -r requirements.txt
40
41build: $(VENV)
42 docker build -f docker/Dockerfile -t $(IMAGE) .
43
44run:
45 docker run -itu root:root --privileged --network host --name $(IMAGE) --rm $(IMAGE)
46
47run-native-test:
Shad Ansarid80531f2021-09-27 23:15:03 +000048 . ./bin/person_detection.sh -i ./resources/run.mp4
Shad Ansari47432b62021-09-27 22:46:25 +000049
50run-native:
Shad Ansarid80531f2021-09-27 23:15:03 +000051 . ./bin/person_detection.sh -i gstreamer
Shad Ansari47432b62021-09-27 22:46:25 +000052
53run-native-test-no-show:
Shad Ansarid80531f2021-09-27 23:15:03 +000054 . ./bin/person_detection.sh -i ./resources/run.mp4 -ns
Shad Ansari47432b62021-09-27 22:46:25 +000055
56run-native-no-show:
Shad Ansarid80531f2021-09-27 23:15:03 +000057 . ./bin/person_detection.sh -i gstreamer -ns
Shad Ansari55ff1852021-09-27 20:05:54 +000058
59test:
Shad Ansari47432b62021-09-27 22:46:25 +000060
61
62CLEANUP = *.pyc $(VENV)
63clean:
64 rm -rf ${CLEANUP}
65
66.PHONY: run clean
67