cd zstd/contrib/declib
./combine.sh -r ../../lib -r ../../lib/common -r ../../lib/decompress -o zstddeclib.c zstddeclib-in.c
```
-Then add the resulting file to your project (see the [example files](examples)). `build.sh` will run the above script then compile and test the library.
+Then add the resulting file to your project (see the [example files](examples)).
+
+`create_single_file_decoder.sh` will run the above script, creating file `zstddeclib.c`.
+`build_test.sh` will create the decoder, then compile and test the library.
Why
---
OUT_WASM="temp.wasm"
# Amalgamate the sources
-./combine.sh -r "$ZSTD_SRC_ROOT" -r "$ZSTD_SRC_ROOT/common" -r "$ZSTD_SRC_ROOT/decompress" -o zstddeclib.c zstddeclib-in.c
+./create_single_file_decoder.sh
# Did combining work?
if [ $? -ne 0 ]; then
- echo "Combine script: FAILED"
+ echo "Single file decoder creation script: FAILED"
exit 1
fi
-echo "Combine script: PASSED"
+echo "Single file decoder creation script: PASSED"
# Compile the generated output
cc -Os -g0 -o $OUT_FILE examples/simple.c
--- /dev/null
+#!/bin/bash
+
+# Where to find the sources
+ZSTD_SRC_ROOT="../../lib"
+
+
+# Amalgamate the sources
+./combine.sh -r "$ZSTD_SRC_ROOT" -r "$ZSTD_SRC_ROOT/common" -r "$ZSTD_SRC_ROOT/decompress" -o zstddeclib.c zstddeclib-in.c
+# Did combining work?
+if [ $? -ne 0 ]; then
+ echo "Combine script: FAILED"
+ exit 1
+fi
+echo "Combine script: PASSED"