(executable
 (public_name permap)
 (modules
  newthread_page
  thread_page
  babillard
  babillard_page
  plants_page
  db
  app
  content
  db
  login
  permap
  register
  template
  user
  user_profile)
 (libraries
  uuidm
  caqti.blocking
  caqti-driver-sqlite3
  bos
  directories
  dream
  emile
  omd
  safepass
  lambdasoup)
 (preprocess
  (pps lwt_ppx)))

(executable
 (name js_plant_map)
 (modules js_plant_map)
 (libraries js_of_ocaml brr)
 (modes js)
 (js_of_ocaml
  (javascript_files leaflet/leaflet.js))
 (preprocess
  (pps js_of_ocaml-ppx)))

(executable
 (name js_babillard)
 (modules js_babillard)
 (libraries js_of_ocaml brr)
 (modes js)
 (js_of_ocaml
  (javascript_files leaflet/leaflet.js))
 (preprocess
  (pps js_of_ocaml-ppx)))

(executable
 (name js_newthread)
 (modules js_newthread)
 (libraries js_of_ocaml brr)
 (modes js)
 (js_of_ocaml
  (javascript_files leaflet/leaflet.js))
 (preprocess
  (pps js_of_ocaml-ppx)))

(executable
 (name js_thread)
 (modules js_thread)
 (libraries js_of_ocaml brr)
 (modes js)
 (js_of_ocaml
  (javascript_files leaflet/leaflet.js))
 (preprocess
  (pps js_of_ocaml-ppx)))

(rule
 (targets template.ml)
 (deps template.eml.html)
 (action
  (run dream_eml %{deps} --workspace %{workspace_root})))

(rule
 (targets login.ml)
 (deps login.eml.html)
 (action
  (run dream_eml %{deps} --workspace %{workspace_root})))

(rule
 (targets register.ml)
 (deps register.eml.html)
 (action
  (run dream_eml %{deps} --workspace %{workspace_root})))

(rule
 (targets babillard_page.ml)
 (deps babillard_page.eml.html)
 (action
  (run dream_eml %{deps} --workspace %{workspace_root})))

(rule
 (targets thread_page.ml)
 (deps thread_page.eml.html)
 (action
  (run dream_eml %{deps} --workspace %{workspace_root})))

(rule
 (targets newthread_page.ml)
 (deps newthread_page.eml.html)
 (action
  (run dream_eml %{deps} --workspace %{workspace_root})))

(rule
 (targets plants_page.ml)
 (deps plants_page.eml.html)
 (action
  (run dream_eml %{deps} --workspace %{workspace_root})))

(rule
 (targets user_profile.ml)
 (deps user_profile.eml.html)
 (action
  (run dream_eml %{deps} --workspace %{workspace_root})))

(rule
 (target content.ml)
 (deps
  (source_tree content)
  (file content/assets/js/js_plant_map.js)
  (file content/assets/js/js_babillard.js)
  (file content/assets/js/js_newthread.js)
  (file content/assets/js/js_thread.js))
 (action
  (with-stdout-to
   %{null}
   (run ocaml-crunch -m plain content -o %{target}))))
