-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (37 loc) · 984 Bytes
/
Makefile
File metadata and controls
49 lines (37 loc) · 984 Bytes
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
#
# Makefile for cvfind - Rev. 20231212_1559
#
CPP = g++
# PREFIX is environment variable, but if it is not set, then set default value
ifeq ($(PREFIX),)
PREFIX := /usr/local
endif
CPPFLAGS = `pkg-config --cflags opencv4` -std=c++14 -g3
LDFLAGS = -Wl,-t,--verbose -lpthread `pkg-config --libs opencv4`
# If directed to make with contrib package
ifeq ($(WITH_CONTRIB),TRUE)
CPPFLAGS += -Dcpp_variable -DWITH_OPENCV_CONTRIB
endif
all: cvfind
cvfind.o: cvfind.cpp
echo ''
echo "compile: $(CPP) $(CPPFLAGS) -c $^ -o $@"
echo ''
$(CPP) $(CPPFLAGS) -c $^ -o $@
echo ''
cvfind: cvfind.o
echo ''
echo "link: $(CPP) $^ -o $@ $(LDFLAGS)"
$(CPP) $^ -o $@ $(LDFLAGS)
echo ''
check: cvfind
./cvfind --test
clean:
rm cvfind cvfind.o
install: cvfind
echo ''
echo 'install:'
install -d $(DESTDIR)$(PREFIX)/bin/
install -m 755 cvfind $(DESTDIR)$(PREFIX)/bin/
echo "contents of destdir=$(DESTDIR) prefix=$(PREFIX):"
find "$(DESTDIR)$(PREFIX)" -exec ls -lia {} \;