Linus Walleij | fbbef8b | 2011-11-17 19:19:51 +0100 | [diff] [blame] | 1 | lib_LTLIBRARIES = libmtp.la |
| 2 | |
| 3 | libmtp_la_CFLAGS = @LIBUSB_CFLAGS@ |
| 4 | libmtp_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 Anwar | 8dca41d | 2012-08-18 20:36:13 +0200 | [diff] [blame] | 6 | music-players.h device-flags.h playlist-spl.h mtpz.h |
| 7 | |
| 8 | if MTPZ_COMPILE |
| 9 | libmtp_la_SOURCES += mtpz.c |
| 10 | endif |
Linus Walleij | fbbef8b | 2011-11-17 19:19:51 +0100 | [diff] [blame] | 11 | |
| 12 | if LIBUSB1_COMPILE |
| 13 | libmtp_la_SOURCES += libusb1-glue.c |
| 14 | endif |
| 15 | |
| 16 | if LIBUSB0_COMPILE |
| 17 | libmtp_la_SOURCES += libusb-glue.c |
| 18 | endif |
| 19 | |
Darran Kartaschew | 11082d3 | 2011-12-13 00:42:01 +0100 | [diff] [blame] | 20 | if LIBOPENUSB_COMPILE |
| 21 | libmtp_la_SOURCES += libopenusb1-glue.c |
| 22 | endif |
| 23 | |
Linus Walleij | eb8c6fe | 2006-02-03 09:46:22 +0000 | [diff] [blame] | 24 | include_HEADERS=libmtp.h |
Linus Walleij | b02a066 | 2006-04-25 08:05:09 +0000 | [diff] [blame] | 25 | EXTRA_DIST=libmtp.h.in libmtp.sym ptp-pack.c |
Linus Walleij | eb8c6fe | 2006-02-03 09:46:22 +0000 | [diff] [blame] | 26 | |
Linus Walleij | e8c5464 | 2006-03-28 09:45:00 +0000 | [diff] [blame] | 27 | # --------------------------------------------------------------------------- |
| 28 | # Advanced information about versioning: |
| 29 | # * "Writing shared libraries" by Mike Hearn |
Linus Walleij | 1aec6fd | 2011-06-08 09:08:33 +0200 | [diff] [blame] | 30 | # http://plan99.net/~mike/writing-shared-libraries.html |
Linus Walleij | e8c5464 | 2006-03-28 09:45:00 +0000 | [diff] [blame] | 31 | # * 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 Walleij | 362d13e | 2009-08-02 19:59:21 +0000 | [diff] [blame] | 38 | # if any interfaces have been removed. Removal has |
Linus Walleij | e8c5464 | 2006-03-28 09:45:00 +0000 | [diff] [blame] | 39 | # precedence over adding, so set to 0 if both happened. |
| 40 | # It denotes upward compatibility. |
Linus Walleij | 362d13e | 2009-08-02 19:59:21 +0000 | [diff] [blame] | 41 | # - REVISION (Minor): Increment any time the source changes; set to |
Linus Walleij | e8c5464 | 2006-03-28 09:45:00 +0000 | [diff] [blame] | 42 | # 0 if you incremented CURRENT. |
| 43 | # |
| 44 | # To summarize. Any interface *change* increment CURRENT. If that interface |
Linus Walleij | 362d13e | 2009-08-02 19:59:21 +0000 | [diff] [blame] | 45 | # 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 Walleij | e8c5464 | 2006-03-28 09:45:00 +0000 | [diff] [blame] | 47 | # REVISION is set to 0, otherwise REVISION is incremented. |
| 48 | # --------------------------------------------------------------------------- |
Linus Walleij | bbc4313 | 2013-03-15 10:01:52 +0100 | [diff] [blame^] | 49 | CURRENT=10 |
| 50 | AGE=1 |
| 51 | REVISION=0 |
Linus Walleij | eb8c6fe | 2006-02-03 09:46:22 +0000 | [diff] [blame] | 52 | SOVERSION=$(CURRENT):$(REVISION):$(AGE) |
Linus Walleij | 6f05002 | 2009-05-06 21:14:41 +0000 | [diff] [blame] | 53 | LT_CURRENT_MINUS_AGE=`expr $(CURRENT) - $(AGE)` |
Linus Walleij | eb8c6fe | 2006-02-03 09:46:22 +0000 | [diff] [blame] | 54 | |
| 55 | if COMPILE_MINGW32 |
Linus Walleij | 6f05002 | 2009-05-06 21:14:41 +0000 | [diff] [blame] | 56 | W32_LIBS=-lws2_32 |
| 57 | W32_LDFLAGS=-export-dynamic |
| 58 | if MS_LIB_EXE |
Linus Walleij | eb8c6fe | 2006-02-03 09:46:22 +0000 | [diff] [blame] | 59 | noinst_DATA=libmtp.lib |
Linus Walleij | 6f05002 | 2009-05-06 21:14:41 +0000 | [diff] [blame] | 60 | libmtp.def: $(srcdir)/libmtp.sym |
Linus Walleij | eb8c6fe | 2006-02-03 09:46:22 +0000 | [diff] [blame] | 61 | 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 Walleij | 6f05002 | 2009-05-06 21:14:41 +0000 | [diff] [blame] | 66 | cat $< >> libmtp.def |
Linus Walleij | eb8c6fe | 2006-02-03 09:46:22 +0000 | [diff] [blame] | 67 | libmtp.lib: libmtp.la libmtp.def |
| 68 | lib -name:libmtp-$(LT_CURRENT_MINUS_AGE).dll -def:libmtp.def -out:$@ |
| 69 | install-data-local: libmtp.lib libmtp.def |
| 70 | $(INSTALL) libmtp.def $(DESTDIR)$(libdir) |
| 71 | $(INSTALL) libmtp.lib $(DESTDIR)$(libdir) |
| 72 | endif |
Linus Walleij | 6f05002 | 2009-05-06 21:14:41 +0000 | [diff] [blame] | 73 | endif |
Linus Walleij | 8609af3 | 2006-12-28 21:25:17 +0000 | [diff] [blame] | 74 | |
Linus Walleij | 6f05002 | 2009-05-06 21:14:41 +0000 | [diff] [blame] | 75 | libmtp_la_LDFLAGS=@LDFLAGS@ -no-undefined -export-symbols $(srcdir)/libmtp.sym -version-info $(SOVERSION) $(W32_LDFLAGS) |
Linus Walleij | fbbef8b | 2011-11-17 19:19:51 +0100 | [diff] [blame] | 76 | libmtp_la_LIBADD=$(W32_LIBS) $(LTLIBICONV) @LIBUSB_LIBS@ |
Linus Walleij | 6f05002 | 2009-05-06 21:14:41 +0000 | [diff] [blame] | 77 | libmtp_la_DEPENDENCIES=$(srcdir)/libmtp.sym |
Linus Walleij | dd987c3 | 2009-01-06 00:35:05 +0000 | [diff] [blame] | 78 | |
Marcus Meissner | adffb35 | 2011-01-31 09:18:55 +0100 | [diff] [blame] | 79 | DISTCLEANFILES = _stdint.h gphoto2-endian.h |