]> wimlib.net Git - wimlib/blob - Makefile.am
SHA-1 rework
[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
24 ##############################################################################
25 #                               Library                                      #
26 ##############################################################################
27
28 lib_LTLIBRARIES = libwim.la
29 include_HEADERS = include/wimlib.h
30
31 pkgconfigdir    = @pkgconfigdir@
32 pkgconfig_DATA  = wimlib.pc
33 wimlib.pc: config.status
34
35 libwim_la_SOURCES =             \
36         src/add_image.c         \
37         src/avl_tree.c          \
38         src/blob_table.c        \
39         src/compress.c          \
40         src/compress_common.c   \
41         src/compress_parallel.c \
42         src/compress_serial.c   \
43         src/cpu_features.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/xml.c               \
93         src/xml_windows.c       \
94         src/xpress_compress.c   \
95         src/xpress_decompress.c \
96         include/wimlib/alloca.h         \
97         include/wimlib/apply.h          \
98         include/wimlib/assert.h         \
99         include/wimlib/avl_tree.h       \
100         include/wimlib/bitops.h         \
101         include/wimlib/blob_table.h     \
102         include/wimlib/bt_matchfinder.h \
103         include/wimlib/case.h           \
104         include/wimlib/compiler.h       \
105         include/wimlib/compressor_ops.h \
106         include/wimlib/compress_common.h        \
107         include/wimlib/chunk_compressor.h       \
108         include/wimlib/cpu_features.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/lzms_common.h    \
127         include/wimlib/lzms_constants.h \
128         include/wimlib/lzx_common.h     \
129         include/wimlib/lzx_constants.h  \
130         include/wimlib/matchfinder_common.h     \
131         include/wimlib/metadata.h       \
132         include/wimlib/object_id.h      \
133         include/wimlib/pathlist.h       \
134         include/wimlib/paths.h          \
135         include/wimlib/pattern.h        \
136         include/wimlib/progress.h       \
137         include/wimlib/registry.h       \
138         include/wimlib/reparse.h        \
139         include/wimlib/resource.h       \
140         include/wimlib/scan.h           \
141         include/wimlib/security.h       \
142         include/wimlib/security_descriptor.h    \
143         include/wimlib/sha1.h           \
144         include/wimlib/solid.h          \
145         include/wimlib/tagged_items.h   \
146         include/wimlib/textfile.h       \
147         include/wimlib/timestamp.h      \
148         include/wimlib/types.h          \
149         include/wimlib/unaligned.h      \
150         include/wimlib/unix_data.h      \
151         include/wimlib/util.h           \
152         include/wimlib/wim.h            \
153         include/wimlib/write.h          \
154         include/wimlib/xattr.h          \
155         include/wimlib/xml.h            \
156         include/wimlib/xml_windows.h    \
157         include/wimlib/xpress_constants.h
158
159 if WITH_NTFS_3G
160 libwim_la_SOURCES += src/ntfs-3g_apply.c        \
161                      src/ntfs-3g_capture.c      \
162                      include/wimlib/ntfs_3g.h
163 endif
164
165 if WINDOWS_NATIVE_BUILD
166 libwim_la_SOURCES += src/wimboot.c                      \
167                      src/win32_common.c                 \
168                      src/win32_apply.c                  \
169                      src/win32_capture.c                \
170                      src/win32_replacements.c           \
171                      src/win32_vss.c                    \
172                      include/wimlib/wimboot.h           \
173                      include/wimlib/win32.h             \
174                      include/wimlib/win32_common.h      \
175                      include/wimlib/win32_vss.h         \
176                      include/wimlib/wof.h
177 PLATFORM_LIBS = -lntdll
178 else
179 libwim_la_SOURCES += src/unix_apply.c           \
180                      src/unix_capture.c
181 PLATFORM_LIBS =
182 endif
183
184 if ENABLE_TEST_SUPPORT
185 libwim_la_SOURCES += src/test_support.c         \
186                      include/wimlib/test_support.h
187 endif
188
189 libwim_la_CFLAGS =              \
190         $(AM_CFLAGS)            \
191         $(PTHREAD_CFLAGS)       \
192         $(LIBXML2_CFLAGS)       \
193         $(LIBNTFS_3G_CFLAGS)    \
194         $(LIBFUSE_CFLAGS)
195
196 libwim_la_LDFLAGS = $(AM_LDFLAGS) -version-info 36:0:21
197
198 libwim_la_LIBADD =              \
199         $(PTHREAD_LIBS)         \
200         $(LIBXML2_LIBS)         \
201         $(LIBNTFS_3G_LIBS)      \
202         $(LIBFUSE_LIBS)         \
203         $(LIBRT_LIBS)           \
204         $(PLATFORM_LIBS)
205
206 ##############################################################################
207 #                               Programs                                     #
208 ##############################################################################
209
210 bin_PROGRAMS = wimlib-imagex
211 dist_bin_SCRIPTS = programs/mkwinpeimg
212
213 wimlib_imagex_SOURCES =         \
214         programs/imagex.c       \
215         include/wimlib.h        \
216         include/wimlib_tchar.h
217
218 if WINDOWS_NATIVE_BUILD
219 wimlib_imagex_SOURCES +=        \
220         programs/imagex-win32.c \
221         programs/imagex-win32.h \
222         programs/wgetopt.c      \
223         programs/wgetopt.h
224 endif
225
226 wimlib_imagex_CFLAGS = $(AM_CFLAGS) -Wno-deprecated-declarations
227
228 wimlib_imagex_LDADD = $(top_builddir)/libwim.la
229
230 wimlib_imagex_cmds =    \
231         append          \
232         apply           \
233         capture         \
234         delete          \
235         dir             \
236         export          \
237         extract         \
238         info            \
239         join            \
240         mount           \
241         mountrw         \
242         optimize        \
243         split           \
244         unmount         \
245         update          \
246         verify
247
248 ##############################################################################
249 #                                 Hooks                                      #
250 ##############################################################################
251
252 install-exec-hook:
253         for cmd in $(wimlib_imagex_cmds); do                            \
254                 cd $(DESTDIR)$(bindir) &&                               \
255                         ln -f wimlib-imagex wim$${cmd};                 \
256         done
257
258 install-data-hook:
259         for cmd in $(wimlib_imagex_cmds); do                            \
260                 cd $(DESTDIR)$(mandir)/man1 &&                          \
261                         ln -sf wim$${cmd}.1 wimlib-imagex-$${cmd}.1;    \
262         done
263
264 uninstall-hook:
265         for cmd in $(wimlib_imagex_cmds); do                            \
266                 rm -f $(DESTDIR)$(bindir)/wim$${cmd};                   \
267                 rm -f $(DESTDIR)$(mandir)/man1/wim$${cmd}.1;            \
268         done
269
270 ##############################################################################
271 #                               Documentation                                #
272 ##############################################################################
273
274 man1_MANS =                             \
275         doc/man1/wimlib-imagex.1        \
276         doc/man1/wimappend.1            \
277         doc/man1/wimapply.1             \
278         doc/man1/wimcapture.1           \
279         doc/man1/wimdelete.1            \
280         doc/man1/wimdir.1               \
281         doc/man1/wimexport.1            \
282         doc/man1/wimextract.1           \
283         doc/man1/wiminfo.1              \
284         doc/man1/wimjoin.1              \
285         doc/man1/wimmount.1             \
286         doc/man1/wimmountrw.1           \
287         doc/man1/wimoptimize.1          \
288         doc/man1/wimsplit.1             \
289         doc/man1/wimunmount.1           \
290         doc/man1/wimupdate.1            \
291         doc/man1/wimverify.1            \
292         doc/man1/mkwinpeimg.1
293
294 EXTRA_DIST += $(man1_MANS)
295
296 ##############################################################################
297 #                                 Tests                                      #
298 ##############################################################################
299
300 check_PROGRAMS = tests/tree-cmp
301 tests_tree_cmp_SOURCES = tests/tree-cmp.c
302
303 dist_check_SCRIPTS = tests/test-imagex \
304                      tests/test-imagex-capture_and_apply \
305                      tests/test-imagex-update_and_extract
306
307 if WITH_FUSE
308 dist_check_SCRIPTS += tests/test-imagex-mount
309 endif
310
311 if WITH_NTFS_3G
312 dist_check_SCRIPTS += tests/test-imagex-ntfs
313 endif
314
315 EXTRA_DIST +=                                   \
316         tests/common_tests.sh                   \
317         tests/exclusionlists                    \
318         tests/test_utils.sh                     \
319         tests/security_descriptor_1.base64      \
320         tests/security_descriptor_1.bin         \
321         tests/security_descriptor_2.base64      \
322         tests/security_descriptor_2.bin         \
323         tests/wims
324
325 if WINDOWS_NATIVE_BUILD
326 # Tests are run manually for Windows builds.
327 TESTS =
328 else
329 TESTS = $(dist_check_SCRIPTS)
330 endif
331
332 # Extra test programs (not run by 'make check')
333 EXTRA_PROGRAMS = tests/wlfuzz
334 tests_wlfuzz_SOURCES = tests/wlfuzz.c
335 tests_wlfuzz_LDADD = $(top_builddir)/libwim.la
336
337 ##############################################################################