-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmake-mingw
executable file
·20 lines (19 loc) · 934 Bytes
/
make-mingw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
TOOLCHAIN_PREFIX=x86_64-w64-mingw32-
CFLAGS="$CFLAGS -Os -ggdb -Wall -Wextra -Wpedantic -pedantic"
#CFLAGS="$CFLAGS -flto"
case $1 in
32)
TOOLCHAIN_PREFIX=i686-w64-mingw32-
CFLAGS="$CFLAGS -m32"
shift
;;
esac
exec ${MAKE:-make} \
PLATFORM=win \
TOOLCHAIN_PREFIX="$TOOLCHAIN_PREFIX" \
TOOL_WRAPPER=wine \
LDFLAGS_SH='-static -L$(LIB_FMEM)' \
CFLAGS="$CFLAGS" \
CMAKE="cmake -DCMAKE_C_COMPILER=${TOOLCHAIN_PREFIX}gcc -DCMAKE_CXX_COMPILER=${TOOLCHAIN_PREFIX}g++ -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_CROSSCOMPILING=1 -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY -DCMAKE_FIND_ROOT_PATH=/usr/${TOOLCHAIN_PREFIX%-} -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_AR='$(command -v "${TOOLCHAIN_PREFIX}gcc-ar")' -DCMAKE_RANLIB='$(command -v "${TOOLCHAIN_PREFIX}gcc-ranlib")'" \
"$@"