modeco80
5c3433461d
Mostly so it actually works. I couldn't get a fully JS version working and I can't be bothered to when this seems to work. Note that yes, the wasm IS checked in to the repository. This is just so clang isn't a direct build dependency, but will be needed if the decompression module needs to be updated.
34 lines
548 B
Makefile
34 lines
548 B
Makefile
# Makefile for WASM decompression.
|
|
|
|
CXX = clang++ --target=wasm32
|
|
CXXFLAGS = -Wall \
|
|
-Os \
|
|
-nostdlib \
|
|
-fvisibility=hidden \
|
|
-std=c++20 \
|
|
-ffunction-sections \
|
|
-fdata-sections
|
|
|
|
src/decompress.wasm: obj/ obj/decompress.o
|
|
wasm-ld \
|
|
-o $@ \
|
|
--no-entry \
|
|
--strip-all \
|
|
--export-dynamic \
|
|
--allow-undefined \
|
|
--initial-memory=131072 \
|
|
--error-limit=0 \
|
|
--lto-O3 \
|
|
-O3 \
|
|
--gc-sections \
|
|
obj/decompress.o
|
|
|
|
|
|
obj/%.o: src/%.cpp
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
clean:
|
|
rm -rf obj src/decompress.wasm
|
|
|
|
obj/:
|
|
mkdir -p obj/
|