]> wimlib.net Git - wimlib/blob - Makefile.am
[EXPERIMENTAL, FOR BENCHMARKING ONLY] Zstandard compression support
[wimlib] / Makefile.am
1 ##############################################################################
2 #                               General                                      #
3 ##############################################################################
4
5
6 ACLOCAL_AMFLAGS = -I m4
7
8 AM_CPPFLAGS     = -I$(top_srcdir)/include $(PLATFORM_CPPFLAGS)  \
9                   -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
10
11 # Note: -std=gnu99 instead of -std=c99 is needed for unnamed structs and unions,
12 # which are in C11 but not C99.  But we can't yet actually use -std=c11 because
13 # we want to support older versions of gcc.
14 AM_CFLAGS       = -std=gnu99 $(PLATFORM_CFLAGS) -fno-common     \
15                   -Wmissing-prototypes -Wstrict-prototypes      \
16                   -Wundef -Wno-pointer-sign
17
18 AM_LDFLAGS      = $(PLATFORM_LDFLAGS)
19
20 EXTRA_DIST      = README README.WINDOWS                                 \
21                   COPYING COPYING.GPLv3 COPYING.LGPLv3 COPYING.CC0      \
22                   examples                                              \
23                   archlinux debian rpm
24
25 ##############################################################################
26 #                               Library                                      #
27 ##############################################################################
28
29 lib_LTLIBRARIES = libwim.la
30 include_HEADERS = include/wimlib.h
31
32 pkgconfigdir    = @pkgconfigdir@
33 pkgconfig_DATA  = wimlib.pc
34 wimlib.pc: config.status
35
36 libwim_la_SOURCES =             \
37         src/add_image.c         \
38         src/avl_tree.c          \
39         src/blob_table.c        \
40         src/compress.c          \
41         src/compress_common.c   \
42         src/compress_parallel.c \
43         src/compress_serial.c   \
44         src/decompress.c        \
45         src/decompress_common.c \
46         src/delete_image.c      \
47         src/dentry.c            \
48         src/divsufsort.c        \
49         src/encoding.c          \
50         src/error.c             \
51         src/export_image.c      \
52         src/extract.c           \
53         src/file_io.c           \
54         src/header.c            \
55         src/inode.c             \
56         src/inode_fixup.c       \
57         src/inode_table.c       \
58         src/integrity.c         \
59         src/iterate_dir.c       \
60         src/join.c              \
61         src/lcpit_matchfinder.c \
62         src/lzms_common.c       \
63         src/lzms_compress.c     \
64         src/lzms_decompress.c   \
65         src/lzx_common.c        \
66         src/lzx_compress.c      \
67         src/lzx_decompress.c    \
68         src/metadata_resource.c \
69         src/mount_image.c       \
70         src/pathlist.c          \
71         src/paths.c             \
72         src/pattern.c           \
73         src/progress.c          \
74         src/reference.c         \
75         src/registry.c          \
76         src/reparse.c           \
77         src/resource.c          \
78         src/scan.c              \
79         src/security.c          \
80         src/sha1.c              \
81         src/solid.c             \
82         src/split.c             \
83         src/tagged_items.c      \
84         src/template.c          \
85         src/textfile.c          \
86         src/timestamp.c         \
87         src/update_image.c      \
88         src/util.c              \
89         src/verify.c            \
90         src/wim.c               \
91         src/write.c             \
92         src/x86_cpu_features.c  \
93         src/xml.c               \
94         src/xml_windows.c       \
95         src/xpress_compress.c   \
96         src/xpress_decompress.c \
97         include/wimlib/alloca.h         \
98         include/wimlib/apply.h          \
99         include/wimlib/assert.h         \
100         include/wimlib/avl_tree.h       \
101         include/wimlib/bitops.h         \
102         include/wimlib/blob_table.h     \
103         include/wimlib/bt_matchfinder.h \
104         include/wimlib/case.h           \
105         include/wimlib/compiler.h       \
106         include/wimlib/compressor_ops.h \
107         include/wimlib/compress_common.h        \
108         include/wimlib/chunk_compressor.h       \
109         include/wimlib/decompressor_ops.h       \
110         include/wimlib/decompress_common.h      \
111         include/wimlib/dentry.h         \
112         include/wimlib/divsufsort.h     \
113         include/wimlib/encoding.h       \
114         include/wimlib/endianness.h     \
115         include/wimlib/error.h          \
116         include/wimlib/file_io.h        \
117         include/wimlib/glob.h           \
118         include/wimlib/guid.h           \
119         include/wimlib/hc_matchfinder.h \
120         include/wimlib/header.h         \
121         include/wimlib/inode.h          \
122         include/wimlib/inode_table.h    \
123         include/wimlib/integrity.h      \
124         include/wimlib/lcpit_matchfinder.h      \
125         include/wimlib/list.h           \
126         include/wimlib/lz_extend.h      \
127         include/wimlib/lz_hash.h        \
128         include/wimlib/lzms_common.h    \
129         include/wimlib/lzms_constants.h \
130         include/wimlib/lzx_common.h     \
131         include/wimlib/lzx_constants.h  \
132         include/wimlib/metadata.h       \
133         include/wimlib/object_id.h      \
134         include/wimlib/pathlist.h       \
135         include/wimlib/paths.h          \
136         include/wimlib/pattern.h        \
137         include/wimlib/progress.h       \
138         include/wimlib/registry.h       \
139         include/wimlib/reparse.h        \
140         include/wimlib/resource.h       \
141         include/wimlib/scan.h           \
142         include/wimlib/security.h       \
143         include/wimlib/security_descriptor.h    \
144         include/wimlib/sha1.h           \
145         include/wimlib/solid.h          \
146         include/wimlib/tagged_items.h   \
147         include/wimlib/textfile.h       \
148         include/wimlib/timestamp.h      \
149         include/wimlib/types.h          \
150         include/wimlib/unaligned.h      \
151         include/wimlib/unix_data.h      \
152         include/wimlib/util.h           \
153         include/wimlib/wim.h            \
154         include/wimlib/write.h          \
155         include/wimlib/x86_cpu_features.h       \
156         include/wimlib/xattr.h          \
157         include/wimlib/xml.h            \
158         include/wimlib/xml_windows.h    \
159         include/wimlib/xpress_constants.h
160
161 if WITH_NTFS_3G
162 libwim_la_SOURCES += src/ntfs-3g_apply.c        \
163                      src/ntfs-3g_capture.c      \
164                      include/wimlib/ntfs_3g.h
165 endif
166
167 if WITH_ZSTD
168 libwim_la_SOURCES += src/zstd_compress.c                \
169                      src/zstd_decompress.c
170 endif
171
172 if WINDOWS_NATIVE_BUILD
173 libwim_la_SOURCES += src/wimboot.c                      \
174                      src/win32_common.c                 \
175                      src/win32_apply.c                  \
176                      src/win32_capture.c                \
177                      src/win32_replacements.c           \
178                      src/win32_vss.c                    \
179                      include/wimlib/wimboot.h           \
180                      include/wimlib/win32.h             \
181                      include/wimlib/win32_common.h      \
182                      include/wimlib/win32_vss.h         \
183                      include/wimlib/wof.h
184 PLATFORM_LIBS = -lmsvcrt -lntdll
185 else
186 libwim_la_SOURCES += src/unix_apply.c           \
187                      src/unix_capture.c
188 PLATFORM_LIBS =
189 endif
190
191 if ENABLE_TEST_SUPPORT
192 libwim_la_SOURCES += src/test_support.c         \
193                      include/wimlib/test_support.h
194 if WINDOWS_NATIVE_BUILD
195 # Workaround for "multiple definition" error when math symbols are present in
196 # both libmsvcrt.a and ntdll.a
197 AM_LDFLAGS += -Wl,--allow-multiple-definition
198 endif
199 endif
200
201 libwim_la_CFLAGS =              \
202         $(AM_CFLAGS)            \
203         $(PTHREAD_CFLAGS)       \
204         $(LIBXML2_CFLAGS)       \
205         $(LIBNTFS_3G_CFLAGS)    \
206         $(LIBFUSE_CFLAGS)       \
207         $(LIBZSTD_CFLAGS)       \
208         $(LIBCRYPTO_CFLAGS)
209
210 libwim_la_LDFLAGS = $(AM_LDFLAGS) -version-info 29:0:14
211
212 libwim_la_LIBADD =              \
213         $(PTHREAD_LIBS)         \
214         $(LIBXML2_LIBS)         \
215         $(LIBNTFS_3G_LIBS)      \
216         $(LIBFUSE_LIBS)         \
217         $(LIBRT_LIBS)           \
218         $(LIBZSTD_LIBS)         \
219         $(LIBCRYPTO_LIBS)       \
220         $(PLATFORM_LIBS)
221
222 if ENABLE_SSSE3_SHA1
223 libwim_la_SOURCES += src/sha1-ssse3.asm
224 libwim_la_LIBADD += src/sha1-ssse3.lo
225
226 src/sha1-ssse3.lo:src/sha1-ssse3.asm
227         $(LIBTOOL) --mode=compile $(srcdir)/build-aux/nasm_lt.sh \
228         $(NASM) $(NAFLAGS) $(NASM_PLATFORM_FLAGS)                           \
229         -DINTEL_SHA1_UPDATE_FUNCNAME=$(NASM_SYMBOL_PREFIX)sha1_transform_blocks_ssse3       \
230         -DINTEL_SHA1_UPDATE_DEFAULT_DISPATCH=$(NASM_SYMBOL_PREFIX)sha1_transform_blocks_default  \
231         $< -o $@
232 endif
233 EXTRA_DIST += build-aux/nasm_lt.sh
234
235 ##############################################################################
236 #                               Programs                                     #
237 ##############################################################################
238
239 bin_PROGRAMS = wimlib-imagex
240 dist_bin_SCRIPTS = programs/mkwinpeimg
241
242 wimlib_imagex_SOURCES =         \
243         programs/imagex.c       \
244         include/wimlib.h        \
245         include/wimlib_tchar.h
246
247 if WINDOWS_NATIVE_BUILD
248 wimlib_imagex_SOURCES +=        \
249         programs/imagex-win32.c \
250         programs/imagex-win32.h \
251         programs/wgetopt.c      \
252         programs/wgetopt.h
253 endif
254
255 wimlib_imagex_CFLAGS = $(AM_CFLAGS) -Wno-deprecated-declarations
256
257 wimlib_imagex_LDADD = $(top_builddir)/libwim.la
258
259 wimlib_imagex_cmds =    \
260         append          \
261         apply           \
262         capture         \
263         delete          \
264         dir             \
265         export          \
266         extract         \
267         info            \
268         join            \
269         mount           \
270         mountrw         \
271         optimize        \
272         split           \
273         unmount         \
274         update          \
275         verify
276
277 ##############################################################################
278 #                                 Hooks                                      #
279 ##############################################################################
280
281 install-exec-hook:
282         for cmd in $(wimlib_imagex_cmds); do                            \
283                 cd $(DESTDIR)$(bindir) &&                               \
284                         ln -f wimlib-imagex wim$${cmd};                 \
285         done
286
287 install-data-hook:
288         for cmd in $(wimlib_imagex_cmds); do                            \
289                 cd $(DESTDIR)$(mandir)/man1 &&                          \
290                         ln -sf wim$${cmd}.1 wimlib-imagex-$${cmd}.1;    \
291         done
292
293 uninstall-hook:
294         for cmd in $(wimlib_imagex_cmds); do                            \
295                 rm -f $(DESTDIR)$(bindir)/wim$${cmd};                   \
296                 rm -f $(DESTDIR)$(mandir)/man1/wim$${cmd}.1;            \
297         done
298
299 ##############################################################################
300 #                               Documentation                                #
301 ##############################################################################
302
303 man1_MANS =                             \
304         doc/man1/wimlib-imagex.1        \
305         doc/man1/wimappend.1            \
306         doc/man1/wimapply.1             \
307         doc/man1/wimcapture.1           \
308         doc/man1/wimdelete.1            \
309         doc/man1/wimdir.1               \
310         doc/man1/wimexport.1            \
311         doc/man1/wimextract.1           \
312         doc/man1/wiminfo.1              \
313         doc/man1/wimjoin.1              \
314         doc/man1/wimmount.1             \
315         doc/man1/wimmountrw.1           \
316         doc/man1/wimoptimize.1          \
317         doc/man1/wimsplit.1             \
318         doc/man1/wimunmount.1           \
319         doc/man1/wimupdate.1            \
320         doc/man1/wimverify.1            \
321         doc/man1/mkwinpeimg.1
322
323 EXTRA_DIST += $(man1_MANS)
324
325 ##############################################################################
326 #                                 Tests                                      #
327 ##############################################################################
328
329 check_PROGRAMS = tests/tree-cmp
330 tests_tree_cmp_SOURCES = tests/tree-cmp.c
331
332 dist_check_SCRIPTS = tests/test-imagex \
333                      tests/test-imagex-capture_and_apply \
334                      tests/test-imagex-update_and_extract
335
336 if WITH_FUSE
337 dist_check_SCRIPTS += tests/test-imagex-mount
338 endif
339
340 if WITH_NTFS_3G
341 dist_check_SCRIPTS += tests/test-imagex-ntfs
342 endif
343
344 EXTRA_DIST +=                                   \
345         tests/common_tests.sh                   \
346         tests/test_utils.sh                     \
347         tests/security_descriptor_1.base64      \
348         tests/security_descriptor_1.bin         \
349         tests/security_descriptor_2.base64      \
350         tests/security_descriptor_2.bin
351
352 if WINDOWS_NATIVE_BUILD
353 # Tests are run manually for Windows builds.
354 TESTS =
355 else
356 TESTS = $(dist_check_SCRIPTS)
357 endif
358
359 # Extra test programs (not run by 'make check')
360 EXTRA_PROGRAMS = tests/wlfuzz
361 tests_wlfuzz_SOURCES = tests/wlfuzz.c
362 tests_wlfuzz_LDADD = $(top_builddir)/libwim.la
363
364 ##############################################################################