Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
65 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
# Quick and dirty Makefile for Desktop + Emscripten build | ||
CC := g++ | ||
|
||
CXXFLAGS := -O3 -std=c++11 -W -Wall -Wextra | ||
|
||
SOURCES := $(wildcard src/*.cpp) $(wildcard src/TypeHandlers/*.cpp) tests.cpp | ||
|
||
OUTPUT := tivars_test | ||
|
||
OBJS = $(patsubst %.cpp, %.o, $(SOURCES)) | ||
|
||
EMCC := em++ | ||
GCC := g++ | ||
CPPFLAGS := -O3 -std=c++11 -Wall | ||
SOURCES := tests.cpp src/*.cpp src/TypeHandlers/*.cpp | ||
OUTPUT := tivars_test | ||
|
||
lib: | ||
$(GCC) $(CPPFLAGS) -o $(OUTPUT) $(SOURCES) | ||
all: $(OUTPUT) | ||
|
||
%.o: %.cpp | ||
$(CC) $(CXXFLAGS) -c $< -o $@ | ||
|
||
js: | ||
$(EMCC) -s DISABLE_EXCEPTION_CATCHING=1 $(CPPFLAGS) $(SOURCES) -o $(OUTPUT).html --preload-file assets | ||
$(OUTPUT): $(OBJS) | ||
$(CC) $(CXXFLAGS) $(LFLAGS) $^ -o $@ | ||
|
||
clean: | ||
rm -rf *.o cmake_install.cmake CMakeCache.txt CMakeFiles $(OUTPUT).html $(OUTPUT).js $(OUTPUT).data $(OUTPUT).html.mem | ||
$(RM) -f $(OBJS) $(OUTPUT) | ||
|
||
.PHONY: all clean | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
CC := em++ | ||
|
||
# Emscripten stuff - todo: add -s INVOKE_RUN=0 for lib version (not .html) | ||
EMFLAGS := --bind --llvm-lto 3 -s ASSERTIONS=0 -s DISABLE_EXCEPTION_CATCHING=1 --preload-file assets | ||
|
||
CXXFLAGS := -O3 -std=c++11 -W -Wall -Wextra $(EMFLAGS) | ||
|
||
asmjs: CXXFLAGS += --closure 1 -s WASM=0 | ||
asmjs-html: CXXFLAGS += --closure 1 -s WASM=0 | ||
|
||
wasm: CXXFLAGS += --closure 0 -s WASM=1 -s "BINARYEN_METHOD='native-wasm,asmjs'" | ||
wasm-html: CXXFLAGS += --closure 0 -s WASM=1 -s "BINARYEN_METHOD='native-wasm,asmjs'" | ||
|
||
SOURCES := $(wildcard src/*.cpp) $(wildcard src/TypeHandlers/*.cpp) tests.cpp | ||
|
||
OUTPUT := tivars_test | ||
|
||
OBJS = $(patsubst %.cpp, %.bc, $(SOURCES)) | ||
|
||
OUTPUT := tivars_test | ||
|
||
asmjs: $(OUTPUT).html | ||
wasm: $(OUTPUT).html | ||
|
||
$(OUTPUT).html: $(OUTPUT).js | ||
|
||
asmjs-html: $(OBJS) | ||
$(CC) $(CXXFLAGS) $(LFLAGS) $^ -o $(OUTPUT).html | ||
|
||
wasm-html: $(OBJS) | ||
$(CC) $(CXXFLAGS) $(LFLAGS) $^ -o $(OUTPUT).html | ||
|
||
all: asmjs-html | ||
|
||
%.bc: %.cpp | ||
$(CC) $(CXXFLAGS) -c $< -o $@ | ||
|
||
$(OUTPUT).js: $(OBJS) | ||
$(CC) $(CXXFLAGS) $(LFLAGS) $^ -o $@ | ||
|
||
clean: | ||
$(RM) -f $(OBJS) $(OUTPUT).js* $(OUTPUT).html* $(OUTPUT).data $(OUTPUT).asm.js $(OUTPUT).was* | ||
|
||
.PHONY: all clean asmjs wasm asmjs-html wasm-html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters