]> icculus.org git repositories - icculus/xz.git/blob - src/xz/Makefile.am
Escape dashes in xzmore.1
[icculus/xz.git] / src / xz / Makefile.am
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
8 bin_PROGRAMS = xz
9
10 xz_SOURCES = \
11         args.c \
12         args.h \
13         coder.c \
14         coder.h \
15         file_io.c \
16         file_io.h \
17         hardware.c \
18         hardware.h \
19         main.c \
20         main.h \
21         message.c \
22         message.h \
23         options.c \
24         options.h \
25         private.h \
26         signals.c \
27         signals.h \
28         suffix.c \
29         suffix.h \
30         util.c \
31         util.h \
32         $(top_srcdir)/src/common/tuklib_open_stdxxx.c \
33         $(top_srcdir)/src/common/tuklib_progname.c \
34         $(top_srcdir)/src/common/tuklib_exit.c \
35         $(top_srcdir)/src/common/tuklib_physmem.c \
36         $(top_srcdir)/src/common/tuklib_cpucores.c
37
38 if COND_W32
39 xz_SOURCES += xz_w32res.rc
40 endif
41
42 xz_CPPFLAGS = \
43         -DLOCALEDIR=\"$(localedir)\" \
44         -I$(top_srcdir)/src/common \
45         -I$(top_srcdir)/src/liblzma/api \
46         -I$(top_builddir)/lib \
47         $(STATIC_CPPFLAGS)
48
49 xz_LDFLAGS = $(STATIC_LDFLAGS)
50 xz_LDADD = $(top_builddir)/src/liblzma/liblzma.la
51
52 if COND_GNULIB
53 xz_LDADD += $(top_builddir)/lib/libgnu.a
54 endif
55
56 # libgnu.a may need these libs, so this must be after libgnu.a.
57 xz_LDADD += $(LTLIBINTL)
58
59
60 # Windows resource compiler support
61 .rc.o:
62         $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
63                 $(xz_CPPFLAGS) $(CPPFLAGS) $(RCFLAGS) -i $< -o $@
64
65
66 dist_man_MANS = xz.1
67
68
69 ## Create symlinks for unxz and xzcat for convenience. Create symlinks also
70 ## for lzma, unlzma, and lzcat for compatibility with LZMA Utils 4.32.x.
71 xzlinks = unxz xzcat lzma unlzma lzcat
72
73 install-exec-hook:
74         cd $(DESTDIR)$(bindir) && \
75         target=`echo xz | sed '$(transform)'`$(EXEEXT) && \
76         for name in $(xzlinks); do \
77                 link=`echo $$name | sed '$(transform)'`$(LN_EXEEXT) && \
78                 rm -f $$link && \
79                 $(LN_S) $$target $$link; \
80         done
81
82 install-data-hook:
83         cd $(DESTDIR)$(mandir)/man1 && \
84         target=`echo xz | sed '$(transform)'` && \
85         for name in $(xzlinks); do \
86                 link=`echo $$name | sed '$(transform)'` && \
87                 rm -f $$link.1 && \
88                 $(LN_S) $$target.1 $$link.1; \
89         done
90
91 uninstall-hook:
92         cd $(DESTDIR)$(bindir) && \
93         for name in $(xzlinks); do \
94                 link=`echo $$name | sed '$(transform)'`$(LN_EXEEXT) && \
95                 rm -f $$link; \
96         done
97         cd $(DESTDIR)$(mandir)/man1 && \
98         for name in $(xzlinks); do \
99                 link=`echo $$name | sed '$(transform)'` && \
100                 rm -f $$link.1; \
101         done