]> wimlib.net Git - wimlib/blob - Makefile.am
Fix clang warnings about inconsistent use of dllexport
[wimlib] / Makefile.am
1 ##############################################################################
2 #                               General                                      #
3 ##############################################################################
4
5
6 ACLOCAL_AMFLAGS = -I m4
7
8 AM_CPPFLAGS     = -I$(top_srcdir)/include $(PLATFORM_CPPFLAGS)  \
9                   -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
10
11 # Note: -std=gnu99 instead of -std=c99 is needed for unnamed structs and unions,
12 # which are in C11 but not C99.  But we can't yet actually use -std=c11 because
13 # we want to support older versions of gcc.
14 AM_CFLAGS       = -std=gnu99 $(PLATFORM_CFLAGS) -fno-common     \
15                   -Wmissing-prototypes -Wstrict-prototypes      \
16                   -Wundef -Wno-pointer-sign
17
18 AM_LDFLAGS      = $(PLATFORM_LDFLAGS)
19
20 EXTRA_DIST      = README README.WINDOWS                         \
21                   COPYING COPYING.GPLv3 COPYING.LGPLv3          \
22                   examples tools/get-version-number
23
24 ##############################################################################
25 #                               Library                                      #
26 ##############################################################################
27
28 lib_LTLIBRARIES = libwim.la
29 include_HEADERS = include/wimlib.h
30
31 pkgconfigdir    = @pkgconfigdir@
32 pkgconfig_DATA  = wimlib.pc
33 wimlib.pc: config.status
34
35 libwim_la_SOURCES =             \
36         src/add_image.c         \
37         src/avl_tree.c          \
38         src/blob_table.c        \
39         src/compress.c          \
40         src/compress_common.c   \
41         src/compress_parallel.c \
42         src/compress_serial.c   \
43         src/cpu_features.c      \
44         src/decompress.c        \
45         src/decompress_common.c \
46         src/delete_image.c      \
47         src/dentry.c            \
48         src/divsufsort.c        \
49         src/encoding.c          \
50         src/error.c             \
51         src/export_image.c      \
52         src/extract.c           \
53         src/file_io.c           \
54         src/header.c            \
55         src/inode.c             \
56         src/inode_fixup.c       \
57         src/inode_table.c       \
58         src/integrity.c         \
59         src/iterate_dir.c       \
60         src/join.c              \
61         src/lcpit_matchfinder.c \
62         src/lzms_common.c       \
63         src/lzms_compress.c     \
64         src/lzms_decompress.c   \
65         src/lzx_common.c        \
66         src/lzx_compress.c      \
67         src/lzx_decompress.c    \
68         src/metadata_resource.c \
69         src/mount_image.c       \
70         src/pathlist.c          \
71         src/paths.c             \
72         src/pattern.c           \
73         src/progress.c          \
74         src/reference.c         \
75         src/registry.c          \
76         src/reparse.c           \
77         src/resource.c          \
78         src/scan.c              \
79         src/security.c          \
80         src/sha1.c              \
81         src/solid.c             \
82         src/split.c             \
83         src/tagged_items.c      \
84         src/template.c          \
85         src/textfile.c          \
86         src/threads.c           \
87         src/timestamp.c         \
88         src/update_image.c      \
89         src/util.c              \
90         src/verify.c            \
91         src/wim.c               \
92         src/write.c             \
93         src/xml.c               \
94         src/xml_windows.c       \
95         src/xmlproc.c           \
96         src/xpress_compress.c   \
97         src/xpress_decompress.c \
98         include/wimlib/alloca.h         \
99         include/wimlib/apply.h          \
100         include/wimlib/assert.h         \
101         include/wimlib/avl_tree.h       \
102         include/wimlib/bitops.h         \
103         include/wimlib/blob_table.h     \
104         include/wimlib/bt_matchfinder.h \
105         include/wimlib/case.h           \
106         include/wimlib/compiler.h       \
107         include/wimlib/compressor_ops.h \
108         include/wimlib/compress_common.h        \
109         include/wimlib/chunk_compressor.h       \
110         include/wimlib/cpu_features.h   \
111         include/wimlib/decompressor_ops.h       \
112         include/wimlib/decompress_common.h      \
113         include/wimlib/dentry.h         \
114         include/wimlib/divsufsort.h     \
115         include/wimlib/encoding.h       \
116         include/wimlib/endianness.h     \
117         include/wimlib/error.h          \
118         include/wimlib/file_io.h        \
119         include/wimlib/glob.h           \
120         include/wimlib/guid.h           \
121         include/wimlib/hc_matchfinder.h \
122         include/wimlib/header.h         \
123         include/wimlib/inode.h          \
124         include/wimlib/inode_table.h    \
125         include/wimlib/integrity.h      \
126         include/wimlib/lcpit_matchfinder.h      \
127         include/wimlib/list.h           \
128         include/wimlib/lzms_common.h    \
129         include/wimlib/lzms_constants.h \
130         include/wimlib/lzx_common.h     \
131         include/wimlib/lzx_constants.h  \
132         include/wimlib/matchfinder_common.h     \
133         include/wimlib/metadata.h       \
134         include/wimlib/object_id.h      \
135         include/wimlib/pathlist.h       \
136         include/wimlib/paths.h          \
137         include/wimlib/pattern.h        \
138         include/wimlib/progress.h       \
139         include/wimlib/registry.h       \
140         include/wimlib/reparse.h        \
141         include/wimlib/resource.h       \
142         include/wimlib/scan.h           \
143         include/wimlib/security.h       \
144         include/wimlib/security_descriptor.h    \
145         include/wimlib/sha1.h           \
146         include/wimlib/solid.h          \
147         include/wimlib/tagged_items.h   \
148         include/wimlib/textfile.h       \
149         include/wimlib/threads.h        \
150         include/wimlib/timestamp.h      \
151         include/wimlib/types.h          \
152         include/wimlib/unaligned.h      \
153         include/wimlib/unix_data.h      \
154         include/wimlib/util.h           \
155         include/wimlib/wim.h            \
156         include/wimlib/write.h          \
157         include/wimlib/xattr.h          \
158         include/wimlib/xml.h            \
159         include/wimlib/xml_windows.h    \
160         include/wimlib/xmlproc.h        \
161         include/wimlib/xpress_constants.h
162
163 if WITH_NTFS_3G
164 libwim_la_SOURCES += src/ntfs-3g_apply.c        \
165                      src/ntfs-3g_capture.c      \
166                      include/wimlib/ntfs_3g.h
167 endif
168
169 if WINDOWS_NATIVE_BUILD
170 libwim_la_SOURCES += src/wimboot.c                      \
171                      src/win32_common.c                 \
172                      src/win32_apply.c                  \
173                      src/win32_capture.c                \
174                      src/win32_replacements.c           \
175                      src/win32_vss.c                    \
176                      include/wimlib/wimboot.h           \
177                      include/wimlib/win32.h             \
178                      include/wimlib/win32_common.h      \
179                      include/wimlib/win32_vss.h         \
180                      include/wimlib/wof.h
181 PLATFORM_LIBS = -lntdll
182 else
183 libwim_la_SOURCES += src/unix_apply.c           \
184                      src/unix_capture.c
185 PLATFORM_LIBS =
186 endif
187
188 if ENABLE_TEST_SUPPORT
189 libwim_la_SOURCES += src/test_support.c         \
190                      include/wimlib/test_support.h
191 endif
192
193 libwim_la_CFLAGS =              \
194         -DBUILDING_WIMLIB       \
195         $(AM_CFLAGS)            \
196         $(PTHREAD_CFLAGS)       \
197         $(LIBNTFS_3G_CFLAGS)    \
198         $(LIBFUSE_CFLAGS)
199
200 libwim_la_LDFLAGS = $(AM_LDFLAGS) -version-info 36:0:21
201
202 libwim_la_LIBADD =              \
203         $(PTHREAD_LIBS)         \
204         $(LIBNTFS_3G_LIBS)      \
205         $(LIBFUSE_LIBS)         \
206         $(LIBRT_LIBS)           \
207         $(PLATFORM_LIBS)
208
209 ##############################################################################
210 #                               Programs                                     #
211 ##############################################################################
212
213 bin_PROGRAMS = wimlib-imagex
214 dist_bin_SCRIPTS = programs/mkwinpeimg
215
216 wimlib_imagex_SOURCES =         \
217         programs/imagex.c       \
218         include/wimlib.h        \
219         include/wimlib_tchar.h
220
221 if WINDOWS_NATIVE_BUILD
222 wimlib_imagex_SOURCES +=        \
223         programs/imagex-win32.c \
224         programs/imagex-win32.h \
225         programs/wgetopt.c      \
226         programs/wgetopt.h
227 endif
228
229 wimlib_imagex_CFLAGS = $(AM_CFLAGS) -Wno-deprecated-declarations
230
231 wimlib_imagex_LDADD = $(top_builddir)/libwim.la
232
233 wimlib_imagex_cmds =    \
234         append          \
235         apply           \
236         capture         \
237         delete          \
238         dir             \
239         export          \
240         extract         \
241         info            \
242         join            \
243         mount           \
244         mountrw         \
245         optimize        \
246         split           \
247         unmount         \
248         update          \
249         verify
250
251 ##############################################################################
252 #                                 Hooks                                      #
253 ##############################################################################
254
255 install-exec-hook:
256         for cmd in $(wimlib_imagex_cmds); do                            \
257                 cd $(DESTDIR)$(bindir) &&                               \
258                         ln -f wimlib-imagex wim$${cmd};                 \
259         done
260
261 install-data-hook:
262         for cmd in $(wimlib_imagex_cmds); do                            \
263                 cd $(DESTDIR)$(mandir)/man1 &&                          \
264                         ln -sf wim$${cmd}.1 wimlib-imagex-$${cmd}.1;    \
265         done
266
267 uninstall-hook:
268         for cmd in $(wimlib_imagex_cmds); do                            \
269                 rm -f $(DESTDIR)$(bindir)/wim$${cmd};                   \
270                 rm -f $(DESTDIR)$(mandir)/man1/wim$${cmd}.1;            \
271         done
272
273 ##############################################################################
274 #                               Documentation                                #
275 ##############################################################################
276
277 man1_MANS =                             \
278         doc/man1/wimlib-imagex.1        \
279         doc/man1/wimappend.1            \
280         doc/man1/wimapply.1             \
281         doc/man1/wimcapture.1           \
282         doc/man1/wimdelete.1            \
283         doc/man1/wimdir.1               \
284         doc/man1/wimexport.1            \
285         doc/man1/wimextract.1           \
286         doc/man1/wiminfo.1              \
287         doc/man1/wimjoin.1              \
288         doc/man1/wimmount.1             \
289         doc/man1/wimmountrw.1           \
290         doc/man1/wimoptimize.1          \
291         doc/man1/wimsplit.1             \
292         doc/man1/wimunmount.1           \
293         doc/man1/wimupdate.1            \
294         doc/man1/wimverify.1            \
295         doc/man1/mkwinpeimg.1
296
297 EXTRA_DIST += $(man1_MANS)
298
299 ##############################################################################
300 #                                 Tests                                      #
301 ##############################################################################
302
303 check_PROGRAMS = tests/tree-cmp
304 tests_tree_cmp_SOURCES = tests/tree-cmp.c
305
306 dist_check_SCRIPTS = tests/test-imagex \
307                      tests/test-imagex-capture_and_apply \
308                      tests/test-imagex-update_and_extract
309
310 if WITH_FUSE
311 dist_check_SCRIPTS += tests/test-imagex-mount
312 endif
313
314 if WITH_NTFS_3G
315 dist_check_SCRIPTS += tests/test-imagex-ntfs
316 endif
317
318 EXTRA_DIST +=                                   \
319         tests/common_tests.sh                   \
320         tests/exclusionlists                    \
321         tests/test_utils.sh                     \
322         tests/security_descriptor_1.base64      \
323         tests/security_descriptor_1.bin         \
324         tests/security_descriptor_2.base64      \
325         tests/security_descriptor_2.bin         \
326         tests/wims
327
328 if WINDOWS_NATIVE_BUILD
329 # Tests are run manually for Windows builds.
330 TESTS =
331 else
332 TESTS = $(dist_check_SCRIPTS)
333 endif
334
335 # Extra test programs (not run by 'make check')
336 EXTRA_PROGRAMS = tests/wlfuzz
337 tests_wlfuzz_SOURCES = tests/wlfuzz.c
338 tests_wlfuzz_LDADD = $(top_builddir)/libwim.la
339
340 ##############################################################################