1##
2## Author: Lasse Collin
3##
4## This file has been put into the public domain.
5## You can do whatever you want with this file.
6##
7
8SUBDIRS = api
9
10EXTRA_DIST =
11CLEANFILES =
12doc_DATA =
13
14lib_LTLIBRARIES = liblzma.la
15liblzma_la_SOURCES = $(top_srcdir)/src/common/tuklib_physmem.c
16liblzma_la_CPPFLAGS = \
17	-I$(top_srcdir)/src/liblzma/api \
18	-I$(top_srcdir)/src/liblzma/common \
19	-I$(top_srcdir)/src/liblzma/check \
20	-I$(top_srcdir)/src/liblzma/lz \
21	-I$(top_srcdir)/src/liblzma/rangecoder \
22	-I$(top_srcdir)/src/liblzma/lzma \
23	-I$(top_srcdir)/src/liblzma/delta \
24	-I$(top_srcdir)/src/liblzma/simple \
25	-I$(top_srcdir)/src/common \
26	-DTUKLIB_SYMBOL_PREFIX=lzma_
27liblzma_la_LDFLAGS = -no-undefined -version-info 5:3:0
28
29include $(srcdir)/common/Makefile.inc
30include $(srcdir)/check/Makefile.inc
31
32if COND_FILTER_LZ
33include $(srcdir)/lz/Makefile.inc
34endif
35
36if COND_FILTER_LZMA1
37include $(srcdir)/lzma/Makefile.inc
38include $(srcdir)/rangecoder/Makefile.inc
39endif
40
41if COND_FILTER_DELTA
42include $(srcdir)/delta/Makefile.inc
43endif
44
45if COND_FILTER_SIMPLE
46include $(srcdir)/simple/Makefile.inc
47endif
48
49
50## Windows-specific stuff
51
52# Windows resource compiler support. libtool knows what to do with .rc
53# files, but Automake (<= 1.11 at least) doesn't know.
54#
55# We want the resource file only in shared liblzma. To avoid linking it into
56# static liblzma, we overwrite the static object file with an object file
57# compiled from empty input. Note that GNU-specific features are OK here,
58# because on Windows we are compiled with the GNU toolchain.
59.rc.lo:
60	$(LIBTOOL) --mode=compile $(RC) $(DEFS) $(DEFAULT_INCLUDES) \
61		$(INCLUDES) $(liblzma_la_CPPFLAGS) $(CPPFLAGS) $(RCFLAGS) \
62		-i $< -o $@
63	echo > empty.c
64	$(COMPILE) -c empty.c -o $(*D)/$(*F).o
65
66# Remove ordinals from the generated .def file. People must link by name,
67# not by ordinal, because no one is going to track the ordinal numbers.
68liblzma.def: liblzma.la liblzma.def.in
69	sed 's/ \+@ *[0-9]\+//' liblzma.def.in > liblzma.def
70
71# Creating liblzma.def.in is a side effect of linking the library.
72liblzma.def.in: liblzma.la
73
74if COND_W32
75CLEANFILES += liblzma.def liblzma.def.in empty.c
76liblzma_la_SOURCES += liblzma_w32res.rc
77liblzma_la_LDFLAGS += -Xlinker --output-def -Xlinker liblzma.def.in
78
79## liblzma.def.in is created only when building shared liblzma, so don't
80## try to create liblzma.def when not building shared liblzma.
81if COND_SHARED
82doc_DATA += liblzma.def
83endif
84endif
85
86
87## pkg-config
88pkgconfigdir = $(libdir)/pkgconfig
89pkgconfig_DATA = liblzma.pc
90EXTRA_DIST += liblzma.pc.in
91