# Hand-written static build of zimg 3.0.6 for x86_64-w64-mingw32 (automake is # not installed). Mirrors Makefile.am with X86SIMD on; X86SIMD_AVX512 stays off # because zimg's configure test uses -mavx512pf/-mavx512er, which GCC 16 no # longer accepts, so autotools would disable it too. S ?= ../../src/zimg-release-3.0.6 CROSS ?= x86_64-w64-mingw32- CXX = $(CROSS)g++ AR = $(CROSS)ar RANLIB = $(CROSS)ranlib # -Wa,-muse-unaligned-vector-move: GCC on Win64 may keep AVX locals on an # unaligned stack (GCC bug 54412); the assembler turns aligned moves into # unaligned ones so AVX/AVX2 paths cannot fault. CXXFLAGS = -std=c++14 -O2 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers \ -DNDEBUG -DZIMG_X86 -I$(S)/src/zimg -Wa,-muse-unaligned-vector-move BASE = api/zimg colorspace/colorspace colorspace/colorspace_param colorspace/gamma colorspace/graph \ colorspace/matrix3 colorspace/operation colorspace/operation_impl common/cpuinfo common/libm_wrapper \ common/matrix depth/blue depth/depth_convert depth/depth depth/dither depth/quantize \ graph/basic_filter graph/filtergraph graph/graphbuilder graph/graphnode resize/filter resize/resize \ resize/resize_impl unresize/bilinear unresize/unresize unresize/unresize_impl \ colorspace/x86/operation_impl_x86 common/x86/cpuinfo_x86 common/x86/x86util \ depth/x86/depth_convert_x86 depth/x86/dither_x86 resize/x86/resize_impl_x86 SSE = colorspace/x86/operation_impl_sse resize/x86/resize_impl_sse SSE2 = colorspace/x86/operation_impl_sse2 depth/x86/depth_convert_sse2 depth/x86/dither_sse2 \ depth/x86/error_diffusion_sse2 depth/x86/f16c_sse2 resize/x86/resize_impl_sse2 AVX = colorspace/x86/operation_impl_avx resize/x86/resize_impl_avx F16C = depth/x86/f16c_ivb AVX2 = colorspace/x86/operation_impl_avx2 depth/x86/depth_convert_avx2 depth/x86/dither_avx2 \ depth/x86/error_diffusion_avx2 resize/x86/resize_impl_avx2 obj = $(addprefix obj/,$(addsuffix .o,$(1))) OBJS = $(call obj,$(BASE) $(SSE) $(SSE2) $(AVX) $(F16C) $(AVX2)) $(call obj,$(SSE)): EXTRA = -msse $(call obj,$(SSE2)): EXTRA = -msse2 $(call obj,$(AVX)): EXTRA = -mavx -mtune=sandybridge $(call obj,$(F16C)): EXTRA = -mavx -mf16c -mtune=ivybridge $(call obj,$(AVX2)): EXTRA = -mavx2 -mf16c -mfma -mtune=haswell libzimg.a: $(OBJS) rm -f $@ $(AR) rcs $@ $^ $(RANLIB) $@ obj/%.o: $(S)/src/zimg/%.cpp @mkdir -p $(dir $@) $(CXX) $(CXXFLAGS) $(EXTRA) -c $< -o $@ install: libzimg.a mkdir -p $(PREFIX)/include $(PREFIX)/lib/pkgconfig cp $(S)/src/zimg/api/zimg.h $(S)/src/zimg/api/zimg++.hpp $(PREFIX)/include/ cp libzimg.a $(PREFIX)/lib/