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