1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
CXX = emcc EXE = dist/output.js SRCS = $(wildcard *.cpp) OBJS = $(patsubst %.cpp,%.o,$(SRCS)) LDFLAGS = -s ALLOW_MEMORY_GROWTH=1 -s USE_WEBGL2=1 -s FULL_ES3=1 -s WASM=1 -s NO_EXIT_RUNTIME=1 -s FETCH all: build $(EXE) $(EXE): $(OBJS) echo $(OBJS) $(CXX) -o $(EXE) $(OBJS) $(LDFLAGS) build: @mkdir -p dist clean: rm -rf dist