X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=generator%2Fgenerator_main.ml;h=f3d3340aac3a4f2f882b214b4adbd059d8ed493a;hp=401ae6053e42627b2e4920193ec110bd1d10d40a;hb=9b60f3a9f3b38c085e9265e56ddb839dabe6e416;hpb=0003ea2c3dbaa7e22f4f616539136821d80694b8 diff --git a/generator/generator_main.ml b/generator/generator_main.ml index 401ae60..f3d3340 100644 --- a/generator/generator_main.ml +++ b/generator/generator_main.ml @@ -23,6 +23,7 @@ open Printf open Generator_pr open Generator_structs +open Generator_api_versions open Generator_c open Generator_xdr @@ -38,6 +39,7 @@ open Generator_haskell open Generator_csharp open Generator_php open Generator_bindtests +open Generator_errnostring let perror msg = function | Unix_error (err, _, _) -> @@ -48,7 +50,7 @@ let perror msg = function (* Main program. *) let () = let lock_fd = - try openfile "HACKING" [O_RDWR] 0 + try openfile "BUGS" [O_RDWR] 0 with | Unix_error (ENOENT, _, _) -> eprintf "\ @@ -58,7 +60,7 @@ Run it from the top source directory using the command "; exit 1 | exn -> - perror "open: HACKING" exn; + perror "open: BUGS" exn; exit 1 in (* Acquire a lock so parallel builds won't try to run the generator @@ -68,18 +70,23 @@ Run it from the top source directory using the command *) (try lockf lock_fd F_LOCK 1 with exn -> - perror "lock: HACKING" exn; + perror "lock: BUGS" exn; exit 1); + (* Read the API versions file. *) + load_api_versions "src/api-support/added"; + output_to "src/guestfs_protocol.x" generate_xdr; - output_to "src/guestfs-structs.h" generate_structs_h; - output_to "src/guestfs-actions.h" generate_actions_h; + output_to "src/guestfs.h" generate_guestfs_h; output_to "src/guestfs-internal-actions.h" generate_internal_actions_h; output_to "src/actions.c" generate_client_actions; output_to "src/bindtests.c" generate_bindtests; output_to "src/guestfs-structs.pod" generate_structs_pod; output_to "src/guestfs-actions.pod" generate_actions_pod; output_to "src/guestfs-availability.pod" generate_availability_pod; + output_to "src/errnostring_gperf.gperf" generate_errnostring_gperf; + output_to "src/errnostring.c" generate_errnostring_c; + output_to "src/errnostring.h" generate_errnostring_h; output_to "src/MAX_PROC_NR" generate_max_proc_nr; output_to "src/libguestfs.syms" generate_linker_script; output_to "daemon/actions.h" generate_daemon_actions_h; @@ -88,6 +95,7 @@ Run it from the top source directory using the command output_to "daemon/optgroups.c" generate_daemon_optgroups_c; output_to "daemon/optgroups.h" generate_daemon_optgroups_h; output_to "capitests/tests.c" generate_tests; + output_to "fish/cmds_gperf.gperf" generate_fish_cmds_gperf; output_to "fish/cmds.c" generate_fish_cmds; output_to "fish/completion.c" generate_fish_completion; output_to "fish/guestfish-commands.pod" generate_fish_commands_pod; @@ -124,11 +132,15 @@ Run it from the top source directory using the command output_to "php/extension/php_guestfs_php.h" generate_php_h; output_to "php/extension/guestfs_php.c" generate_php_c; + (* Generate the list of files generated -- last. *) + printf "generated %d lines of code\n" (get_lines_generated ()); + let files = List.sort compare (get_files_generated ()) in + output_to "generator/files-generated.txt" + (fun () -> List.iter (pr "%s\n") files); + (* Always generate this file last, and unconditionally. It's used * by the Makefile to know when we must re-run the generator. *) let chan = open_out "generator/stamp-generator" in fprintf chan "1\n"; - close_out chan; - - printf "generated %d lines of code\n" (get_lines_generated ()) + close_out chan