Fix Emscripten build system

This commit is contained in:
2014-07-23 21:33:34 +02:00
committed by Valeriano A.R
parent 352bfbf8f5
commit 985a501788
5 changed files with 25 additions and 5 deletions

View File

@@ -22,6 +22,7 @@
#include <emscripten.h>
#define USE_OpenGL 0
#define USE_OpenGLES 1
#define SDL_GetKeyState SDL_GetKeyboardState
#else
// UNIX
#include <GL/gl.h>

View File

@@ -2,11 +2,15 @@
#include <math.h>
#include <SDL/SDL.h>
#ifdef EMSCRIPTEN
#define SDL_GetKeyState SDL_GetKeyboardState
#endif
#include "Util.h"
#include "Input.h"
// Globals
InputKeyStatus _keys[InputKey_Max];
int _pointerDown=0;

View File

@@ -1,15 +1,21 @@
CC= python /c/Program\ Files/Emscripten/emscripten/1.7.8/emcc
CC= emcc
LAUNCHER= start
RM=rm -rf
LIBS=
CFLAGS= -s FULL_ES2=1 -s ASM_JS=1 -O1
LDFLAGS= --embed-file data
#LDFLAGS= --preload-file data
CFLAGS= -s FULL_ES2=1 -s ASM_JS=1 -O1 -Wno-implicit-function-declaration
#LDFLAGS= --embed-file data
LDFLAGS= --preload-file data
RESULT=game.html
BUILDDIR=build-emscripten
ifeq ($(target),release)
CFLAGS= -s FULL_ES2=1 -s ASM_JS=1 -O2 --llvm-lto 1 -Wno-implicit-function-declaration
BUILDDIR=build-emscripten-release
endif
include Makefile.common

8
dist.emscripten.sh Normal file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
make -f Makefile.emscripten target=release clean
make -f Makefile.emscripten target=release
mkdir -p DIST/web
cp -Rv web/* DIST/web/
cp -v build-emscripten-release/game.* DIST/web/

View File

@@ -5,7 +5,8 @@ DIRNAME="TestGame"
DATE=$(date +%Y%m%d)
ZIPNAME="$DIRNAME.$DATE.zip"
make -f Makefile
make -f Makefile.win32 clean
make -f Makefile.win32
mkdir $DIRNAME
cd $DIRNAME