]> git.ozlabs.org Git - ccan/blobdiff - tools/ccan_depends.c
Use -O not -O3: reduces ccan/tdb test time from 24 to 18 seconds.
[ccan] / tools / ccan_depends.c
index 0c46173f06a7987a72e6f5b376d2e96d7269b89e..1baff828c267899364bd06ee0500fb1ab875d45c 100644 (file)
@@ -12,6 +12,7 @@ int main(int argc, char *argv[])
        bool compile = false;
        bool recurse = true;
        bool ccan = true;
+       char *dirname, *basename;
 
        if (argv[1] && streq(argv[1], "--direct")) {
                argv++;
@@ -36,11 +37,15 @@ int main(int argc, char *argv[])
        if (!ccan && !compile)
                errx(1, "--non-ccan needs --compile");
 
+       dirname = talloc_dirname(NULL, argv[1]);
+       basename = talloc_basename(NULL, argv[1]);
+
        if (compile)
-               deps = get_deps(talloc_autofree_context(), argv[1], recurse);
+               deps = get_deps(talloc_autofree_context(),
+                               dirname, basename, recurse);
        else
-               deps = get_safe_ccan_deps(talloc_autofree_context(), argv[1],
-                                         recurse);
+               deps = get_safe_ccan_deps(talloc_autofree_context(),
+                                         dirname, basename, recurse);
 
        for (i = 0; deps[i]; i++)
                if (strstarts(deps[i], "ccan/") == ccan)