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