liblzma: Improve documentation in index.h
[xz/debian.git] / src / xzdec / Makefile.am
blob90f1e922a07c6eecbfa011316444199f297cd0b5
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 ##
8 # Windows resource compiler support. It's fine to use xz_CPPFLAGS
9 # also for lzmadec.
10 .rc.o:
11         $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
12                 $(xzdec_CPPFLAGS) $(CPPFLAGS) $(RCFLAGS) -i $< -o $@
15 xzdec_SOURCES = \
16         xzdec.c \
17         ../common/tuklib_progname.c \
18         ../common/tuklib_exit.c
20 if COND_W32
21 xzdec_SOURCES += xzdec_w32res.rc
22 endif
24 xzdec_CPPFLAGS = \
25         -DTUKLIB_GETTEXT=0 \
26         -I$(top_srcdir)/src/common \
27         -I$(top_srcdir)/src/liblzma/api \
28         -I$(top_builddir)/lib
29 xzdec_LDADD = $(top_builddir)/src/liblzma/liblzma.la
31 if COND_GNULIB
32 xzdec_LDADD += $(top_builddir)/lib/libgnu.a
33 endif
35 xzdec_LDADD += $(LTLIBINTL)
38 lzmadec_SOURCES = \
39         xzdec.c \
40         ../common/tuklib_progname.c \
41         ../common/tuklib_exit.c
43 if COND_W32
44 lzmadec_SOURCES += lzmadec_w32res.rc
45 endif
47 lzmadec_CPPFLAGS = $(xzdec_CPPFLAGS) -DLZMADEC
48 lzmadec_LDFLAGS = $(xzdec_LDFLAGS)
49 lzmadec_LDADD = $(xzdec_LDADD)
52 bin_PROGRAMS =
53 lzmadecmanlink =
55 if COND_XZDEC
56 bin_PROGRAMS += xzdec
57 dist_man_MANS = xzdec.1
58 endif
60 if COND_LZMADEC
61 bin_PROGRAMS += lzmadec
63 # Create the symlink lzmadec.1->xzdec.1 only if xzdec.1 was installed.
64 # This is better than creating a dangling symlink. The correct solution
65 # would be to install xzdec.1 as lzmadec.1 but this code is already too
66 # complicated so I won't do it. Installing only lzmadec is a bit unusual
67 # situation anyway so it's not that important.
68 if COND_XZDEC
69 lzmadecmanlink += lzmadec
70 endif
71 endif
73 if COND_XZDEC
74 # The installation of translated man pages abuses Automake internals
75 # by calling "install-man" with redefined dist_man_MANS and man_MANS.
76 # If this breaks some day, don't blame Automake developers.
77 install-data-hook:
78         languages= ; \
79         if test "$(USE_NLS)" = yes && test -d "$(top_srcdir)/po4a/man"; then \
80                 languages=`ls "$(top_srcdir)/po4a/man"`; \
81         fi; \
82         target=`echo xzdec | sed '$(transform)'` && \
83         link=`echo lzmadec | sed '$(transform)'` && \
84         for lang in . $$languages; do \
85                 man="$(top_srcdir)/po4a/man/$$lang/xzdec.1" ; \
86                 if test -f "$$man"; then \
87                         $(MAKE) dist_man_MANS="$$man" man_MANS= \
88                                 mandir="$(mandir)/$$lang" install-man; \
89                 fi; \
90                 man1dir="$(DESTDIR)$(mandir)/$$lang/man1" && \
91                 if test -f "$$man1dir/$$target.1"; then \
92                         if test -n "$(lzmadecmanlink)"; then ( \
93                                 cd "$$man1dir" && \
94                                 rm -f "$$link.1" && \
95                                 $(LN_S) "$$target.1" "$$link.1" \
96                         ); fi; \
97                 fi; \
98         done
100 uninstall-hook:
101         languages= ; \
102         if test "$(USE_NLS)" = yes && test -d "$(top_srcdir)/po4a/man"; then \
103                 languages=`ls "$(top_srcdir)/po4a/man"`; \
104         fi; \
105         for lang in . $$languages; do \
106                 for name in xzdec $(lzmadecmanlink); do \
107                         name=`echo $$name | sed '$(transform)'` && \
108                         rm -f "$(DESTDIR)$(mandir)/$$lang/man1/$$name.1"; \
109                 done; \
110         done
111 endif