70f42876d349da42ae6ddf50804693aae751ea19
[wimlib] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4
2
3 AM_CPPFLAGS     = -I$(top_srcdir)/src
4
5 AM_CFLAGS       = -std=gnu99 -D_LARGEFILE_SOURCE \
6                    -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
7
8 lib_LTLIBRARIES = libwim.la
9
10 libwim_la_LDFLAGS = -version-info 4:0:2 $(CYGWIN_EXTRA_LDFLAGS)
11
12 libwim_la_SOURCES =             \
13         src/add_image.c         \
14         src/buffer_io.h         \
15         src/compress.c          \
16         src/compress.h          \
17         src/decompress.c        \
18         src/decompress.h        \
19         src/delete_image.c      \
20         src/dentry.c            \
21         src/dentry.h            \
22         src/encoding.c          \
23         src/endianness.h        \
24         src/export_image.c      \
25         src/extract_image.c     \
26         src/hardlink.c          \
27         src/header.c            \
28         src/integrity.c         \
29         src/join.c              \
30         src/list.h              \
31         src/lookup_table.c      \
32         src/lookup_table.h      \
33         src/lz77.c              \
34         src/lzx-common.c        \
35         src/lzx-compress.c      \
36         src/lzx-decompress.c    \
37         src/lzx.h               \
38         src/metadata_resource.c \
39         src/mount_image.c       \
40         src/resource.c          \
41         src/rbtree.c            \
42         src/rbtree.h            \
43         src/security.c          \
44         src/security.h          \
45         src/sha1.c              \
46         src/sha1.h              \
47         src/split.c             \
48         src/symlink.c           \
49         src/timestamp.h         \
50         src/util.c              \
51         src/util.h              \
52         src/verify.c            \
53         src/wim.c               \
54         src/wimlib.h            \
55         src/wimlib_internal.h   \
56         src/win32.c             \
57         src/write.c             \
58         src/xml.c               \
59         src/xml.h               \
60         src/xpress-compress.c   \
61         src/xpress-decompress.c \
62         src/xpress.h
63
64 if WITH_NTFS_3G
65 libwim_la_SOURCES += src/ntfs-apply.c   \
66                      src/ntfs-capture.c
67 endif
68
69
70 EXTRA_libwim_la_SOURCES = src/sha1-ssse3.asm
71 libwim_la_DEPENDENCIES = $(SSSE3_SHA1_OBJ)
72 STRIP_FPIC = sh $(top_srcdir)/build-aux/strip_fPIC.sh
73
74 sha1-ssse3.lo:src/sha1-ssse3.asm
75         $(LIBTOOL) --mode=compile --tag=CC $(STRIP_FPIC) $(NASM) -f elf64 \
76         -DINTEL_SHA1_UPDATE_DEFAULT_DISPATCH=ssse3_not_found \
77         $<
78
79 libwim_la_LIBADD =              \
80         $(LIBXML2_LDADD)        \
81         $(LIBFUSE_LDADD)        \
82         $(LIBNTFS_3G_LDADD)     \
83         $(LTLIBICONV)           \
84         $(LIBCRYPTO_LDADD)      \
85         $(SSSE3_SHA1_OBJ)       \
86         $(PTHREAD_LDADD)
87
88 libwim_la_CFLAGS =              \
89         $(AM_CFLAGS)            \
90         $(VISIBILITY_CFLAGS)    \
91         $(LIBXML2_CFLAGS)       \
92         $(LIBFUSE_CFLAGS)       \
93         $(LIBNTFS_3G_CFLAGS)    \
94         $(LIBCRYPTO_CFLAGS)
95
96
97 bin_PROGRAMS     = imagex
98 imagex_SOURCES   = programs/imagex.c
99 imagex_LDADD     = $(top_builddir)/libwim.la
100
101 dist_bin_SCRIPTS = programs/mkwinpeimg
102
103 include_HEADERS = src/wimlib.h
104
105 EXTRA_DIST =                                    \
106         build-aux/strip_fPIC.sh                 \
107         archlinux                               \
108         debian                                  \
109         rpm                                     \
110         README.WINDOWS                          \
111         programs/install.cmd                    \
112         programs/wimapply.c                     \
113         tests/common_tests.sh                   \
114         tests/tests-common.sh                   \
115         tests/security_descriptor_1.base64      \
116         tests/security_descriptor_1.bin         \
117         tests/security_descriptor_2.base64      \
118         tests/security_descriptor_2.bin
119
120 pkgconfigdir    = @pkgconfigdir@
121 pkgconfig_DATA  = wimlib.pc
122
123 $(pkgconfig_DATA): config.status
124
125 man1_MANS =                     \
126         doc/imagex.1            \
127         doc/imagex-append.1     \
128         doc/imagex-apply.1      \
129         doc/imagex-capture.1    \
130         doc/imagex-delete.1     \
131         doc/imagex-dir.1        \
132         doc/imagex-export.1     \
133         doc/imagex-info.1       \
134         doc/imagex-join.1       \
135         doc/imagex-mount.1      \
136         doc/imagex-mountrw.1    \
137         doc/imagex-optimize.1   \
138         doc/imagex-split.1      \
139         doc/imagex-unmount.1    \
140         doc/mkwinpeimg.1
141
142 $(man1_MANS): config.status
143
144 check_PROGRAMS = tests/tree-cmp
145 tests_tree_cmp_SOURCES = tests/tree-cmp.c
146
147 dist_check_SCRIPTS = tests/test-imagex \
148                      tests/test-imagex-capture_and_apply
149
150 if WITH_FUSE
151 dist_check_SCRIPTS += tests/test-imagex-mount
152 endif
153
154 if WITH_NTFS_3G
155 dist_check_SCRIPTS += tests/test-imagex-ntfs
156 endif
157
158 if WINDOWS_BUILD
159 TESTS =
160 else
161 # TODO: The tests need to be re-written for Windows builds.  One issue (that
162 # applies to both test-imagex and test-imagex-capture_and_apply) is that
163 # Cygwin's 'ln -s' will create some sort of regular file with special contents
164 # rather than a reparse point.
165 TESTS = $(dist_check_SCRIPTS)
166 endif
167