| # |
| # SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org> |
| # SPDX-License-Identifier: LicenseRef-ONF-Member-1.01 |
| # |
| define PROJECT_HELP_MSG |
| Usage: |
| make help show this message |
| make clean remove intermediate files |
| |
| make ${VENV} make a virtualenv in the base directory |
| make python-reqs install python packages in requirements.pip |
| make git-config set local git configuration |
| make setup make python-reqs |
| |
| make run launch network-video-recorder |
| make run-native run native application (no docker) |
| make run-native-no-show run native applicaiton (no docker) w/o video output |
| endef |
| export PROJECT_HELP_MSG |
| |
| SHELL = /bin/bash |
| VENV = .venv |
| PYTHON = $(VENV)/bin/python3 |
| PIP = $(VENV)/bin/pip |
| IMAGE = person-detection-app |
| |
| help: |
| echo "$$PROJECT_HELP_MSG" | less |
| |
| |
| $(VENV): $(VENV)/touchfile |
| |
| $(VENV)/touchfile: requirements.txt |
| test -d $(VENV) || python3 -m venv $(VENV) |
| . $(VENV)/bin/activate; pip install -Ur requirements.txt |
| touch $(VENV)/touchfile |
| |
| $(VENV)/bin/activate: requirements.txt |
| python3 -m venv $(VENV) |
| $(PIP) install -r requirements.txt |
| |
| build: $(VENV) |
| docker build -f docker/Dockerfile -t $(IMAGE) . |
| |
| run: |
| docker run -itu root:root --privileged --network host --name $(IMAGE) --rm $(IMAGE) |
| |
| run-native-file: $(VENV) |
| . ./bin/person_detection.sh -i ./resources/run.mp4 |
| |
| run-native-gstream: $(VENV) |
| . ./bin/person_detection.sh -i gstreamer |
| |
| run-native-cam: $(VENV) |
| . ./bin/person_detection.sh -i cam |
| |
| test: |
| |
| |
| CLEANUP = *.pyc $(VENV) |
| clean: |
| rm -rf ${CLEANUP} |
| |
| .PHONY: run clean |
| |