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