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