]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/compulsory_tests/build.c
ccanlint: use familiar names for temporary files, show them with -vv.
[ccan] / tools / ccanlint / compulsory_tests / build.c
index 1b3d878928b53ca738fba2c13b2f2f394a508d19..c78e500b238f4e0953e7084f46a36deba03c0f44 100644 (file)
@@ -33,7 +33,9 @@ static char *obj_list(const struct manifest *m)
        return list;
 }
 
-static void *do_build(struct manifest *m)
+static void *do_build(struct manifest *m,
+                     bool keep,
+                     unsigned int *timeleft)
 {
        char *filename, *err;
 
@@ -42,11 +44,11 @@ static void *do_build(struct manifest *m)
                build.total_score = 0;
                return NULL;
        }
-       filename = link_objects(m, obj_list(m), &err);
-       if (filename) {
-               char *realname = talloc_asprintf(m, "../%s.o", m->basename);
+       filename = link_objects(m, m->basename, false, obj_list(m), &err);
+       if (filename && keep) {
+               char *realname = talloc_asprintf(m, "%s.o", m->dir);
                /* We leave this object file around, all built. */
-               if (rename(filename, realname) != 0)
+               if (!move_file(filename, realname))
                        return talloc_asprintf(m, "Failed to rename %s to %s",
                                               filename, realname);
                return NULL;
@@ -62,7 +64,8 @@ static const char *describe_build(struct manifest *m, void *check_result)
 }
 
 struct ccanlint build = {
-       .name = "Module can be built",
+       .key = "build",
+       .name = "Module can be built from object files",
        .total_score = 1,
        .check = do_build,
        .describe = describe_build,