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