From f4617b7615575cab8dc459c21ea2d75bfa50a1a4 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Thu, 8 Mar 2018 01:14:15 +0100 Subject: [PATCH] Do not output $(OBJDIR) when cleaning phony targets --- src/makefile.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/makefile.c b/src/makefile.c index aca5113..4e21fab 100644 --- a/src/makefile.c +++ b/src/makefile.c @@ -1821,6 +1821,7 @@ static int _clean_targets(Makefile * makefile) String * q; size_t i; char c; + int phony; if((p = _makefile_get_config(makefile, NULL, "targets")) == NULL) return 0; @@ -1859,9 +1860,11 @@ static int _clean_targets(Makefile * makefile) if((prefix = _makefile_get_config(makefile, targets, "prefix")) == NULL) prefix = "$(PREFIX)"; - _makefile_print(makefile, "\t%s%s%s%s%s%s\n", p, - " -c -P \"", prefix, - "\" -- \"$(OBJDIR)", targets, "\""); + phony = _makefile_is_phony(makefile, targets); + _makefile_print(makefile, "\t%s%s%s%s%s%s%s\n", p, + " -c -P \"", prefix, "\" -- \"", + phony ? "" : "$(OBJDIR)", targets, + "\""); } if(c == '\0') break;