debian: Prepare for upload
[xz/debian.git] / src / xzdec / Makefile.am
blob5ff8e373e91d9f7c969f24c0f69a8ccf3dce7a81
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 =
54 if COND_XZDEC
55 bin_PROGRAMS += xzdec
56 dist_man_MANS = xzdec.1
57 endif
59 if COND_LZMADEC
60 bin_PROGRAMS += lzmadec
62 # Create the symlink lzmadec.1->xzdec.1 only if xzdec.1 was installed.
63 # This is better than creating a dangling symlink, especially
64 # because creating the link may fail due to the directory being missing.
66 # FIXME: The correct solution would be to install xzdec.1 as lzmadec.1
67 # but I don't know what is the sane way to do it and since this is a bit
68 # unusual situation anyway, it's not that important.
69 if COND_XZDEC
70 install-data-hook:
71         cd $(DESTDIR)$(mandir)/man1 && \
72         target=`echo xzdec | sed '$(transform)'` && \
73         link=`echo lzmadec | sed '$(transform)'` && \
74         rm -f $$link.1 && \
75         $(LN_S) $$target.1 $$link.1
77 uninstall-hook:
78         cd $(DESTDIR)$(mandir)/man1 && \
79         link=`echo lzmadec | sed '$(transform)'` && \
80         rm -f $$link.1
81 endif
82 endif