Reflected support for phony script targets when installing as well

This commit is contained in:
Pierre Pronchery 2014-12-13 02:46:21 +01:00
parent 58acf2ed3a
commit 17d5fb9d81
3 changed files with 8 additions and 2 deletions

View File

@ -2124,14 +2124,17 @@ static void _install_target_script(Configure * configure, FILE * fp,
{
String const * path;
String const * script;
int phony;
if((path = config_get(configure->config, target, "install")) == NULL)
return;
if((script = config_get(configure->config, target, "script")) == NULL)
return;
fprintf(fp, "\t%s%s%s%s%s%s", script, " -P \"$(DESTDIR)",
phony = _makefile_is_phony(configure, target);
fprintf(fp, "\t%s%s%s%s%s%s%s", script, " -P \"$(DESTDIR)",
(path[0] != '\0') ? path : "$(PREFIX)",
"\" -i -- \"$(OBJDIR)", target, "\"\n");
"\" -i -- \"", phony ? "" : "$(OBJDIR)", target,
"\"\n");
}
static int _install_include(Config * config, FILE * fp, String const * include);

View File

@ -26,8 +26,10 @@ distclean: clean
install: $(TARGETS)
./script.sh -P "$(DESTDIR)/somewhere/else/again" -i -- "$(OBJDIR)test"
./script.sh -P "$(DESTDIR)$(PREFIX)" -i -- "phony"
uninstall:
./script.sh -P "$(DESTDIR)/somewhere/else/again" -u -- "test"
./script.sh -P "$(DESTDIR)$(PREFIX)" -u -- "phony"
.PHONY: all clean distclean install uninstall phony

View File

@ -11,3 +11,4 @@ install=/somewhere/else/again
type=script
script=./script.sh
phony=1
install=