blob: e4ca58d1e173e7cbd4457647298467dfea4ea6d1 [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:
48 . ./person_detection.sh -i ./resources/run.mp4
49
50run-native:
51 . ./person_detection.sh -i gstreamer
52
53run-native-test-no-show:
54 . ./person_detection.sh -i ./resources/run.mp4 -ns
55
56run-native-no-show:
57 . ./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