1 | ## SPDX-License-Identifier: 0BSD
|
---|
2 | ## Author: Lasse Collin
|
---|
3 |
|
---|
4 | SUBDIRS = api
|
---|
5 |
|
---|
6 | EXTRA_DIST =
|
---|
7 | CLEANFILES =
|
---|
8 | doc_DATA =
|
---|
9 |
|
---|
10 | lib_LTLIBRARIES = liblzma.la
|
---|
11 | liblzma_la_SOURCES =
|
---|
12 | liblzma_la_CPPFLAGS = \
|
---|
13 | -I$(top_srcdir)/src/liblzma/api \
|
---|
14 | -I$(top_srcdir)/src/liblzma/common \
|
---|
15 | -I$(top_srcdir)/src/liblzma/check \
|
---|
16 | -I$(top_srcdir)/src/liblzma/lz \
|
---|
17 | -I$(top_srcdir)/src/liblzma/rangecoder \
|
---|
18 | -I$(top_srcdir)/src/liblzma/lzma \
|
---|
19 | -I$(top_srcdir)/src/liblzma/delta \
|
---|
20 | -I$(top_srcdir)/src/liblzma/simple \
|
---|
21 | -I$(top_srcdir)/src/common \
|
---|
22 | -DTUKLIB_SYMBOL_PREFIX=lzma_
|
---|
23 | liblzma_la_LDFLAGS = -no-undefined -version-info 13:1:8
|
---|
24 |
|
---|
25 | EXTRA_DIST += liblzma_generic.map liblzma_linux.map validate_map.sh
|
---|
26 | if COND_SYMVERS_GENERIC
|
---|
27 | liblzma_la_LDFLAGS += \
|
---|
28 | -Wl,--version-script=$(top_srcdir)/src/liblzma/liblzma_generic.map
|
---|
29 | endif
|
---|
30 | if COND_SYMVERS_LINUX
|
---|
31 | liblzma_la_LDFLAGS += \
|
---|
32 | -Wl,--version-script=$(top_srcdir)/src/liblzma/liblzma_linux.map
|
---|
33 | endif
|
---|
34 |
|
---|
35 | liblzma_la_SOURCES += ../common/tuklib_physmem.c
|
---|
36 |
|
---|
37 | if COND_THREADS
|
---|
38 | liblzma_la_SOURCES += ../common/tuklib_cpucores.c
|
---|
39 | endif
|
---|
40 |
|
---|
41 | include $(srcdir)/common/Makefile.inc
|
---|
42 | include $(srcdir)/check/Makefile.inc
|
---|
43 |
|
---|
44 | if COND_FILTER_LZ
|
---|
45 | include $(srcdir)/lz/Makefile.inc
|
---|
46 | endif
|
---|
47 |
|
---|
48 | if COND_FILTER_LZMA1
|
---|
49 | include $(srcdir)/lzma/Makefile.inc
|
---|
50 | include $(srcdir)/rangecoder/Makefile.inc
|
---|
51 | endif
|
---|
52 |
|
---|
53 | if COND_FILTER_DELTA
|
---|
54 | include $(srcdir)/delta/Makefile.inc
|
---|
55 | endif
|
---|
56 |
|
---|
57 | if COND_FILTER_SIMPLE
|
---|
58 | include $(srcdir)/simple/Makefile.inc
|
---|
59 | endif
|
---|
60 |
|
---|
61 |
|
---|
62 | ## Windows-specific stuff
|
---|
63 |
|
---|
64 | # Windows resource compiler support. libtool knows what to do with .rc
|
---|
65 | # files, but Automake (<= 1.11 at least) doesn't know.
|
---|
66 | #
|
---|
67 | # We want the resource file only in shared liblzma. To avoid linking it into
|
---|
68 | # static liblzma, we overwrite the static object file with an object file
|
---|
69 | # compiled from empty input. Note that GNU-specific features are OK here,
|
---|
70 | # because on Windows we are compiled with the GNU toolchain.
|
---|
71 | #
|
---|
72 | # The typedef in empty.c will prevent an empty translation unit, which is
|
---|
73 | # not allowed by the C standard. It results in a warning with
|
---|
74 | # -Wempty-translation-unit with Clang or -pedantic for GCC.
|
---|
75 | .rc.lo:
|
---|
76 | $(LIBTOOL) --mode=compile $(RC) $(DEFS) $(DEFAULT_INCLUDES) \
|
---|
77 | $(INCLUDES) $(liblzma_la_CPPFLAGS) $(CPPFLAGS) $(RCFLAGS) \
|
---|
78 | -i $< -o $@
|
---|
79 | echo "typedef void empty;" > empty.c
|
---|
80 | $(COMPILE) -c empty.c -o $(*D)/$(*F).o
|
---|
81 |
|
---|
82 | # Remove ordinals from the generated .def file. People must link by name,
|
---|
83 | # not by ordinal, because no one is going to track the ordinal numbers.
|
---|
84 | liblzma.def: liblzma.la liblzma.def.in
|
---|
85 | sed 's/ \+@ *[0-9]\+//' liblzma.def.in > liblzma.def
|
---|
86 |
|
---|
87 | # Creating liblzma.def.in is a side effect of linking the library.
|
---|
88 | liblzma.def.in: liblzma.la
|
---|
89 |
|
---|
90 | if COND_W32
|
---|
91 | CLEANFILES += liblzma.def liblzma.def.in empty.c
|
---|
92 | liblzma_la_SOURCES += liblzma_w32res.rc
|
---|
93 | liblzma_la_LDFLAGS += -Xlinker --output-def -Xlinker liblzma.def.in
|
---|
94 |
|
---|
95 | ## liblzma.def.in is created only when building shared liblzma, so don't
|
---|
96 | ## try to create liblzma.def when not building shared liblzma.
|
---|
97 | if COND_SHARED
|
---|
98 | doc_DATA += liblzma.def
|
---|
99 | endif
|
---|
100 | endif
|
---|
101 |
|
---|
102 |
|
---|
103 | ## pkg-config
|
---|
104 | pkgconfigdir = $(libdir)/pkgconfig
|
---|
105 | pkgconfig_DATA = liblzma.pc
|
---|
106 | EXTRA_DIST += liblzma.pc.in
|
---|
107 |
|
---|
108 | pc_verbose = $(pc_verbose_@AM_V@)
|
---|
109 | pc_verbose_ = $(pc_verbose_@AM_DEFAULT_V@)
|
---|
110 | pc_verbose_0 = @echo " PC " $@;
|
---|
111 |
|
---|
112 | liblzma.pc: $(srcdir)/liblzma.pc.in
|
---|
113 | $(AM_V_at)rm -f $@
|
---|
114 | $(pc_verbose)sed \
|
---|
115 | -e 's,@prefix[@],$(prefix),g' \
|
---|
116 | -e 's,@exec_prefix[@],$(exec_prefix),g' \
|
---|
117 | -e 's,@libdir[@],$(libdir),g' \
|
---|
118 | -e 's,@includedir[@],$(includedir),g' \
|
---|
119 | -e 's,@PACKAGE_URL[@],$(PACKAGE_URL),g' \
|
---|
120 | -e 's,@PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \
|
---|
121 | -e 's,@PTHREAD_CFLAGS[@],$(PTHREAD_CFLAGS),g' \
|
---|
122 | -e 's,@LIBS[@],$(LIBS),g' \
|
---|
123 | < $(srcdir)/liblzma.pc.in > $@ || { rm -f $@; exit 1; }
|
---|
124 |
|
---|
125 | clean-local:
|
---|
126 | rm -f liblzma.pc
|
---|