Commit Diff


commit - 1720ffe97622373f305bfcd37e70e962cfc144d6
commit + 40b4876dd728158b79f8b002219de14892aa3b70
blob - 6e16cf1d9ccb5daffff8a8db8ef20b37da795a47
blob + d02eee373ce06404816f13be595fe14f7c7a4a8a
--- make/make.c
+++ make/make.c
@@ -2595,8 +2595,11 @@ struct path *prefix;
 		}
 
 		if (!needs_update) {
-			/* TODO: try searching for the artifact */
-			build_init (out, time_zero, NULL, 0);
+			if (name != NULL && get_mtime (&ft, sc, prefix, name) == 0) {
+				build_init (out, ft.t, NULL, ft.obj);
+			} else {
+				build_init (out, time_zero, NULL, 0);
+			}
 			return 0;
 		}
 
@@ -2632,9 +2635,12 @@ struct path *prefix;
 			}
 		}
 
-		/* TODO: try searching for the artifact */
-		build_init (out, now (), NULL, 0);
-		free (new_prefix);
+		free (new_prefix);
+		if (name != NULL && get_mtime (&ft, sc, prefix, name) == 0) {
+			build_init (out, ft.t, NULL, ft.obj);
+		} else {
+			build_init (out, now (), NULL, 0);
+		}
 		return 0;
 	}