1#
2#  MusicBrainz -- The Internet music metadatabase
3#
4#  Copyright (C) 2013 Johannes Dewender
5#  Copyright (C) 2006 Matthias Friedrich
6#
7#  This library is free software; you can redistribute it and/or
8#  modify it under the terms of the GNU Lesser General Public
9#  License as published by the Free Software Foundation; either
10#  version 2.1 of the License, or (at your option) any later version.
11#
12#  This library is distributed in the hope that it will be useful,
13#  but WITHOUT ANY WARRANTY; without even the implied warranty of
14#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15#  Lesser General Public License for more details.
16#
17#  You should have received a copy of the GNU Lesser General Public
18#  License along with this library; if not, write to the Free Software
19#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20#
21
22EXTRA_DIST = libdiscid.pc.in Doxyfile.in CMakeLists.txt config-cmake.h.in
23
24# not deleted automatically, in contrast to the .lo
25CLEANFILES = versioninfo.o
26
27AM_CFLAGS = $(WARN_CFLAGS)
28AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
29
30
31pcdir = $(libdir)/pkgconfig
32pc_DATA = libdiscid.pc
33
34discid_incdir = $(includedir)/discid
35discid_inc_HEADERS = include/discid/discid.h
36noinst_HEADERS = include/discid/discid_private.h src/base64.h src/sha1.h
37noinst_HEADERS += test/test.h src/unix.h src/ntddcdrm.h
38
39
40if RUN_TESTS
41TESTS = test_core test_put test_read test_read_full
42endif
43
44# put tests that don't work here (so it shows up as expected failure)
45XFAIL =
46
47check_PROGRAMS = test_core test_put test_read test_read_full
48noinst_PROGRAMS = discid discisrc
49
50# Tests
51test_core_SOURCES = test/test.c test/test_core.c
52test_core_LDADD = $(top_builddir)/libdiscid.la
53test_put_SOURCES = test/test.c test/test_put.c
54test_put_LDADD = $(top_builddir)/libdiscid.la
55test_read_SOURCES = test/test.c test/test_read.c
56test_read_LDADD = $(top_builddir)/libdiscid.la
57test_read_full_SOURCES = test/test.c test/test_read_full.c
58test_read_full_LDADD = $(top_builddir)/libdiscid.la
59
60# Examples
61discid_SOURCES = examples/discid.c
62discid_LDADD = $(top_builddir)/libdiscid.la
63discisrc_SOURCES = examples/discisrc.c
64discisrc_LDADD = $(top_builddir)/libdiscid.la
65if HAVE_MUSICBRAINZ5
66noinst_PROGRAMS += disc_metadata
67disc_metadata_SOURCES = examples/disc_metadata.c
68disc_metadata_LDADD = $(top_builddir)/libdiscid.la -lmusicbrainz5
69endif
70
71
72lib_LTLIBRARIES = libdiscid.la
73
74libdiscid_la_SOURCES = src/base64.c src/sha1.c src/disc.c
75
76# use a (well defined) version number, rather than version-info calculations
77libdiscid_la_LDFLAGS = -version-number @libdiscid_VERSION_LT@ -no-undefined
78libdiscid_la_LIBADD =
79
80#if OS_BEOS
81#libdiscid_la_LIBADD += -lbe -lroot
82#endif
83if OS_DARWIN
84libdiscid_la_LDFLAGS += -framework CoreFoundation -framework IOKit
85libdiscid_la_SOURCES += src/toc.c src/unix.c src/disc_darwin.c
86endif
87if OS_NETBSD
88libdiscid_la_SOURCES += src/toc.c src/unix.c src/disc_bsd.c
89libdiscid_la_LIBADD += -lutil
90endif
91if OS_FREEBSD
92libdiscid_la_SOURCES += src/toc.c src/unix.c src/disc_bsd.c
93endif
94if OS_GENERIC
95libdiscid_la_SOURCES += src/disc_generic.c
96endif
97if OS_LINUX
98libdiscid_la_SOURCES += src/toc.c src/unix.c src/disc_linux.c
99endif
100#if OS_QNX
101#libdiscid_la_LIBADD += -lsocket
102#endif
103if OS_SOLARIS
104libdiscid_la_SOURCES += src/toc.c src/unix.c src/disc_solaris.c
105endif
106if OS_WIN32
107libdiscid_la_SOURCES += src/toc.c src/disc_win32.c versioninfo.rc
108endif
109
110
111# for Windows Resource Files
112RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)
113LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)
114
115.rc.o:
116	$(AM_V_GEN)$(RCCOMPILE) -i "$<" -o "$@"
117
118.rc.lo:
119	$(AM_V_GEN)$(LTRCCOMPILE) -i "$<" -o "$@"
120
121
122docs:
123	doxygen
124
125git-clean: maintainer-clean
126	rm -rf configure config.h.in Makefile.in
127	rm -rf aclocal.m4 build-aux/
128