forked from OpenThermal/libseek-thermal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
45 lines (36 loc) · 1.02 KB
/
Makefile
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
CXX = g++
CC = $(CXX)
LDLIBS += $(shell pkg-config --silence-errors --libs opencv4 || pkg-config --libs opencv)
LDLIBS += $(shell pkg-config --libs libusb-1.0)
CXXFLAGS += $(shell pkg-config --silence-errors --cflags opencv4 || pkg-config --cflags opencv)
CXXFLAGS += $(shell pkg-config --cflags libusb-1.0)
CXXFLAGS += -Wall -std=c++11
LDFLAGS += -lstdc++
LIBSEEK = libseek
PREFIX ?= /usr/local
ifeq ($(DEBUG), 1)
CMNFLAGS = -fno-omit-frame-pointer -fsanitize=address
CXXFLAGS += -DSEEK_DEBUG -g $(CMNFLAGS)
LDFLAGS += $(CMNFLAGS)
else
CXXFLAGS += -O2
endif
export CXXFLAGS LDFLAGS LIBSEEK LDLIBS CXX CC PREFIX
all: bin
lib:
make -C lib/
bin: lib
make -C bin/
install: bin $(LIBSEEK).pc
make -C bin/ install
make -C lib/ install
install -d $(PREFIX)/lib/pkgconfig
install libseek.pc $(PREFIX)/lib/pkgconfig
$(LIBSEEK).pc:
echo 'prefix=$(PREFIX)' > $(LIBSEEK).pc
cat $(LIBSEEK).pc.make >> $(LIBSEEK).pc
clean:
make -C lib/ clean
make -C bin/ clean
rm -rf $(LIBSEEK).pc
.PHONY: all lib bin install clean