From ad19cecc450e3f3ac7ca9bb90116d5a4d2c1e16a Mon Sep 17 00:00:00 2001
From: Louay DARDOURI <louay.dardouri@etu.u-pec.fr>
Date: Wed, 5 Feb 2025 19:10:07 +0100
Subject: [PATCH] =?UTF-8?q?Quand=20un=20fichier=20n'est=20pas=20trouv?=
 =?UTF-8?q?=C3=A9=20dans=20une=20r=C3=A8gle,=20on=20arr=C3=AAte=20le=20pro?=
 =?UTF-8?q?gramme=20et=20affiche=20un=20message=20d'erreur.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/fr/monlouyan/bakefile/Rule.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/fr/monlouyan/bakefile/Rule.java b/src/fr/monlouyan/bakefile/Rule.java
index c15ab74..6fa61b6 100644
--- a/src/fr/monlouyan/bakefile/Rule.java
+++ b/src/fr/monlouyan/bakefile/Rule.java
@@ -104,6 +104,11 @@ public class Rule {
     
         for (String dependency : dependencies) {
             File depFile = new File(dependency);
+            if (!depFile.exists()) {
+                System.out.println("bake: *** No rule to make target '" + dependency + "', needed by '" + name + "'.  Stop.");
+                System.exit(1);
+            }
+
             if (depFile.exists() && TimestampManager.getTimestamp(depFile) > targetTimestamp) {
                 if (BakeCLI.isDebug()) {
                     System.out.println("Debug : Dependency " + dependency + " is newer than target file " + name + ", needs update");