blob: b67e3bba42f9cd45140ce823bb01dccc0984cd3b [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 \
Linus Walleijf3c44052008-08-16 21:14:56 +00006 music-players.h device-flags.h playlist-spl.h
Linus Walleijfbbef8b2011-11-17 19:19:51 +01007
8if LIBUSB1_COMPILE
9libmtp_la_SOURCES += libusb1-glue.c
10endif
11
12if LIBUSB0_COMPILE
13libmtp_la_SOURCES += libusb-glue.c
14endif
15
Linus Walleijeb8c6fe2006-02-03 09:46:22 +000016include_HEADERS=libmtp.h
Linus Walleijb02a0662006-04-25 08:05:09 +000017EXTRA_DIST=libmtp.h.in libmtp.sym ptp-pack.c
Linus Walleijeb8c6fe2006-02-03 09:46:22 +000018
Linus Walleije8c54642006-03-28 09:45:00 +000019# ---------------------------------------------------------------------------
20# Advanced information about versioning:
21# * "Writing shared libraries" by Mike Hearn
Linus Walleij1aec6fd2011-06-08 09:08:33 +020022# http://plan99.net/~mike/writing-shared-libraries.html
Linus Walleije8c54642006-03-28 09:45:00 +000023# * libtool.info chapter "Versioning"
24# * libtool.info chapter "Updating library version information"
25# ---------------------------------------------------------------------------
26# Versioning:
27# - CURRENT (Major): Increment if the interface has changes. AGE is always
28# *changed* at the same time.
29# - AGE (Micro): Increment if any interfaces have been added; set to 0
Linus Walleij362d13e2009-08-02 19:59:21 +000030# if any interfaces have been removed. Removal has
Linus Walleije8c54642006-03-28 09:45:00 +000031# precedence over adding, so set to 0 if both happened.
32# It denotes upward compatibility.
Linus Walleij362d13e2009-08-02 19:59:21 +000033# - REVISION (Minor): Increment any time the source changes; set to
Linus Walleije8c54642006-03-28 09:45:00 +000034# 0 if you incremented CURRENT.
35#
36# To summarize. Any interface *change* increment CURRENT. If that interface
Linus Walleij362d13e2009-08-02 19:59:21 +000037# change does not break upward compatibility (ie it is an addition),
38# increment AGE, Otherwise AGE is reset to 0. If CURRENT has changed,
Linus Walleije8c54642006-03-28 09:45:00 +000039# REVISION is set to 0, otherwise REVISION is incremented.
40# ---------------------------------------------------------------------------
Linus Walleij1aec6fd2011-06-08 09:08:33 +020041CURRENT=9
42AGE=0
Linus Walleijd5ab76b2011-10-22 15:04:02 +020043REVISION=1
Linus Walleijeb8c6fe2006-02-03 09:46:22 +000044SOVERSION=$(CURRENT):$(REVISION):$(AGE)
Linus Walleij6f050022009-05-06 21:14:41 +000045LT_CURRENT_MINUS_AGE=`expr $(CURRENT) - $(AGE)`
Linus Walleijeb8c6fe2006-02-03 09:46:22 +000046
47if COMPILE_MINGW32
Linus Walleij6f050022009-05-06 21:14:41 +000048W32_LIBS=-lws2_32
49W32_LDFLAGS=-export-dynamic
50if MS_LIB_EXE
Linus Walleijeb8c6fe2006-02-03 09:46:22 +000051noinst_DATA=libmtp.lib
Linus Walleij6f050022009-05-06 21:14:41 +000052libmtp.def: $(srcdir)/libmtp.sym
Linus Walleijeb8c6fe2006-02-03 09:46:22 +000053 echo "LIBRARY \"@PACKAGE@\"" > libmtp.def
54 echo "DESCRIPTION \"Media Transfer Protocol (MTP) library\"" >> libmtp.def
55 echo "VERSION @VERSION@" >> libmtp.def
56 echo >> libmtp.def
57 echo "EXPORTS" >> libmtp.def
Linus Walleij6f050022009-05-06 21:14:41 +000058 cat $< >> libmtp.def
Linus Walleijeb8c6fe2006-02-03 09:46:22 +000059libmtp.lib: libmtp.la libmtp.def
60 lib -name:libmtp-$(LT_CURRENT_MINUS_AGE).dll -def:libmtp.def -out:$@
61install-data-local: libmtp.lib libmtp.def
62 $(INSTALL) libmtp.def $(DESTDIR)$(libdir)
63 $(INSTALL) libmtp.lib $(DESTDIR)$(libdir)
64endif
Linus Walleij6f050022009-05-06 21:14:41 +000065endif
Linus Walleij8609af32006-12-28 21:25:17 +000066
Linus Walleij6f050022009-05-06 21:14:41 +000067libmtp_la_LDFLAGS=@LDFLAGS@ -no-undefined -export-symbols $(srcdir)/libmtp.sym -version-info $(SOVERSION) $(W32_LDFLAGS)
Linus Walleijfbbef8b2011-11-17 19:19:51 +010068libmtp_la_LIBADD=$(W32_LIBS) $(LTLIBICONV) @LIBUSB_LIBS@
Linus Walleij6f050022009-05-06 21:14:41 +000069libmtp_la_DEPENDENCIES=$(srcdir)/libmtp.sym
Linus Walleijdd987c32009-01-06 00:35:05 +000070
Marcus Meissneradffb352011-01-31 09:18:55 +010071DISTCLEANFILES = _stdint.h gphoto2-endian.h