apfl/webpage/build.sh
Laria Carolin Chabowski 25c872f4ee Define globals in apfl itself
We're now first building a standalone bytecode compiler `apflc` that will
compile `globals.apfl` into bytecode and write it out as a C source file.
When initializing a new context, that embedded bytecode will then get
evaluated and the global scope will be populated from the dictionary
returned by that bytecode.
2023-03-07 21:40:07 +01:00

16 lines
416 B
Bash
Executable file

#!/bin/sh
set -e
cd playground
rm -rf build-native
mkdir build-native
cd build-native
cmake ../../../CMakeLists.txt
make -j"$(nproc)" apflc
cd ..
rm -rf build
mkdir build
cd build
emcmake cmake -DCMAKE_C_FLAGS="-O2" -DBUILD_SHARED_LIBS=NO -DApflApflcNative_DIR="$(pwd)/../build-native/" ../../../CMakeLists.txt
emmake make -j"$(nproc)" apfl
cd ..
emcc -sASYNCIFY -O3 -oplayground.js playground.c build/src/libapfl.a