1 #include <tools/ccanlint/ccanlint.h>
2 #include <tools/tools.h>
3 #include <ccan/talloc/talloc.h>
4 #include <ccan/str/str.h>
17 static const char *can_build(struct manifest *m)
20 return "Safe mode enabled";
24 static void *check_objs_build(struct manifest *m,
25 bool keep, unsigned int *timeleft)
30 list_for_each(&m->c_files, i, list) {
32 char *fullfile = talloc_asprintf(m, "%s/%s", m->dir, i->name);
34 /* One point for each obj file. */
35 build_objs.total_score++;
37 i->compiled = maybe_temp_file(m, "", keep, fullfile);
38 err = compile_object(m, fullfile, ccan_dir, "", i->compiled);
40 talloc_free(i->compiled);
42 report = talloc_append_string(report, err);
50 static const char *describe_objs_build(struct manifest *m, void *check_result)
55 struct ccanlint build_objs = {
56 .key = "build-objects",
57 .name = "Module object files can be built",
58 .check = check_objs_build,
59 .describe = describe_objs_build,
63 REGISTER_TEST(build_objs, &depends_exist, NULL);