Shad Ansari | 47432b6 | 2021-09-27 22:46:25 +0000 | [diff] [blame^] | 1 | # SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org> |
| 2 | # SPDX-License-Identifier: LicenseRef-ONF-Member-1.01 |
| 3 | # |
| 4 | define PROJECT_HELP_MSG |
| 5 | Usage: |
| 6 | make help show this message |
| 7 | make clean remove intermediate files |
Shad Ansari | 55ff185 | 2021-09-27 20:05:54 +0000 | [diff] [blame] | 8 | |
Shad Ansari | 47432b6 | 2021-09-27 22:46:25 +0000 | [diff] [blame^] | 9 | 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 |
| 17 | endef |
| 18 | export PROJECT_HELP_MSG |
| 19 | |
| 20 | SHELL = /bin/bash |
| 21 | VENV = .venv |
| 22 | PYTHON = $(VENV)/bin/python3 |
| 23 | PIP = $(VENV)/bin/pip |
| 24 | IMAGE = person-detection-app |
| 25 | |
| 26 | help: |
| 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 | |
| 41 | build: $(VENV) |
| 42 | docker build -f docker/Dockerfile -t $(IMAGE) . |
| 43 | |
| 44 | run: |
| 45 | docker run -itu root:root --privileged --network host --name $(IMAGE) --rm $(IMAGE) |
| 46 | |
| 47 | run-native-test: |
| 48 | . ./person_detection.sh -i ./resources/run.mp4 |
| 49 | |
| 50 | run-native: |
| 51 | . ./person_detection.sh -i gstreamer |
| 52 | |
| 53 | run-native-test-no-show: |
| 54 | . ./person_detection.sh -i ./resources/run.mp4 -ns |
| 55 | |
| 56 | run-native-no-show: |
| 57 | . ./person_detection.sh -i gstreamer -ns |
Shad Ansari | 55ff185 | 2021-09-27 20:05:54 +0000 | [diff] [blame] | 58 | |
| 59 | test: |
Shad Ansari | 47432b6 | 2021-09-27 22:46:25 +0000 | [diff] [blame^] | 60 | |
| 61 | |
| 62 | CLEANUP = *.pyc $(VENV) |
| 63 | clean: |
| 64 | rm -rf ${CLEANUP} |
| 65 | |
| 66 | .PHONY: run clean |
| 67 | |