# Adapted from Makefile for Dingux by palxex TARGET = sdlpal.html HOST = CFILES = $(wildcard ../src/adplug/*.c) $(wildcard ../src/libmad/*.c) $(wildcard ../src/liboggvorbis/src/*.c) $(wildcard ../src/*.c) em.c CPPFILES = $(wildcard ../src/adplug/*.cpp) $(wildcard ../src/*.cpp) $(wildcard ./*.cpp) OBJFILES = $(CFILES:.c=.o) $(CPPFILES:.cpp=.o) CFLAGS = -I${EMSCRIPTEN_TOOLCHAIN}/include/SDL2 -g -Wall -O2 -fno-strict-aliasing -I. -I../src -I../src/liboggvorbis/include -I../src/liboggvorbis/src -DPAL_HAS_PLATFORM_SPECIFIC_UTILS LDFLAGS = -L${EMSCRIPTEN_TOOLCHAIN}/lib -lSDL2 -lm -lstdc++ --preload-file data -s TOTAL_MEMORY=134217728 -s TOTAL_STACK=5242880 --emrun -s DEMANGLE_SUPPORT=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 -s 'EMTERPRETIFY_FILE="sdlpal.bc"' .c.o: emcc -c $(CFLAGS) $(CPPFLAGS) -o $@ $< .cpp.o: em++ -c $(CFLAGS) $(CPPFLAGS) -o $@ $< $(TARGET):$(OBJFILES) em++ $(CFLAGS) -o $(TARGET) $(OBJFILES) $(LDFLAGS) clean: rm -f $(OBJFILES) rm -f $(TARGET) *.bc *.mem *.js *.data *.wast *.wasm repackage: rm -f $(TARGET) *.bc *.mem *.js *.data *.wast *.wasm em++ $(CFLAGS) -o $(TARGET) $(OBJFILES) $(LDFLAGS)