(Please note, that the result still has reference to original DOM model: window, document, ...).
- Clone the Stockfish.js repository
- Replace the original Makefile in the src folder.
- Run
make all
from inside the src folder.
(Please note, that the result still has reference to original DOM model: window, document, ...).
make all
from inside the src folder.OBJS = bitbase.o bitboard.o endgame.o evaluate.o main.o \ | |
material.o misc.o movegen.o movepick.o pawns.o position.o psqt.o \ | |
search.o thread.o timeman.o tt.o uci.o ucioption.o | |
EXE = stockfish.wasm | |
CXXFLAGS = -Oz -DNDEBUG --closure 1 -s ENVIRONMENT=web -s INLINING_LIMIT=1 -s WASM=1 -fPIC -s EVAL_CTORS=0 -s ALLOW_MEMORY_GROWTH=1 -s BINARYEN_ASYNC_COMPILATION=1 -s NO_FILESYSTEM=1 -s STANDALONE_WASM | |
LDFLAGS = -Oz -DNDEBUG --closure 1 -s ENVIRONMENT=web -s INLINING_LIMIT=1 -s WASM=1 -fPIC -s EVAL_CTORS=0 -s ALLOW_MEMORY_GROWTH=1 -s BINARYEN_ASYNC_COMPILATION=1 -s NO_FILESYSTEM=1 -s STANDALONE_WASM | |
clean: | |
@rm -f $(EXE) stockfish.wasm *.o | |
all: $(EXE) | |
$(EXE): $(OBJS) | |
em++ -std=c++11 -o $@ $^ $(LDFLAGS) | |
%.o: %.cpp | |
em++ -std=c++11 -c $< $(CXXFLAGS) |