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