From bcf103aca2f64a8162df290b5a66eb5a7490040f Mon Sep 17 00:00:00 2001 From: Brad Grantham Date: Sat, 7 Jan 2017 23:01:55 -0800 Subject: [PATCH] Workaround assertion causes with -O2 -O2 causes a weird assertion (incorrect function table?), so drop back to -O1 Embed "packaged" directory into HTML in emscripten --- Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d716754..934c71b 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,19 @@ +# OPT = -O2 # -O2 causes an abort in malloc on new MAINboard. +# OPT = -g4 -s ASSERTIONS=1 -s DEMANGLE_SUPPORT=1 +OPT = -O1 + INCFLAGS += -CXXFLAGS += $(INCFLAGS) -g -Wall -std=c++11 -O2 +CXXFLAGS += $(INCFLAGS) $(OPT) -Wall -std=c++11 -s FULL_ES2=1 -s USE_GLFW=3 LDFLAGS += LDLIBS += -SOURCES = apple2e.cpp dis6502.cpp web_interface.cpp +SOURCES = apple2e.cpp dis6502.cpp interface.cpp + +PRELOAD = --preload-file packaged@/ all: apple2e.js apple2e.js: $(SOURCES) - emcc --bind $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(LDLIBS) --preload-file apple2e.rom + emcc $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(PRELOAD) clean: