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