Move FreeLibrary call to win32_global_cleanup()
[wimlib] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4
2
3 AM_CPPFLAGS     = -I$(top_srcdir)/src $(WINDOWS_CPPFLAGS)
4
5 AM_CFLAGS       = -std=gnu99 -D_LARGEFILE_SOURCE \
6                    -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
7
8 lib_LTLIBRARIES = libwim.la
9
10 libwim_la_LDFLAGS = -version-info 4:0:2 $(WINDOWS_LDFLAGS)
11
12 libwim_la_SOURCES =             \
13         src/add_image.c         \
14         src/buffer_io.h         \
15         src/compress.c          \
16         src/compress.h          \
17         src/decompress.c        \
18         src/decompress.h        \
19         src/delete_image.c      \
20         src/dentry.c            \
21         src/dentry.h            \
22         src/encoding.c          \
23         src/endianness.h        \
24         src/export_image.c      \
25         src/extract_image.c     \
26         src/hardlink.c          \
27         src/header.c            \
28         src/integrity.c         \
29         src/join.c              \
30         src/list.h              \
31         src/lookup_table.c      \
32         src/lookup_table.h      \
33         src/lz77.c              \
34         src/lzx-common.c        \
35         src/lzx-compress.c      \
36         src/lzx-decompress.c    \
37         src/lzx.h               \
38         src/metadata_resource.c \
39         src/mount_image.c       \
40         src/resource.c          \
41         src/rbtree.c            \
42         src/rbtree.h            \
43         src/security.c          \
44         src/security.h          \
45         src/sha1.c              \
46         src/sha1.h              \
47         src/split.c             \
48         src/symlink.c           \
49         src/timestamp.h         \
50         src/util.c              \
51         src/util.h              \
52         src/verify.c            \
53         src/wim.c               \
54         src/wimlib.h            \
55         src/wimlib_internal.h   \
56         src/write.c             \
57         src/xml.c               \
58         src/xml.h               \
59         src/xpress-compress.c   \
60         src/xpress-decompress.c \
61         src/xpress.h
62
63 if WITH_NTFS_3G
64 libwim_la_SOURCES += src/ntfs-apply.c   \
65                      src/ntfs-capture.c
66 endif
67
68
69 EXTRA_libwim_la_SOURCES = src/sha1-ssse3.asm
70 libwim_la_DEPENDENCIES = $(SSSE3_SHA1_OBJ)
71 STRIP_FPIC = sh $(top_srcdir)/build-aux/strip_fPIC.sh
72
73 sha1-ssse3.lo:src/sha1-ssse3.asm
74         $(LIBTOOL) --mode=compile --tag=CC $(STRIP_FPIC) $(NASM) -f elf64 \
75         -DINTEL_SHA1_UPDATE_DEFAULT_DISPATCH=ssse3_not_found \
76         $<
77
78 libwim_la_LIBADD =              \
79         $(LIBXML2_LDADD)        \
80         $(LIBFUSE_LDADD)        \
81         $(LIBNTFS_3G_LDADD)     \
82         $(LTLIBICONV)           \
83         $(LIBCRYPTO_LDADD)      \
84         $(SSSE3_SHA1_OBJ)       \
85         $(PTHREAD_LDADD)        \
86         $(WINDOWS_LDADD)
87
88 libwim_la_CFLAGS =              \
89         $(AM_CFLAGS)            \
90         $(VISIBILITY_CFLAGS)    \
91         $(LIBXML2_CFLAGS)       \
92         $(LIBFUSE_CFLAGS)       \
93         $(LIBNTFS_3G_CFLAGS)    \
94         $(LIBCRYPTO_CFLAGS)
95
96
97 bin_PROGRAMS     = imagex
98 imagex_SOURCES   = programs/imagex.c
99 imagex_LDADD     = $(top_builddir)/libwim.la
100
101 if WINDOWS_NATIVE_BUILD
102 imagex_SOURCES += programs/imagex-win32.c programs/imagex-win32.h
103 libwim_la_SOURCES += src/win32.c
104 endif
105
106 install-exec-hook:
107         if [ "@IMAGEX_PROGNAME@" != imagex ]; then \
108                 cd $(DESTDIR)$(bindir) && mv -f imagex "@IMAGEX_PROGNAME@"; \
109         fi
110
111 uninstall-hook:
112         if [ "@IMAGEX_PROGNAME@" != imagex ]; then \
113                 cd $(DESTDIR)$(bindir) && rm -f "@IMAGEX_PROGNAME@"; \
114         fi
115
116 dist_bin_SCRIPTS = programs/mkwinpeimg
117
118 include_HEADERS = src/wimlib.h
119
120 EXTRA_DIST =                                    \
121         build-aux/strip_fPIC.sh                 \
122         archlinux                               \
123         debian                                  \
124         rpm                                     \
125         README.WINDOWS                          \
126         programs/install.cmd                    \
127         programs/wimapply.c                     \
128         tests/common_tests.sh                   \
129         tests/tests-common.sh                   \
130         tests/security_descriptor_1.base64      \
131         tests/security_descriptor_1.bin         \
132         tests/security_descriptor_2.base64      \
133         tests/security_descriptor_2.bin
134
135 pkgconfigdir    = @pkgconfigdir@
136 pkgconfig_DATA  = wimlib.pc
137
138 $(pkgconfig_DATA): config.status
139
140 wimlib_manpages =                               \
141         doc/@IMAGEX_PROGNAME@.1                 \
142         doc/@IMAGEX_PROGNAME@-append.1          \
143         doc/@IMAGEX_PROGNAME@-apply.1           \
144         doc/@IMAGEX_PROGNAME@-capture.1         \
145         doc/@IMAGEX_PROGNAME@-delete.1          \
146         doc/@IMAGEX_PROGNAME@-dir.1             \
147         doc/@IMAGEX_PROGNAME@-export.1          \
148         doc/@IMAGEX_PROGNAME@-info.1            \
149         doc/@IMAGEX_PROGNAME@-join.1            \
150         doc/@IMAGEX_PROGNAME@-mount.1           \
151         doc/@IMAGEX_PROGNAME@-mountrw.1         \
152         doc/@IMAGEX_PROGNAME@-optimize.1        \
153         doc/@IMAGEX_PROGNAME@-split.1           \
154         doc/@IMAGEX_PROGNAME@-unmount.1         \
155         doc/mkwinpeimg.1
156
157 man1_MANS = $(wimlib_manpages)
158 DISTCLEANFILES = $(wimlib_manpages)
159
160 $(man1_MANS): config.status
161
162 check_PROGRAMS = tests/tree-cmp
163 tests_tree_cmp_SOURCES = tests/tree-cmp.c
164
165 dist_check_SCRIPTS = tests/test-imagex \
166                      tests/test-imagex-capture_and_apply
167
168 if WITH_FUSE
169 dist_check_SCRIPTS += tests/test-imagex-mount
170 endif
171
172 if WITH_NTFS_3G
173 dist_check_SCRIPTS += tests/test-imagex-ntfs
174 endif
175
176 if WINDOWS_NATIVE_BUILD
177 # TODO: The tests need to be re-written for Windows builds.
178 TESTS =
179 else
180 TESTS = $(dist_check_SCRIPTS)
181 endif
182