X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fdepends.c;h=c9cf88164cd81e37b4981e1e7da1f5a51756609d;hp=2bf11415bd2e632290fa1e63a4efd3bd13add985;hb=bcf7916c5d694858766869dfd570e525127154a6;hpb=09e4858bdbd026244ab250ef11d82a2189d46e49 diff --git a/tools/depends.c b/tools/depends.c index 2bf11415..c9cf8816 100644 --- a/tools/depends.c +++ b/tools/depends.c @@ -39,8 +39,8 @@ static int unlink_info(char *infofile) /* Be careful about trying to compile over running programs (parallel make) */ static char *compile_info(const void *ctx, const char *dir) { - char *infofile = talloc_asprintf(ctx, "%s/_info.%u", dir, getpid()); - char *cmd = talloc_asprintf(ctx, "cc " CFLAGS " -o %s %s/_info.c", + char *infofile = talloc_asprintf(ctx, "%s/info.%u", dir, getpid()); + char *cmd = talloc_asprintf(ctx, "cc " CFLAGS " -o %s -x c %s/_info", infofile, dir); talloc_set_destructor(infofile, unlink_info); if (system(cmd) != 0) @@ -98,7 +98,7 @@ static char **get_one_safe_deps(const void *ctx, char **deps, **lines, *raw, *fname; unsigned int i, n = 0; - fname = talloc_asprintf(ctx, "%s/_info.c", dir); + fname = talloc_asprintf(ctx, "%s/_info", dir); raw = grab_file(fname, fname, NULL); if (!raw) errx(1, "Could not open %s", fname);