WOLP4ESO3TH2PCS6MAB4QXBGPKMBOCYW62SGP7CVSDEWUPG3ME2QC
ZPW7JFL5ZR4T77O5Y4CRLCJTCKHYKEERP2JT2OIYZO5A7PIJSSBAC
B3U6WQSHDHQWSUHLMJMVRMSYJXVK5JPKTNX4NMWJGIDS7FOSR3ZQC
RNZJGWTBAY5JIEQP7E3VMAQBZCNJ2BA6Z3F2YDDBLKOAWE5AUI4QC
Q7P6NO6DTAU3Z7JQ6HNQIQPGWPQHW37RRI5A5HDJYNC7IJCQ4XSQC
BJNMXUGSKSQWBHVMRW47WAQ7ZKJ7VKM3WQ3ITYKFU3COU6ILLFOQC
7KS22PCEQW4NFNBIGVRIPLZ4VZL4W7WPNPGA7B23CYUIXZB37IBQC
KP5ZHGFKZZV35ZEH2AZW2HAFF6XXTK4XVLUI3D62ZTBPNOTQJONAC
RGJW3YTXML556YLAFHZSTEONWXRJ23PGW7Z6SKT3BV63ZEPWDTXAC
I2I3WERCRM7KAHR477JRZSN5XNXUIAWMDFQK25LV6L7VDZJTTANQC
WJQMF2ARTQWSZA4OZYRAENMXZ3MB6YLTZZOBJY65QOEL772QTVVAC
#ifdef _WIN32
// unknown pragmas are SUPPOSED to be ignored, but....
#pragma warning(disable : 4244) // MIPS
#pragma warning(disable : 4136) // X86
#pragma warning(disable : 4051) // ALPHA
#pragma warning(disable : 4018) // signed/unsigned mismatch
#pragma warning(disable : 4305) // truncation from const double to float
#endif
library tabula --include-directory tabula/include \
--cflag -Wall \
--cflag -Werror \
--cflag -Wno-unused-function \
--cflag -Wno-unused-value \
--cflag -pthread \
--lflag -lpthread \
$DEBUG_FLAGS \
tabula/src/tabula.c
per_platform library ___-tabula \
--include-directory tabula/include \
--cflag -Wall \
--cflag -Werror \
--cflag -Wno-unused-function \
--cflag -Wno-unused-value \
--cflag -pthread \
--lflag -lpthread \
$DEBUG_FLAGS \
tabula/src/tabula.c
library lnx-libuv --pkg-config libuv
library lnx-glfw3 --pkg-config glfw3 --lflag -lGL
library lnx-sqlite3 --pkg-config sqlite3
per_platform library ___-libuv --pkg-config libuv
per_platform library ___-sqlite3 --pkg-config sqlite3
library lnx-glfw3 --platform lnx --pkg-config glfw3 --lflag -lGL
library win-glfw3 --platform win --pkg-config glfw3 --lflag -lgdi32 --lflag -lssp
--include-directory "\$builddir/include" \
"\$builddir/include/alias/pga2d.h" \
"\$builddir/include/alias/pga3d.h" \
"\$builddir/include/alias/cga2d.h" \
"\$builddir/include/alias/cga3d.h"
--include-directory "\$builddir/include" \
"\$builddir/include/alias/pga2d.h" \
"\$builddir/include/alias/pga3d.h" \
"\$builddir/include/alias/cga2d.h" \
"\$builddir/include/alias/cga3d.h"
library lnx-alias \
--include-directory alias/include \
--lflag -lm \
tabula \
geometric_algebra_headers \
alias/src/ash.c \
alias/src/color.c \
alias/src/ecs_archetype.c \
alias/src/ecs_component.c \
alias/src/ecs_entity.c \
alias/src/ecs_instance.c \
alias/src/ecs_layer.c \
alias/src/ecs_memory.c \
alias/src/ecs_query.c \
alias/src/ff_qoi.c \
alias/src/lexer.c \
alias/src/log.c \
alias/src/memory.c \
alias/src/physics_bvh_2d.c \
alias/src/physics.c \
alias/src/random.c \
alias/src/str.c \
alias/src/string32.c \
alias/src/transform.c \
alias/src/ui.c
per_platform library ___-alias \
--include-directory alias/include \
--lflag -lm \
___-tabula \
geometric_algebra_headers \
alias/src/ash.c \
alias/src/color.c \
alias/src/ecs_archetype.c \
alias/src/ecs_component.c \
alias/src/ecs_entity.c \
alias/src/ecs_instance.c \
alias/src/ecs_layer.c \
alias/src/ecs_memory.c \
alias/src/ecs_query.c \
alias/src/ff_qoi.c \
alias/src/lexer.c \
alias/src/log.c \
alias/src/memory.c \
alias/src/physics_bvh_2d.c \
alias/src/physics.c \
alias/src/random.c \
alias/src/str.c \
alias/src/string32.c \
alias/src/transform.c \
alias/src/ui.c
# lnx-libuv lnx-glfw3 lnx-alias \
# --include-directory engine/include \
# engine/src/engine.c \
# engine/src/render.c \
# engine/src/input.c \
# engine/src/gfx.c \
# engine/src/font.c \
# engine/src/ui.c \
# engine/src/image.c \
# engine/src/resource.c \
# engine/src/transform.c
# lnx-libuv lnx-glfw3 lnx-alias \
# --include-directory engine/include \
# engine/src/engine.c \
# engine/src/render.c \
# engine/src/input.c \
# engine/src/gfx.c \
# engine/src/font.c \
# engine/src/ui.c \
# engine/src/image.c \
# engine/src/resource.c \
# engine/src/transform.c
rule gen_build_graph --command "ninja -t graph | dot -Tpng -o \$out" --implicit build.ninja
build build.ninja.png gen_build_graph
#rule gen_build_graph --command "ninja -t graph | dot -Tpng -o \$out" --implicit build.ninja
#build build.ninja.png gen_build_graph
# ---------------------------------------------------------------------------------------------------------------------
cflags="$cflags $(pkg-config --cflags $1)"
lflags="$lflags $(pkg-config --libs $1)"
PKG_CONFIG=PKG_CONFIG_${platform}
PKG_CONFIG_CMD="${!PKG_CONFIG}"
out_cflags=$($PKG_CONFIG_CMD --cflags $1)
out_lflags=$($PKG_CONFIG_CMD --libs $1)
cflags="$cflags $out_cflags"
lflags="$lflags $out_lflags"
PLATFORMS=( lnx win )
per_platform_0() {
local platform=$1
shift
local cmd=$1
shift
local name=$1
shift
if [[ $name == ___-* ]]; then
name="${name:4}"
fi
local args=
while (( "$#" )); do
local arg=$1
shift
if [[ $arg == ___-* ]]; then
arg="$platform-${arg:4}"
fi
args="$args $arg"
done
$cmd $platform-$name --platform $platform $args
}
per_platform() {
for PLATFORM in "${PLATFORMS[@]}"
do
per_platform_0 $PLATFORM $@
done
}