From 03ab0ab04f00278a2c8e2b715f9e0842873d4107 Mon Sep 17 00:00:00 2001
From: Moncef STITI <moncef.stiti@etu.u-pec.fr>
Date: Sun, 16 Mar 2025 13:38:35 +0100
Subject: [PATCH] Correction de bug #1

---
 src/fr/monlouyan/bakefile/DependencyResolver.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/fr/monlouyan/bakefile/DependencyResolver.java b/src/fr/monlouyan/bakefile/DependencyResolver.java
index b2574b4..e6f51ed 100644
--- a/src/fr/monlouyan/bakefile/DependencyResolver.java
+++ b/src/fr/monlouyan/bakefile/DependencyResolver.java
@@ -56,8 +56,12 @@ public class DependencyResolver {
         for (String ruleName : targetRules) {
             if (ruleMap.containsKey(ruleName)) {
                 detectCycle(ruleName, visited, stack, ruleName);
-            } else if (debug) {
-                System.out.println("Warning: Rule '" + ruleName + "' not found.");
+            } else {
+				if (debug) {
+					System.out.println("Warning: Rule '" + ruleName + "' not found.");
+				}
+				System.out.println("bake: *** No rule to make target '" + ruleName + "'. Stop.");
+				System.exit(2);
             }
         }