2 # This Makefile builds the third-party libraries needed to build a standalone
3 # libwim.dll for Windows. We build these third-party libraries ourselves mainly
4 # to cut down on bloat. They are automatically downloaded from the URLs
5 # declared below and verified against the checksums given in the 'sha256sums'
8 # This Makefile requires a GNU toolchain with MinGW-w64 (i686 and x86_64
12 ARCHITECTURES := i686 x86_64
14 LIBXML2_VERSION := 2.10.3
15 LIBXML_URL := https://download.gnome.org/sources/libxml2/2.10/libxml2-$(LIBXML2_VERSION).tar.xz
16 LIBXML_SRCDIR := libxml2-$(LIBXML2_VERSION)
17 LIBXML_DIST := $(LIBXML_SRCDIR).tar.xz
18 SRCDIR_TARGETS += $(LIBXML_SRCDIR)
19 DIST_TARGETS += $(LIBXML_DIST)
22 $(LIBXML_SRCDIR):$(LIBXML_DIST) checksums_verified
24 cp $@/Copyright COPYING.libxml2
25 MAKE_CLEAN_FILES += $(LIBXML_SRCDIR) COPYING.libxml2
27 checksums_verified:$(DIST_TARGETS)
28 sha256sum -c sha256sums
31 # declare_libxml_target(arch)
33 define declare_libxml_target
34 libxml_$(1):$(LIBXML_SRCDIR)
35 builddir=build_libxml_$(1); \
36 rm -rf $$$$builddir; \
39 ../$(LIBXML_SRCDIR)/configure \
40 --host=$(1)-w64-mingw32 \
43 --prefix=$$$$PWD/../sysroot_$(1) \
50 rm -f ../sysroot_$(1)/lib/libxml2.la;
52 $(1)_BUILD_TARGETS += libxml_$(1)
53 MAKE_CLEAN_FILES += build_libxml_$(1)
57 # declare_arch_targets(arch)
59 define declare_arch_targets
60 $(eval $(call declare_libxml_target,$(1)))
62 sysroot_$(1): $($(1)_BUILD_TARGETS)
64 ALL_SYSROOTS += sysroot_$(1)
65 MAKE_CLEAN_FILES += sysroot_$(1)
68 $(foreach arch,$(ARCHITECTURES),$(eval $(call declare_arch_targets,$(arch))))
73 rm -rf $(MAKE_CLEAN_FILES) $(DIST_TARGETS)
75 .PHONY: all clean $(SRCDIR_TARGETS) checksums_verified