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