-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
90 lines (75 loc) · 2.57 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
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#####################################################################
#
# Copyright 2013 Bobby Graese <[email protected]>
#
# This file is part of libEasyPTP.
#
# libEasyPTP is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# libEasyPTP is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with libEasyPTP. If not, see
# <http://www.gnu.org/licenses/>.
#
#####################################################################
#####################################################################
# User configurable
#####################################################################
# Installation prefix, including trailing /. Files will be copied
# to this directory on make install, including $(PREFIX)lib/,
# $(PREFIX)include/, etc.
PREFIX := /usr/
# Whether or not to include the PTPUSB class. This class requires
# libusbx development headers to be installed, but is practically
# required for libEasyPTP. There are very few (if any) non-USB
# PTP devices.
# Values: true, false
HAS_USB := true
#####################################################################
# Probably shouldn't touch unless you know what you're doing
#####################################################################
CXX ?= g++
CP := cp
RM := rm -rf
MKDIR := mkdir -p
DOXYGEN := doxygen
CXXFLAGS += -fPIC -Wall -std=c++11
LIBS := -lusb-1.0
INCLUDES := -I./include/
SRCS := ./lib/PTPBase.cpp \
./lib/CHDKCamera.cpp \
./lib/LVData.cpp \
./lib/PTPCamera.cpp \
./lib/PTPContainer.cpp
ifeq ($(HAS_USB), true)
SRCS += ./lib/PTPUSB.cpp
endif
OBJS := $(SRCS:%.cpp=%.o)
.PHONY: all install depend clean doc
all: depend libeasyptp.so
install: all
$(CP) libeasyptp.so $(PREFIX)lib/
$(MKDIR) $(PREFIX)include/libeasyptp/chdk/
$(CP) -r ./include/* $(PREFIX)include/libeasyptp/
clean:
$(RM) libeasyptp.so $(OBJS) .depend
libeasyptp.so: $(OBJS)
$(CXX) $(CXXFLAGS) -shared -o $@ $^
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) $(LIBS) -c -o $@ $<
depend: .depend
.depend: $(SRCS)
@$(RM) ./.depend
$(CXX) $(CXXFLAGS) $(INCLUDES) -MM $^ > ./.depend;
-include .depend
doc:
$(DOXYGEN) ./doc/Doxyfile
docclean:
$(RM) ./doc/html ./doc/latex