val mk_filename (modul ext: string) : Tot string
let mk_filename
  (modul: string)
  (ext: string)
: Tot string
= output_dir `OS.concat` (Printf.sprintf "%s.%s" modul ext)
val mk_filename (modul ext: string) : Tot string
let mk_filename (modul ext: string) : Tot string =
output_dir `OS.concat` (Printf.sprintf "%s.%s" modul ext)
GenMakefile.fst.checked
prims.fst.checked OS.fsti.checked Options.fsti.checked HashingOptions.fst.checked FStar.String.fsti.checked FStar.Printf.fst.checked FStar.Pervasives.Native.fst.checked FStar.Pervasives.fsti.checked FStar.List.Tot.fst.checked FStar.List.fst.checked FStar.IO.fst.checked FStar.All.fst.checked Deps.fsti.checked
GenMakefile.fst
Prims.string OS.concat GenMakefile.output_dir FStar.Printf.sprintf
module GenMakefile
module OS = OS

type rule_type =
  | EverParse
  | CC
  | Nop (* to simulate multiple-target rules *)

type rule_t = {
  ty: rule_type;
  from: list string;
  to: string;
  args: string;
}

let input_dir = "$(EVERPARSE_INPUT_DIR)"
let output_dir = "$(EVERPARSE_OUTPUT_DIR)"

let print_gnu_make_rule
  input_stream_binding
  (r: rule_t)
: Tot string
= 
  let rule = Printf.sprintf "%s : %s\n" r.to (String.concat " " r.from) in
  match r.ty with
  | Nop -> Printf.sprintf "%s\n" rule
  | _ ->
    let cmd =
      match r.ty with
      | EverParse -> Printf.sprintf "$(EVERPARSE_CMD) --odir %s" output_dir
      | CC ->
        let ddd_home = "$(EVERPARSE_HOME)" `OS.concat` "src" `OS.concat` "3d" in
        let ddd_actions_home = ddd_home `OS.concat` "prelude" `OS.concat` (HashingOptions.string_of_input_stream_binding input_stream_binding) in
        Printf.sprintf "$(CC) $(CFLAGS) -I %s -I %s -c" ddd_home ddd_actions_home
    in
    let rule = Printf.sprintf "%s\t%s %s\n\n" rule cmd r.args in
    rule

let mk_input_filename
  (file: string)
: Tot string
= input_dir `OS.concat` OS.basename file

let mk_filename
  (modul: string)
  (ext: string)
val mk_filename (modul ext: string) : Tot string
modul: Prims.string -> ext: Prims.string -> Prims.string