Add WIMLIB_PROGRESS_MSG_HANDLE_ERROR
[wimlib] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4
2
3 AM_CPPFLAGS     = -I$(top_srcdir)/include $(WINDOWS_CPPFLAGS) \
4                   -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
5
6 AM_CFLAGS       = -std=gnu99 -Wmissing-prototypes -Wstrict-prototypes   \
7                   -Werror-implicit-function-declaration                 \
8                   -fno-common -Wundef -Wno-pointer-sign
9
10 if WINDOWS_NATIVE_BUILD
11 # This option is needed to make packed structures work as expected
12 # with gcc 4.7+ (mingw) on Windows.
13 AM_CFLAGS += -mno-ms-bitfields
14 endif
15
16 lib_LTLIBRARIES = libwim.la
17
18 libwim_la_LDFLAGS = -version-info 17:0:2 $(WINDOWS_LDFLAGS)
19
20 libwim_la_SOURCES =             \
21         src/add_image.c         \
22         src/avl_tree.c          \
23         src/capture_common.c    \
24         src/compress.c          \
25         src/compress_common.c   \
26         src/compress_parallel.c \
27         src/compress_serial.c   \
28         src/decompress.c        \
29         src/decompress_common.c \
30         src/delete_image.c      \
31         src/dentry.c            \
32         src/divsufsort.c        \
33         src/encoding.c          \
34         src/export_image.c      \
35         src/extract.c           \
36         src/file_io.c           \
37         src/header.c            \
38         src/inode.c             \
39         src/inode_fixup.c       \
40         src/integrity.c         \
41         src/iterate_dir.c       \
42         src/join.c              \
43         src/lookup_table.c      \
44         src/lz_binary_trees.c   \
45         src/lz_hash_chains.c    \
46         src/lz_lcp_interval_tree.c      \
47         src/lz_linked_suffix_array.c    \
48         src/lz_mf.c             \
49         src/lz_null.c           \
50         src/lz_repsearch.c      \
51         src/lz_suffix_array_utils.c     \
52         src/lzms-common.c       \
53         src/lzms-compress.c     \
54         src/lzms-decompress.c   \
55         src/lzx-common.c        \
56         src/lzx-compress.c      \
57         src/lzx-decompress.c    \
58         src/metadata_resource.c \
59         src/mount_image.c       \
60         src/pathlist.c          \
61         src/paths.c             \
62         src/progress.c          \
63         src/resource.c          \
64         src/reference.c         \
65         src/security.c          \
66         src/sha1.c              \
67         src/split.c             \
68         src/reparse.c           \
69         src/tagged_items.c      \
70         src/template.c          \
71         src/textfile.c          \
72         src/timestamp.c         \
73         src/update_image.c      \
74         src/util.c              \
75         src/verify.c            \
76         src/wildcard.c          \
77         src/wim.c               \
78         src/write.c             \
79         src/xml.c               \
80         src/xpress-compress.c   \
81         src/xpress-decompress.c \
82         include/wimlib/apply.h          \
83         include/wimlib/assert.h         \
84         include/wimlib/avl_tree.h       \
85         include/wimlib/callback.h       \
86         include/wimlib/capture.h        \
87         include/wimlib/case.h           \
88         include/wimlib/compiler.h       \
89         include/wimlib/compressor_ops.h \
90         include/wimlib/compress_common.h        \
91         include/wimlib/chunk_compressor.h       \
92         include/wimlib/decompressor_ops.h       \
93         include/wimlib/decompress_common.h      \
94         include/wimlib/dentry.h         \
95         include/wimlib/divsufsort.h     \
96         include/wimlib/encoding.h       \
97         include/wimlib/endianness.h     \
98         include/wimlib/error.h          \
99         include/wimlib/file_io.h        \
100         include/wimlib/glob.h           \
101         include/wimlib/header.h         \
102         include/wimlib/inode.h          \
103         include/wimlib/inode_table.h    \
104         include/wimlib/integrity.h      \
105         include/wimlib/list.h           \
106         include/wimlib/lookup_table.h   \
107         include/wimlib/lz_extend.h      \
108         include/wimlib/lz_hash3.h       \
109         include/wimlib/lz_mf.h          \
110         include/wimlib/lz_mf_ops.h      \
111         include/wimlib/lz_repsearch.h   \
112         include/wimlib/lz_suffix_array_utils.h  \
113         include/wimlib/lzms.h           \
114         include/wimlib/lzms_constants.h \
115         include/wimlib/lzx.h            \
116         include/wimlib/lzx_constants.h  \
117         include/wimlib/metadata.h       \
118         include/wimlib/pathlist.h       \
119         include/wimlib/paths.h          \
120         include/wimlib/progress.h       \
121         include/wimlib/reparse.h        \
122         include/wimlib/resource.h       \
123         include/wimlib/security.h       \
124         include/wimlib/security_descriptor.h    \
125         include/wimlib/sha1.h           \
126         include/wimlib/textfile.h       \
127         include/wimlib/timestamp.h      \
128         include/wimlib/types.h          \
129         include/wimlib/unix_data.h      \
130         include/wimlib/util.h           \
131         include/wimlib/version.h        \
132         include/wimlib/wildcard.h       \
133         include/wimlib/wim.h            \
134         include/wimlib/write.h          \
135         include/wimlib/xml.h            \
136         include/wimlib/xpress.h
137
138 if WITH_NTFS_3G
139 libwim_la_SOURCES += src/ntfs-3g_apply.c        \
140                      src/ntfs-3g_capture.c      \
141                      include/wimlib/ntfs_3g.h
142 endif
143
144 if WINDOWS_NATIVE_BUILD
145 libwim_la_SOURCES += src/win32_common.c                 \
146                      src/win32_apply.c                  \
147                      src/win32_capture.c                \
148                      src/win32_replacements.c           \
149                      src/wimboot.c                      \
150                      include/wimlib/win32_common.h      \
151                      include/wimlib/win32.h             \
152                      include/wimlib/wimboot.h           \
153                      include/wimlib/wof.h
154 else
155 libwim_la_SOURCES += src/unix_apply.c           \
156                      src/unix_capture.c
157 endif
158
159
160
161 EXTRA_libwim_la_SOURCES = src/sha1-ssse3.asm
162 libwim_la_DEPENDENCIES = $(SSSE3_SHA1_OBJ)
163
164 src/sha1-ssse3.lo:src/sha1-ssse3.asm
165         $(LIBTOOL) --mode=compile --tag NASM $(srcdir)/build-aux/nasm_lt.sh \
166         $(NASM) $(NAFLAGS) $(NASM_WINDOWS_FLAGS)                            \
167         -DINTEL_SHA1_UPDATE_FUNCNAME=$(NASM_SYMBOL_PREFIX)sha1_transform_blocks_ssse3       \
168         -DINTEL_SHA1_UPDATE_DEFAULT_DISPATCH=$(NASM_SYMBOL_PREFIX)sha1_transform_blocks_default  \
169         $< -o $@
170
171 libwim_la_LIBADD =              \
172         $(LIBXML2_LIBS)         \
173         $(LIBFUSE_LIBS)         \
174         $(LIBRT_LIBS)           \
175         $(LIBNTFS_3G_LIBS)      \
176         $(LTLIBICONV)           \
177         $(LIBCRYPTO_LIBS)       \
178         $(SSSE3_SHA1_OBJ)       \
179         $(PTHREAD_LDADD)
180
181 libwim_la_CFLAGS =              \
182         $(AM_CFLAGS)            \
183         $(VISIBILITY_CFLAGS)    \
184         $(LIBXML2_CFLAGS)       \
185         $(LIBFUSE_CFLAGS)       \
186         $(LIBNTFS_3G_CFLAGS)    \
187         $(LIBCRYPTO_CFLAGS)
188
189
190 bin_PROGRAMS     = imagex
191 imagex_SOURCES   = programs/imagex.c    \
192                    include/wimlib.h     \
193                    include/wimlib_tchar.h
194 imagex_LDADD     = $(top_builddir)/libwim.la
195 imagex_CFLAGS    = $(AM_CFLAGS) $(WINDOWS_CFLAGS) -Wno-deprecated-declarations
196
197 if WINDOWS_NATIVE_BUILD
198 imagex_SOURCES += programs/imagex-win32.c       \
199                   programs/imagex-win32.h       \
200                   programs/wgetopt.c            \
201                   programs/wgetopt.h
202 endif
203
204 imagex_cmds =   append  \
205                 apply   \
206                 capture \
207                 delete  \
208                 dir     \
209                 export  \
210                 extract \
211                 info    \
212                 join    \
213                 mount   \
214                 mountrw \
215                 optimize\
216                 split   \
217                 unmount \
218                 update  \
219                 verify
220
221 install-exec-hook:
222         if [ "@IMAGEX_PROGNAME@" != imagex ]; then                          \
223                 cd $(DESTDIR)$(bindir) && mv -f imagex "@IMAGEX_PROGNAME@"; \
224         fi
225         for cmd in $(imagex_cmds); do                           \
226                 cd $(DESTDIR)$(bindir) &&                       \
227                         ln -f "@IMAGEX_PROGNAME@" wim$${cmd};   \
228         done
229
230 install-data-hook:
231         for cmd in $(imagex_cmds); do                                       \
232                 cd $(DESTDIR)$(mandir)/man1 &&                              \
233                         ln -sf "@IMAGEX_PROGNAME@-$${cmd}.1" wim$${cmd}.1;  \
234         done
235
236 uninstall-hook:
237         if [ "@IMAGEX_PROGNAME@" != imagex ]; then              \
238                 rm -f $(DESTDIR)$(bindir)/"@IMAGEX_PROGNAME@";  \
239                 rm -f $(DESTDIR)$(bindir)/imagex;               \
240         fi
241         for cmd in $(imagex_cmds); do                           \
242                 rm -f $(DESTDIR)$(bindir)/wim$${cmd};           \
243         done
244         for cmd in $(imagex_cmds); do                           \
245                 rm -f $(DESTDIR)$(mandir)/man1/wim$${cmd}.1;    \
246         done
247
248
249 dist_bin_SCRIPTS = programs/mkwinpeimg
250
251 include_HEADERS = include/wimlib.h
252
253 EXTRA_DIST =                                    \
254         build-aux/nasm_lt.sh                    \
255         archlinux                               \
256         debian                                  \
257         rpm                                     \
258         examples                                \
259         COPYING                                 \
260         COPYING.GPLv3                           \
261         COPYING.LGPLv3                          \
262         README                                  \
263         README.WINDOWS                          \
264         tests/common_tests.sh                   \
265         tests/tests-common.sh                   \
266         tests/security_descriptor_1.base64      \
267         tests/security_descriptor_1.bin         \
268         tests/security_descriptor_2.base64      \
269         tests/security_descriptor_2.bin
270
271 pkgconfigdir    = @pkgconfigdir@
272 pkgconfig_DATA  = wimlib.pc
273
274 $(pkgconfig_DATA): config.status
275
276 wimlib_manpages =                               \
277         doc/man1/@IMAGEX_PROGNAME@.1                    \
278         doc/man1/@IMAGEX_PROGNAME@-append.1             \
279         doc/man1/@IMAGEX_PROGNAME@-apply.1              \
280         doc/man1/@IMAGEX_PROGNAME@-capture.1            \
281         doc/man1/@IMAGEX_PROGNAME@-delete.1             \
282         doc/man1/@IMAGEX_PROGNAME@-dir.1                \
283         doc/man1/@IMAGEX_PROGNAME@-export.1             \
284         doc/man1/@IMAGEX_PROGNAME@-extract.1            \
285         doc/man1/@IMAGEX_PROGNAME@-info.1               \
286         doc/man1/@IMAGEX_PROGNAME@-join.1               \
287         doc/man1/@IMAGEX_PROGNAME@-mount.1              \
288         doc/man1/@IMAGEX_PROGNAME@-mountrw.1            \
289         doc/man1/@IMAGEX_PROGNAME@-optimize.1   \
290         doc/man1/@IMAGEX_PROGNAME@-split.1              \
291         doc/man1/@IMAGEX_PROGNAME@-unmount.1            \
292         doc/man1/@IMAGEX_PROGNAME@-update.1             \
293         doc/man1/@IMAGEX_PROGNAME@-verify.1             \
294         doc/man1/mkwinpeimg.1
295
296 man1_MANS = $(wimlib_manpages)
297 DISTCLEANFILES = $(wimlib_manpages)
298
299 $(man1_MANS): config.status
300
301 check_PROGRAMS = tests/tree-cmp
302 tests_tree_cmp_SOURCES = tests/tree-cmp.c
303
304 dist_check_SCRIPTS = tests/test-imagex \
305                      tests/test-imagex-capture_and_apply \
306                      tests/test-imagex-update_and_extract
307
308 if WITH_FUSE
309 dist_check_SCRIPTS += tests/test-imagex-mount
310 endif
311
312 if WITH_NTFS_3G
313 dist_check_SCRIPTS += tests/test-imagex-ntfs
314 endif
315
316 if WINDOWS_NATIVE_BUILD
317 # Tests are run manually for Windows builds.
318 TESTS =
319 else
320 TESTS = $(dist_check_SCRIPTS)
321 endif
322