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