(include_subdirs unqualified)

(library
 (name tuna_server)
 (libraries tuna tuna_interp tuna_compiler tuna_store tuna_deriv yojson
   httpun httpun-eio gluten-eio bigstringaf eio eio.unix eio_main unix base64))

; sabra stdlib v1 (borg/stdlib.borg): embed the frozen transcript as an
; OCaml module - the file is never read at runtime
(rule
 (target stdlib_embed.ml)
 (deps ../../stdlib/v1/core.defs ../../tools/stdprobe/embed.py)
 (action
  (with-stdout-to %{target}
   (run python3 %{workspace_root}/tools/stdprobe/embed.py
     %{workspace_root}/stdlib/v1/core.defs))))

; board chapter (borg/board.borg): embed the four .sabra program
; sources - the files are the book's artifacts, the module is generated
(rule
 (target board_embed.ml)
 (deps
  ../../scripts/dialect/board-add.sabra
  ../../scripts/dialect/board-view.sabra
  ../../scripts/dialect/board-flip.sabra
  ../../scripts/dialect/board-del.sabra
  ../../tools/stdprobe/embed_board.py)
 (action
  (with-stdout-to %{target}
   (run python3 %{workspace_root}/tools/stdprobe/embed_board.py
     %{workspace_root}))))
