Do not output $(OBJDIR) when cleaning phony targets

This commit is contained in:
Pierre Pronchery 2018-03-08 01:14:15 +01:00
parent cd8c77733f
commit f4617b7615

View File

@ -1821,6 +1821,7 @@ static int _clean_targets(Makefile * makefile)
String * q; String * q;
size_t i; size_t i;
char c; char c;
int phony;
if((p = _makefile_get_config(makefile, NULL, "targets")) == NULL) if((p = _makefile_get_config(makefile, NULL, "targets")) == NULL)
return 0; return 0;
@ -1859,9 +1860,11 @@ static int _clean_targets(Makefile * makefile)
if((prefix = _makefile_get_config(makefile, targets, if((prefix = _makefile_get_config(makefile, targets,
"prefix")) == NULL) "prefix")) == NULL)
prefix = "$(PREFIX)"; prefix = "$(PREFIX)";
_makefile_print(makefile, "\t%s%s%s%s%s%s\n", p, phony = _makefile_is_phony(makefile, targets);
" -c -P \"", prefix, _makefile_print(makefile, "\t%s%s%s%s%s%s%s\n", p,
"\" -- \"$(OBJDIR)", targets, "\""); " -c -P \"", prefix, "\" -- \"",
phony ? "" : "$(OBJDIR)", targets,
"\"");
} }
if(c == '\0') if(c == '\0')
break; break;