Browse Source

Merge pull request #48 from BillKek/20230112

sh script to compile editor (with F3 capability) in windows executable
Alexey Kutepov 2 years ago
parent
commit
ef77dd39a7
1 changed files with 16 additions and 0 deletions
  1. 16 0
      build_msys2_mingw64.sh

+ 16 - 0
build_msys2_mingw64.sh

@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -xe
+
+PKGS="--static sdl2 glew freetype2"
+CFLAGS="-Wall -Wextra -pedantic -ggdb -DGLEW_STATIC `pkg-config --cflags $PKGS` -Isrc -Dassert(expression)=((void)0) "
+LIBS="-lm -lopengl32 `pkg-config --libs $PKGS`"
+SRC="src/main.c src/la.c src/editor.c src/file_browser.c src/free_glyph.c src/simple_renderer.c src/common.c"
+OBJ=$(echo "$SRC" | sed "s/\.c/\.o/g")
+OBJ=$(echo "$OBJ" | sed "s/src\// /g")
+
+# wget "https://raw.githubusercontent.com/tsoding/minirent/master/minirent.h" -P /src
+gcc -std=c11 $CFLAGS -c $SRC
+# some libs linked with c++ stuff
+g++ -o life.exe $OBJ $LIBS $LIBS -static
+