- /* If it has C files, we expect an object file built from them. */
- has_c_files = !list_empty(&dep_man->c_files);
- talloc_free(dep_man);
- return has_c_files;
+ list_for_each(&m->c_files, i, list) {
+ char *fullfile = talloc_asprintf(m, "%s/%s", m->dir, i->name);
+ char *output;
+
+ i->compiled = maybe_temp_file(m, "", false, fullfile);
+ if (!compile_object(m, fullfile, ccan_dir, "", i->compiled,
+ &output)) {
+ talloc_free(i->compiled);
+ i->compiled = NULL;
+ return talloc_asprintf(m,
+ "Dependency %s"
+ " did not build:\n%s",
+ m->basename, output);
+ }
+ }
+ return NULL;