Rewrite of write_stream_list(), and writing packed resources
[wimlib] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4
2
3 AM_CPPFLAGS     = -I$(top_srcdir)/include $(WINDOWS_CPPFLAGS) \
4                   -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
5
6 AM_CFLAGS       = -std=gnu99 -Wmissing-prototypes -Wstrict-prototypes   \
7                   -Werror-implicit-function-declaration                 \
8                   -fno-common -Wundef -Wno-pointer-sign
9
10 if WINDOWS_NATIVE_BUILD
11 # This option is needed to make packed structures work as expected
12 # with gcc 4.7+ (mingw) on Windows.
13 AM_CFLAGS += -mno-ms-bitfields
14 endif
15
16 lib_LTLIBRARIES = libwim.la
17
18 libwim_la_LDFLAGS = -version-info 11:0:2 $(WINDOWS_LDFLAGS)
19
20 libwim_la_SOURCES =             \
21         src/add_image.c         \
22         src/capture_common.c    \
23         src/compress.c          \
24         src/compress_chunk.c    \
25         src/compress_parallel.c \
26         src/compress_serial.c   \
27         src/decompress.c        \
28         src/delete_image.c      \
29         src/dentry.c            \
30         src/encoding.c          \
31         src/export_image.c      \
32         src/extract.c           \
33         src/file_io.c           \
34         src/hardlink.c          \
35         src/header.c            \
36         src/integrity.c         \
37         src/join.c              \
38         src/lookup_table.c      \
39         src/lzms-decompress.c   \
40         src/lz77.c              \
41         src/divsufsort/divsufsort.c             \
42         src/divsufsort/divsufsort.h             \
43         src/divsufsort/divsufsort_private.h     \
44         src/divsufsort/sssort.c \
45         src/divsufsort/trsort.c \
46         src/lzx-common.c        \
47         src/lzx-compress.c      \
48         src/lzx-decompress.c    \
49         src/metadata_resource.c \
50         src/mount_image.c       \
51         src/paths.c             \
52         src/resource.c          \
53         src/rbtree.c            \
54         src/security.c          \
55         src/sha1.c              \
56         src/split.c             \
57         src/reparse.c           \
58         src/timestamp.c         \
59         src/update_image.c      \
60         src/util.c              \
61         src/verify.c            \
62         src/wim.c               \
63         src/write.c             \
64         src/xml.c               \
65         src/xpress-compress.c   \
66         src/xpress-decompress.c \
67         include/wimlib/apply.h          \
68         include/wimlib/assert.h         \
69         include/wimlib/callback.h       \
70         include/wimlib/capture.h        \
71         include/wimlib/compiler.h       \
72         include/wimlib/compress.h       \
73         include/wimlib/compress_chunks.h \
74         include/wimlib/decompress.h     \
75         include/wimlib/dentry.h         \
76         include/wimlib/encoding.h       \
77         include/wimlib/endianness.h     \
78         include/wimlib/error.h          \
79         include/wimlib/file_io.h        \
80         include/wimlib/glob.h           \
81         include/wimlib/header.h         \
82         include/wimlib/integrity.h      \
83         include/wimlib/list.h           \
84         include/wimlib/lookup_table.h   \
85         include/wimlib/lzms.h           \
86         include/wimlib/lzx.h            \
87         include/wimlib/metadata.h       \
88         include/wimlib/paths.h          \
89         include/wimlib/rbtree.h         \
90         include/wimlib/reparse.h        \
91         include/wimlib/resource.h       \
92         include/wimlib/security.h       \
93         include/wimlib/security_descriptor.h    \
94         include/wimlib/sha1.h           \
95         include/wimlib/timestamp.h      \
96         include/wimlib/types.h          \
97         include/wimlib/util.h           \
98         include/wimlib/version.h        \
99         include/wimlib/wim.h            \
100         include/wimlib/write.h          \
101         include/wimlib/xml.h            \
102         include/wimlib/xpress.h
103
104 if WITH_NTFS_3G
105 libwim_la_SOURCES += src/ntfs-3g_apply.c        \
106                      src/ntfs-3g_capture.c      \
107                      include/wimlib/ntfs_3g.h
108 endif
109
110 if WINDOWS_NATIVE_BUILD
111 libwim_la_SOURCES += src/win32_common.c                 \
112                      src/win32_apply.c                  \
113                      src/win32_capture.c                \
114                      src/win32_replacements.c           \
115                      include/wimlib/win32_common.h      \
116                      include/wimlib/win32.h
117 else
118 libwim_la_SOURCES += src/unix_apply.c           \
119                      src/unix_capture.c
120 endif
121
122
123
124 EXTRA_libwim_la_SOURCES = src/sha1-ssse3.asm
125 libwim_la_DEPENDENCIES = $(SSSE3_SHA1_OBJ)
126 STRIP_FPIC = sh $(top_srcdir)/build-aux/strip_fPIC.sh
127
128 sha1-ssse3.lo:src/sha1-ssse3.asm
129         $(LIBTOOL) --mode=compile --tag=CC $(STRIP_FPIC) $(NASM) -f elf64 \
130         -DINTEL_SHA1_UPDATE_DEFAULT_DISPATCH=ssse3_not_found \
131         $<
132
133 libwim_la_LIBADD =              \
134         $(LIBXML2_LIBS)         \
135         $(LIBFUSE_LIBS)         \
136         $(LIBRT_LIBS)           \
137         $(LIBNTFS_3G_LIBS)      \
138         $(LTLIBICONV)           \
139         $(LIBCRYPTO_LIBS)       \
140         $(SSSE3_SHA1_OBJ)       \
141         $(PTHREAD_LDADD)        \
142         $(WINDOWS_LDADD)
143
144 libwim_la_CFLAGS =              \
145         $(AM_CFLAGS)            \
146         $(VISIBILITY_CFLAGS)    \
147         $(LIBXML2_CFLAGS)       \
148         $(LIBFUSE_CFLAGS)       \
149         $(LIBNTFS_3G_CFLAGS)    \
150         $(LIBCRYPTO_CFLAGS)
151
152
153 bin_PROGRAMS     = imagex
154 imagex_SOURCES   = programs/imagex.c    \
155                    include/wimlib.h     \
156                    include/wimlib_tchar.h
157 imagex_LDADD     = $(top_builddir)/libwim.la
158 imagex_CFLAGS    = $(AM_CFLAGS) $(WINDOWS_CFLAGS) -Wno-deprecated-declarations
159
160 if WINDOWS_NATIVE_BUILD
161 imagex_SOURCES += programs/imagex-win32.c       \
162                   programs/imagex-win32.h       \
163                   programs/wgetopt.c            \
164                   programs/wgetopt.h
165 endif
166
167 imagex_cmds =   append  \
168                 apply   \
169                 capture \
170                 delete  \
171                 dir     \
172                 export  \
173                 extract \
174                 info    \
175                 join    \
176                 mount   \
177                 mountrw \
178                 optimize\
179                 split   \
180                 unmount \
181                 update
182
183 install-exec-hook:
184         if [ "@IMAGEX_PROGNAME@" != imagex ]; then                          \
185                 cd $(DESTDIR)$(bindir) && mv -f imagex "@IMAGEX_PROGNAME@"; \
186         fi
187         for cmd in $(imagex_cmds); do                           \
188                 cd $(DESTDIR)$(bindir) &&                       \
189                         ln -f "@IMAGEX_PROGNAME@" wim$${cmd};   \
190         done
191
192 install-data-hook:
193         for cmd in $(imagex_cmds); do                                       \
194                 cd $(DESTDIR)$(mandir)/man1 &&                              \
195                         ln -sf "@IMAGEX_PROGNAME@-$${cmd}.1" wim$${cmd}.1;  \
196         done
197
198 uninstall-hook:
199         if [ "@IMAGEX_PROGNAME@" != imagex ]; then              \
200                 rm -f $(DESTDIR)$(bindir)/"@IMAGEX_PROGNAME@";  \
201                 rm -f $(DESTDIR)$(bindir)/imagex;               \
202         fi
203         for cmd in $(imagex_cmds); do                           \
204                 rm -f $(DESTDIR)$(bindir)/wim$${cmd};           \
205         done
206         for cmd in $(imagex_cmds); do                           \
207                 rm -f $(DESTDIR)$(mandir)/man1/wim$${cmd}.1;    \
208         done
209
210
211 dist_bin_SCRIPTS = programs/mkwinpeimg
212
213 include_HEADERS = include/wimlib.h
214
215 EXTRA_DIST =                                    \
216         build-aux/strip_fPIC.sh                 \
217         archlinux                               \
218         debian                                  \
219         rpm                                     \
220         examples                                \
221         README.WINDOWS                          \
222         tests/common_tests.sh                   \
223         tests/tests-common.sh                   \
224         tests/security_descriptor_1.base64      \
225         tests/security_descriptor_1.bin         \
226         tests/security_descriptor_2.base64      \
227         tests/security_descriptor_2.bin
228
229 pkgconfigdir    = @pkgconfigdir@
230 pkgconfig_DATA  = wimlib.pc
231
232 $(pkgconfig_DATA): config.status
233
234 wimlib_manpages =                               \
235         doc/@IMAGEX_PROGNAME@.1                 \
236         doc/@IMAGEX_PROGNAME@-append.1          \
237         doc/@IMAGEX_PROGNAME@-apply.1           \
238         doc/@IMAGEX_PROGNAME@-capture.1         \
239         doc/@IMAGEX_PROGNAME@-delete.1          \
240         doc/@IMAGEX_PROGNAME@-dir.1             \
241         doc/@IMAGEX_PROGNAME@-export.1          \
242         doc/@IMAGEX_PROGNAME@-extract.1         \
243         doc/@IMAGEX_PROGNAME@-info.1            \
244         doc/@IMAGEX_PROGNAME@-join.1            \
245         doc/@IMAGEX_PROGNAME@-mount.1           \
246         doc/@IMAGEX_PROGNAME@-mountrw.1         \
247         doc/@IMAGEX_PROGNAME@-optimize.1        \
248         doc/@IMAGEX_PROGNAME@-split.1           \
249         doc/@IMAGEX_PROGNAME@-unmount.1         \
250         doc/@IMAGEX_PROGNAME@-update.1          \
251         doc/mkwinpeimg.1
252
253 man1_MANS = $(wimlib_manpages)
254 DISTCLEANFILES = $(wimlib_manpages)
255
256 $(man1_MANS): config.status
257
258 check_PROGRAMS = tests/tree-cmp
259 tests_tree_cmp_SOURCES = tests/tree-cmp.c
260
261 dist_check_SCRIPTS = tests/test-imagex \
262                      tests/test-imagex-capture_and_apply \
263                      tests/test-imagex-update_and_extract
264
265 if WITH_FUSE
266 dist_check_SCRIPTS += tests/test-imagex-mount
267 endif
268
269 if WITH_NTFS_3G
270 dist_check_SCRIPTS += tests/test-imagex-ntfs
271 endif
272
273 if WINDOWS_NATIVE_BUILD
274 # Tests are run manually for Windows builds.
275 TESTS =
276 else
277 TESTS = $(dist_check_SCRIPTS)
278 endif
279