1 #include <tools/ccanlint/ccanlint.h>
2 #include <tools/tools.h>
3 #include <ccan/str/str.h>
4 #include <ccan/tal/path/path.h>
18 static const char *can_build(struct manifest *m)
21 return "Safe mode enabled";
25 void build_objects(struct manifest *m,
26 struct score *score, const char *flags,
27 enum compile_type ctype)
30 bool errors = false, warnings = false;
32 if (list_empty(&m->c_files))
37 list_for_each(&m->c_files, i, list) {
39 char *fullfile = path_join(m, m->dir, i->name);
41 i->compiled[ctype] = temp_file(m, "", fullfile);
42 if (!compile_object(score, fullfile, ccan_dir, compiler, flags,
43 i->compiled[ctype], &output)) {
44 tal_free(i->compiled[ctype]);
45 score_file_error(score, i, 0,
46 "Compiling object files:\n%s",
49 } else if (!streq(output, "")) {
50 score_file_error(score, i, 0,
51 "Compiling object files gave"
60 score->score = score->total - warnings;
64 static void check_objs_build(struct manifest *m,
65 unsigned int *timeleft, struct score *score)
67 build_objects(m, score, cflags, COMPILE_NORMAL);
70 struct ccanlint objects_build = {
71 .key = "objects_build",
72 .name = "Module object files can be built",
74 .check = check_objs_build,
76 .needs = "depends_exist"
79 REGISTER_TEST(objects_build);