- /* We may need libtap for testing, unless we're "tap" */
- if (!streq(m->basename, "tap")
- && (!list_empty(&m->run_tests) || !list_empty(&m->api_tests))) {
- char *tapobj = talloc_asprintf(m, "%s/ccan/tap.o", ccan_dir);
- if (stat(tapobj, &st) != 0) {
- report = talloc_asprintf_append(report,
- "object file %s"
- " (for tests)\n",
- tapobj);
+ 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);