-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (54 loc) · 2.14 KB
/
Makefile
File metadata and controls
70 lines (54 loc) · 2.14 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
########################################################
#
# Makefile to install and run Sherlock.
#
########################################################
# Some of these may need adjusting on your specific system.
VENV_LIBDIR = venv/lib/python2.7
VENV_OPENCV = $(VENV_LIBDIR)/cv2.so
VENV_SHAREDMEM = $(VENV_LIBDIR)/site-packages/sharedmem
# This makefile uses bash shell commands.
SHELL := /bin/bash
# GLOBAL_OPENCV is the path to the system-installed OpenCV
# library cv2.so file. By default, the path is functionally
# obtained by printing the imported cv2 module in a Python shell.
#
# Alternatively, set the path explicitly. For OpenCV installation
# via Homebrew on OS X for example:
#
# GLOBAL_OPENCV := /usr/local/lib/python2.7/site-packages/cv2.so
GLOBAL_OPENCV := $(shell python -c 'import cv2; print(cv2)' | awk '{print $$4}' | sed s:"['>]":"":g)
all: venv $(VENV_SHAREDMEM) $(VENV_OPENCV)
# Link the global cv2 library file inside the virtual environment.
$(VENV_OPENCV): $(GLOBAL_OPENCV) venv
cp -f $(GLOBAL_OPENCV) $@
venv: venv/bin/activate
venv/bin/activate: requirements.txt
test -d venv || virtualenv venv
. venv/bin/activate && pip install -r requirements.txt
# Install NumPy sharedmem module inside the virtual environment.
$(VENV_SHAREDMEM): venv
. venv/bin/activate && \
mkdir -p temp && \
cd temp && \
hg clone http://bitbucket.org/cleemesser/numpy-sharedmem && \
cd numpy-sharedmem && \
python setup.py install && \
cd ../.. && \
rm -rf temp
playcv2: venv $(VENV_OPENCV)
. venv/bin/activate && python src/playcv2.py 0 640 480 8
diffavg1: venv $(VENV_OPENCV)
. venv/bin/activate && python src/diffavg1.py 0 640 480 8
diffavg2: venv $(VENV_OPENCV)
. venv/bin/activate && python src/diffavg2.py 0 640 480 8
diffavg3: venv $(VENV_SHAREDMEM) $(VENV_OPENCV)
. venv/bin/activate && python src/diffavg3.py 0 640 480 8
diffavg4: venv $(VENV_SHAREDMEM) $(VENV_OPENCV)
. venv/bin/activate && python src/diffavg4.py 0 640 480 8
object1: venv $(VENV_OPENCV)
. venv/bin/activate && python src/object1.py 0 640 480 8
object2: venv $(VENV_SHAREDMEM) $(VENV_OPENCV)
. venv/bin/activate && python src/object2.py 0 640 480 8
clean:
rm -rf venv temp