OSDN Git Service

Added build script for Mingw-w64 and Cygwin. 1.3.0
authorLoRd_MuldeR <mulder2@gmx.de>
Mon, 12 Dec 2022 14:25:25 +0000 (15:25 +0100)
committerLoRd_MuldeR <mulder2@gmx.de>
Mon, 12 Dec 2022 14:28:35 +0000 (15:28 +0100)
etc/utils/build_info.sh [new file with mode: 0755]
etc/utils/macosx/hdiutil.txt
etc/utils/macosx/mk-release.sh
etc/utils/win32/mk-release.cmd [new file with mode: 0644]
etc/utils/win32/mk-release.sh [new file with mode: 0755]

diff --git a/etc/utils/build_info.sh b/etc/utils/build_info.sh
new file mode 100755 (executable)
index 0000000..c661088
--- /dev/null
@@ -0,0 +1,7 @@
+#!/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`"
index 70d1d31..180d138 100644 (file)
@@ -1 +1 @@
-sudo hdiutil create archive.dmg -ov -volname "CRC-64" -fs HFS+ -srcfolder out
+sudo hdiutil create archive.dmg -ov -volname "SlunkCrypt" -fs HFS+ -srcfolder out
index c5a9be6..c9733bc 100755 (executable)
@@ -7,7 +7,7 @@ if [ -z "${cc_path}" ]; then
 fi
 
 mk_slunk() {
-       make -B CC="${cc_path}" TARGET="${1}-apple-macos" FLTO=1
+       make -B CC="${cc_path}" TARGET="${1}-apple-darwin" FLTO=1
        strip -o "out/slunkcrypt-${1}" "frontend/bin/slunkcrypt"
 }
 
diff --git a/etc/utils/win32/mk-release.cmd b/etc/utils/win32/mk-release.cmd
new file mode 100644 (file)
index 0000000..a05ad49
--- /dev/null
@@ -0,0 +1,9 @@
+@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
diff --git a/etc/utils/win32/mk-release.sh b/etc/utils/win32/mk-release.sh
new file mode 100755 (executable)
index 0000000..2c3415b
--- /dev/null
@@ -0,0 +1,42 @@
+#!/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."