--- /dev/null
+#!/bin/sh
+if [ -n "$1" ]; then CC="$1"; elif [ -z "$CC" ]; then CC="cc"; fi
+
+echo "Built : `date -u +"%Y-%m-%d %H:%M:%S"`"
+echo "Platform : `uname -s -r -v -m`"
+echo "Target : `$CC -dumpmachine`"
+echo "Compiler : `$CC -v 2>&1 | grep -iE '\b(gcc|clang)\s+version\b' | head -n 1`"
--- /dev/null
+@echo off
+cd /d "%~dp0..\..\.."
+
+set "MSYS2_DIR=C:\msys64"
+
+call "%MSYS2_DIR%\msys2_shell.cmd" -mingw32 -no-start -defterm -where "%CD%" -c "./etc/utils/win32/%~n0.sh"
+call "%MSYS2_DIR%\msys2_shell.cmd" -mingw64 -no-start -defterm -where "%CD%" -c "./etc/utils/win32/%~n0.sh"
+
+pause
--- /dev/null
+#!/bin/bash
+set -e
+cd -- "$(dirname -- "${0}")/../../.."
+
+if [ -z "${cc_path}" ]; then
+ cc_path="cc"
+fi
+
+readonly machine="$("${cc_path}" -dumpmachine)"
+
+if [[ "${machine}" == *"-cygwin" ]]; then
+ readonly use_flto=0
+else
+ readonly use_flto=1
+fi
+
+mk_slunk() {
+ make -B CC="${cc_path}" MARCH=${2} MTUNE=${3} STATIC=1 STRIP=1 FLTO=${use_flto}
+ cp -vf "frontend/bin/slunkcrypt" "out/_next_/slunkcrypt-${1}"
+}
+
+mkdir -p "out/_next_"
+
+make -B CC="${cc_path}" clean
+
+case "${machine}" in
+ x86_64*)
+ mk_slunk "x86_64" "x86-64" "nocona"
+ ;;
+ i686*)
+ mk_slunk "i686" "pentiumpro" "pentium3"
+ ;;
+ *)
+ echo "Unknown target CPU type !!!"
+ exit 1
+esac
+
+if [[ "${machine}" == *"-cygwin" ]]; then
+ cp -vfu "$(which cygwin1.dll)" "out/_next_"
+fi
+
+echo "Build completed successfully."