Files
jam-game/Makefile.emcc
T
2025-07-20 15:04:05 +03:00

32 lines
578 B
Makefile

# GNU makefile
# User configuration
CC = emcc
CXX = emcc
CXXFLAGS ?= -sUSE_SDL=2 -O3 -std=c++17 -Iinclude -fexceptions
LDFLAGS ?= -sUSE_SDL=2 -O3 -fexceptions --embed-file=data.pak@data.pak -sMAX_WEBGL_VERSION=2
TARGET = index.html
# System configuration
include Makefile.srcs
EXE = $(TARGET)
OBJS = $(SRCS:.cpp=.o)
# Targets
all: $(EXE)
dist: $(EXE)
mkdir -p dist
cp $(EXE) dist/
$(EXE): $(OBJS)
$(CXX) -o $@ $(OBJS) $(LDFLAGS)
cp index.template.html $(EXE)
.cpp.o:
$(CXX) $(CXXFLAGS) -c $< -o $@
clean:
-rm -rf $(OBJS) $(EXE) index.js index.wasm index.data dist