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