From bb1591a96ae4ff91b2cd4e87458e57791189b8fc Mon Sep 17 00:00:00 2001 From: "Gu://em_" Date: Thu, 18 Dec 2025 13:17:48 +0100 Subject: [PATCH] nothing to be done reload --- minimake/src/minimake.c | 10 +++++++++- minimake/tests/Makefile.empty | 1 + minimake/tests/Makefile.vars | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 minimake/tests/Makefile.empty create mode 100644 minimake/tests/Makefile.vars diff --git a/minimake/src/minimake.c b/minimake/src/minimake.c index 468ce23..e76e664 100644 --- a/minimake/src/minimake.c +++ b/minimake/src/minimake.c @@ -469,7 +469,8 @@ static int run_rule(struct rule *rule) // Build dependencies while (dependencies != NULL) { - // Expand variables + // Expand variable + // TODO // Check file existence if (!file_exists(dependencies->data)) @@ -492,6 +493,13 @@ static int run_rule(struct rule *rule) dependencies = dependencies->next; } + // Empty recipe + if (commands == NULL) + { + printf("%s: Nothing to be done for '%s'.\n", program_name, rule->name); + return 0; + } + while (commands != NULL) { // Expand command variables diff --git a/minimake/tests/Makefile.empty b/minimake/tests/Makefile.empty new file mode 100644 index 0000000..e9228f2 --- /dev/null +++ b/minimake/tests/Makefile.empty @@ -0,0 +1 @@ +empty_target: diff --git a/minimake/tests/Makefile.vars b/minimake/tests/Makefile.vars new file mode 100644 index 0000000..b5ce417 --- /dev/null +++ b/minimake/tests/Makefile.vars @@ -0,0 +1,4 @@ +V=2 + +main: + echo $V