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