]> wimlib.net Git - wimlib/blob - Makefile.am
78154fdc4cfc9cd017269698bc12e93205c9ea1a
[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          \
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/capture_common.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/lookup_table.c      \
62         src/lz_binary_trees.c   \
63         src/lz_hash_chains.c    \
64         src/lz_lcp_interval_tree.c      \
65         src/lz_linked_suffix_array.c    \
66         src/lz_mf.c             \
67         src/lz_null.c           \
68         src/lz_repsearch.c      \
69         src/lz_suffix_array_utils.c     \
70         src/lzms_common.c       \
71         src/lzms_compress.c     \
72         src/lzms_decompress.c   \
73         src/lzx_common.c        \
74         src/lzx_compress.c      \
75         src/lzx_decompress.c    \
76         src/metadata_resource.c \
77         src/mount_image.c       \
78         src/pathlist.c          \
79         src/paths.c             \
80         src/progress.c          \
81         src/resource.c          \
82         src/reference.c         \
83         src/security.c          \
84         src/sha1.c              \
85         src/split.c             \
86         src/reparse.c           \
87         src/tagged_items.c      \
88         src/template.c          \
89         src/textfile.c          \
90         src/timestamp.c         \
91         src/update_image.c      \
92         src/util.c              \
93         src/verify.c            \
94         src/wildcard.c          \
95         src/wim.c               \
96         src/write.c             \
97         src/xml.c               \
98         src/xpress_compress.c   \
99         src/xpress_decompress.c \
100         include/wimlib/apply.h          \
101         include/wimlib/assert.h         \
102         include/wimlib/avl_tree.h       \
103         include/wimlib/bitops.h         \
104         include/wimlib/bt_matchfinder.h \
105         include/wimlib/callback.h       \
106         include/wimlib/capture.h        \
107         include/wimlib/case.h           \
108         include/wimlib/compiler.h       \
109         include/wimlib/compiler-gcc.h   \
110         include/wimlib/compressor_ops.h \
111         include/wimlib/compress_common.h        \
112         include/wimlib/chunk_compressor.h       \
113         include/wimlib/decompressor_ops.h       \
114         include/wimlib/decompress_common.h      \
115         include/wimlib/dentry.h         \
116         include/wimlib/divsufsort.h     \
117         include/wimlib/encoding.h       \
118         include/wimlib/endianness.h     \
119         include/wimlib/error.h          \
120         include/wimlib/file_io.h        \
121         include/wimlib/glob.h           \
122         include/wimlib/hc_matchfinder.h \
123         include/wimlib/header.h         \
124         include/wimlib/inode.h          \
125         include/wimlib/inode_table.h    \
126         include/wimlib/integrity.h      \
127         include/wimlib/list.h           \
128         include/wimlib/lookup_table.h   \
129         include/wimlib/lz_extend.h      \
130         include/wimlib/lz_hash3.h       \
131         include/wimlib/lz_mf.h          \
132         include/wimlib/lz_mf_ops.h      \
133         include/wimlib/lz_repsearch.h   \
134         include/wimlib/lz_suffix_array_utils.h  \
135         include/wimlib/lzms_common.h    \
136         include/wimlib/lzms_constants.h \
137         include/wimlib/lzx_common.h     \
138         include/wimlib/lzx_constants.h  \
139         include/wimlib/matchfinder_avx2.h       \
140         include/wimlib/matchfinder_common.h     \
141         include/wimlib/matchfinder_nonsliding.h \
142         include/wimlib/matchfinder_sliding.h    \
143         include/wimlib/matchfinder_sse2.h       \
144         include/wimlib/metadata.h       \
145         include/wimlib/pathlist.h       \
146         include/wimlib/paths.h          \
147         include/wimlib/progress.h       \
148         include/wimlib/reparse.h        \
149         include/wimlib/resource.h       \
150         include/wimlib/security.h       \
151         include/wimlib/security_descriptor.h    \
152         include/wimlib/sha1.h           \
153         include/wimlib/textfile.h       \
154         include/wimlib/timestamp.h      \
155         include/wimlib/types.h          \
156         include/wimlib/unaligned.h      \
157         include/wimlib/unix_data.h      \
158         include/wimlib/util.h           \
159         include/wimlib/wildcard.h       \
160         include/wimlib/wim.h            \
161         include/wimlib/write.h          \
162         include/wimlib/xml.h            \
163         include/wimlib/xpress_constants.h
164
165 if WITH_NTFS_3G
166 libwim_la_SOURCES += src/ntfs-3g_apply.c        \
167                      src/ntfs-3g_capture.c      \
168                      include/wimlib/ntfs_3g.h
169 endif
170
171 if WINDOWS_NATIVE_BUILD
172 libwim_la_SOURCES += src/win32_common.c                 \
173                      src/win32_apply.c                  \
174                      src/win32_capture.c                \
175                      src/win32_replacements.c           \
176                      src/wimboot.c                      \
177                      include/wimlib/win32_common.h      \
178                      include/wimlib/win32.h             \
179                      include/wimlib/wimboot.h           \
180                      include/wimlib/wof.h
181 else
182 libwim_la_SOURCES += src/unix_apply.c           \
183                      src/unix_capture.c
184 endif
185
186 libwim_la_CFLAGS =              \
187         $(AM_CFLAGS)            \
188         $(PTHREAD_CFLAGS)       \
189         $(LIBXML2_CFLAGS)       \
190         $(LIBNTFS_3G_CFLAGS)    \
191         $(LIBFUSE_CFLAGS)       \
192         $(LIBCRYPTO_CFLAGS)
193
194 libwim_la_LDFLAGS = $(AM_LDFLAGS) -version-info 19:0:4
195
196 libwim_la_LIBADD =              \
197         $(PTHREAD_LIBS)         \
198         $(LIBXML2_LIBS)         \
199         $(LTLIBICONV)           \
200         $(LIBNTFS_3G_LIBS)      \
201         $(LIBFUSE_LIBS)         \
202         $(LIBRT_LIBS)           \
203         $(LIBCRYPTO_LIBS)
204
205 if ENABLE_SSSE3_SHA1
206 libwim_la_SOURCES += src/sha1-ssse3.asm
207 libwim_la_LIBADD += src/sha1-ssse3.lo
208
209 src/sha1-ssse3.lo:src/sha1-ssse3.asm
210         $(LIBTOOL) --mode=compile --tag NASM $(srcdir)/build-aux/nasm_lt.sh \
211         $(NASM) $(NAFLAGS) $(NASM_PLATFORM_FLAGS)                           \
212         -DINTEL_SHA1_UPDATE_FUNCNAME=$(NASM_SYMBOL_PREFIX)sha1_transform_blocks_ssse3       \
213         -DINTEL_SHA1_UPDATE_DEFAULT_DISPATCH=$(NASM_SYMBOL_PREFIX)sha1_transform_blocks_default  \
214         $< -o $@
215
216 EXTRA_DIST += build-aux/nasm_lt.sh
217 endif
218
219 ##############################################################################
220 #                               Programs                                     #
221 ##############################################################################
222
223 bin_PROGRAMS = wimlib-imagex
224 dist_bin_SCRIPTS = programs/mkwinpeimg
225
226 wimlib_imagex_SOURCES =         \
227         programs/imagex.c       \
228         include/wimlib.h        \
229         include/wimlib_tchar.h
230
231 if WINDOWS_NATIVE_BUILD
232 wimlib_imagex_SOURCES +=        \
233         programs/imagex-win32.c \
234         programs/imagex-win32.h \
235         programs/wgetopt.c      \
236         programs/wgetopt.h
237 endif
238
239 wimlib_imagex_CFLAGS = $(AM_CFLAGS) -Wno-deprecated-declarations
240
241 wimlib_imagex_LDADD = $(top_builddir)/libwim.la
242
243 wimlib_imagex_cmds =    \
244         append          \
245         apply           \
246         capture         \
247         delete          \
248         dir             \
249         export          \
250         extract         \
251         info            \
252         join            \
253         mount           \
254         mountrw         \
255         optimize        \
256         split           \
257         unmount         \
258         update          \
259         verify
260
261 ##############################################################################
262 #                                 Hooks                                      #
263 ##############################################################################
264
265 install-exec-hook:
266         for cmd in $(wimlib_imagex_cmds); do                            \
267                 cd $(DESTDIR)$(bindir) &&                               \
268                         ln -f wimlib-imagex wim$${cmd};                 \
269         done
270
271 install-data-hook:
272         for cmd in $(wimlib_imagex_cmds); do                            \
273                 cd $(DESTDIR)$(mandir)/man1 &&                          \
274                         ln -sf wimlib-imagex-$${cmd}.1 wim$${cmd}.1;    \
275         done
276
277 uninstall-hook:
278         for cmd in $(wimlib_imagex_cmds); do                            \
279                 rm -f $(DESTDIR)$(bindir)/wim$${cmd};                   \
280                 rm -f $(DESTDIR)$(mandir)/man1/wim$${cmd}.1;            \
281         done
282
283 ##############################################################################
284 #                               Documentation                                #
285 ##############################################################################
286
287 man1_MANS =                                     \
288         doc/man1/wimlib-imagex.1                \
289         doc/man1/wimlib-imagex-append.1         \
290         doc/man1/wimlib-imagex-apply.1          \
291         doc/man1/wimlib-imagex-capture.1        \
292         doc/man1/wimlib-imagex-delete.1         \
293         doc/man1/wimlib-imagex-dir.1            \
294         doc/man1/wimlib-imagex-export.1         \
295         doc/man1/wimlib-imagex-extract.1        \
296         doc/man1/wimlib-imagex-info.1           \
297         doc/man1/wimlib-imagex-join.1           \
298         doc/man1/wimlib-imagex-mount.1          \
299         doc/man1/wimlib-imagex-mountrw.1        \
300         doc/man1/wimlib-imagex-optimize.1       \
301         doc/man1/wimlib-imagex-split.1          \
302         doc/man1/wimlib-imagex-unmount.1        \
303         doc/man1/wimlib-imagex-update.1         \
304         doc/man1/wimlib-imagex-verify.1         \
305         doc/man1/mkwinpeimg.1
306
307 EXTRA_DIST += $(man1_MANS)
308
309 ##############################################################################
310 #                                 Tests                                      #
311 ##############################################################################
312
313 check_PROGRAMS = tests/tree-cmp
314 tests_tree_cmp_SOURCES = tests/tree-cmp.c
315
316 dist_check_SCRIPTS = tests/test-imagex \
317                      tests/test-imagex-capture_and_apply \
318                      tests/test-imagex-update_and_extract
319
320 if WITH_FUSE
321 dist_check_SCRIPTS += tests/test-imagex-mount
322 endif
323
324 if WITH_NTFS_3G
325 dist_check_SCRIPTS += tests/test-imagex-ntfs
326 endif
327
328 EXTRA_DIST +=                                   \
329         tests/common_tests.sh                   \
330         tests/tests-common.sh                   \
331         tests/security_descriptor_1.base64      \
332         tests/security_descriptor_1.bin         \
333         tests/security_descriptor_2.base64      \
334         tests/security_descriptor_2.bin
335
336 if WINDOWS_NATIVE_BUILD
337 # Tests are run manually for Windows builds.
338 TESTS =
339 else
340 TESTS = $(dist_check_SCRIPTS)
341 endif
342
343 ##############################################################################