blob: b5e367debbe769d79f6b5e9f538cd45bed78acc2 [file] [log] [blame]
Linus Walleijfbbef8b2011-11-17 19:19:51 +01001lib_LTLIBRARIES = libmtp.la
2
3libmtp_la_CFLAGS = @LIBUSB_CFLAGS@
4libmtp_la_SOURCES = libmtp.c unicode.c unicode.h util.c util.h playlist-spl.c \
5 gphoto2-endian.h _stdint.h ptp.c ptp.h libusb-glue.h \
Sajid Anwar8dca41d2012-08-18 20:36:13 +02006 music-players.h device-flags.h playlist-spl.h mtpz.h
7
8if MTPZ_COMPILE
9libmtp_la_SOURCES += mtpz.c
10endif
Linus Walleijfbbef8b2011-11-17 19:19:51 +010011
12if LIBUSB1_COMPILE
13libmtp_la_SOURCES += libusb1-glue.c
14endif
15
16if LIBUSB0_COMPILE
17libmtp_la_SOURCES += libusb-glue.c
18endif
19
Darran Kartaschew11082d32011-12-13 00:42:01 +010020if LIBOPENUSB_COMPILE
21libmtp_la_SOURCES += libopenusb1-glue.c
22endif
23
Linus Walleijeb8c6fe2006-02-03 09:46:22 +000024include_HEADERS=libmtp.h
Linus Walleijb02a0662006-04-25 08:05:09 +000025EXTRA_DIST=libmtp.h.in libmtp.sym ptp-pack.c
Linus Walleijeb8c6fe2006-02-03 09:46:22 +000026
Linus Walleije8c54642006-03-28 09:45:00 +000027# ---------------------------------------------------------------------------
28# Advanced information about versioning:
29# * "Writing shared libraries" by Mike Hearn
Linus Walleij1aec6fd2011-06-08 09:08:33 +020030# http://plan99.net/~mike/writing-shared-libraries.html
Linus Walleije8c54642006-03-28 09:45:00 +000031# * libtool.info chapter "Versioning"
32# * libtool.info chapter "Updating library version information"
33# ---------------------------------------------------------------------------
34# Versioning:
35# - CURRENT (Major): Increment if the interface has changes. AGE is always
36# *changed* at the same time.
37# - AGE (Micro): Increment if any interfaces have been added; set to 0
Linus Walleij362d13e2009-08-02 19:59:21 +000038# if any interfaces have been removed. Removal has
Linus Walleije8c54642006-03-28 09:45:00 +000039# precedence over adding, so set to 0 if both happened.
40# It denotes upward compatibility.
Linus Walleij362d13e2009-08-02 19:59:21 +000041# - REVISION (Minor): Increment any time the source changes; set to
Linus Walleije8c54642006-03-28 09:45:00 +000042# 0 if you incremented CURRENT.
43#
44# To summarize. Any interface *change* increment CURRENT. If that interface
Linus Walleij362d13e2009-08-02 19:59:21 +000045# change does not break upward compatibility (ie it is an addition),
46# increment AGE, Otherwise AGE is reset to 0. If CURRENT has changed,
Linus Walleije8c54642006-03-28 09:45:00 +000047# REVISION is set to 0, otherwise REVISION is incremented.
48# ---------------------------------------------------------------------------
Linus Walleijbbc43132013-03-15 10:01:52 +010049CURRENT=10
50AGE=1
51REVISION=0
Linus Walleijeb8c6fe2006-02-03 09:46:22 +000052SOVERSION=$(CURRENT):$(REVISION):$(AGE)
Linus Walleij6f050022009-05-06 21:14:41 +000053LT_CURRENT_MINUS_AGE=`expr $(CURRENT) - $(AGE)`
Linus Walleijeb8c6fe2006-02-03 09:46:22 +000054
55if COMPILE_MINGW32
Linus Walleij6f050022009-05-06 21:14:41 +000056W32_LIBS=-lws2_32
57W32_LDFLAGS=-export-dynamic
58if MS_LIB_EXE
Linus Walleijeb8c6fe2006-02-03 09:46:22 +000059noinst_DATA=libmtp.lib
Linus Walleij6f050022009-05-06 21:14:41 +000060libmtp.def: $(srcdir)/libmtp.sym
Linus Walleijeb8c6fe2006-02-03 09:46:22 +000061 echo "LIBRARY \"@PACKAGE@\"" > libmtp.def
62 echo "DESCRIPTION \"Media Transfer Protocol (MTP) library\"" >> libmtp.def
63 echo "VERSION @VERSION@" >> libmtp.def
64 echo >> libmtp.def
65 echo "EXPORTS" >> libmtp.def
Linus Walleij6f050022009-05-06 21:14:41 +000066 cat $< >> libmtp.def
Linus Walleijeb8c6fe2006-02-03 09:46:22 +000067libmtp.lib: libmtp.la libmtp.def
68 lib -name:libmtp-$(LT_CURRENT_MINUS_AGE).dll -def:libmtp.def -out:$@
69install-data-local: libmtp.lib libmtp.def
70 $(INSTALL) libmtp.def $(DESTDIR)$(libdir)
71 $(INSTALL) libmtp.lib $(DESTDIR)$(libdir)
72endif
Linus Walleij6f050022009-05-06 21:14:41 +000073endif
Linus Walleij8609af32006-12-28 21:25:17 +000074
Linus Walleij6f050022009-05-06 21:14:41 +000075libmtp_la_LDFLAGS=@LDFLAGS@ -no-undefined -export-symbols $(srcdir)/libmtp.sym -version-info $(SOVERSION) $(W32_LDFLAGS)
Linus Walleijfbbef8b2011-11-17 19:19:51 +010076libmtp_la_LIBADD=$(W32_LIBS) $(LTLIBICONV) @LIBUSB_LIBS@
Linus Walleij6f050022009-05-06 21:14:41 +000077libmtp_la_DEPENDENCIES=$(srcdir)/libmtp.sym
Linus Walleijdd987c32009-01-06 00:35:05 +000078
Marcus Meissneradffb352011-01-31 09:18:55 +010079DISTCLEANFILES = _stdint.h gphoto2-endian.h