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