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