Re: [PATCH 08/13] Makefile: introduce sq function for shell-quoting
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 5, 2014, 19:12 UTC
- Message-ID
- <xmqqr47h4bn2.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20140205175741.GH15218@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> Since we have recently abolished the prohibition on $(call) > in our Makefile, we can use it to factor out the repeated > shell-quoting we do. There are two upsides: > > 1. It is much more readable than inline calls to > $(subst ','\''). > > 2. It is short enough that we can do away with the _SQ > variants of many variables (note that we do not do this > just yet, as there is a little more cleanup needed > first).
Yay.
Show 8 quoted lines
> .... But > many instances are not really any more readable (e.g., see the first > hunk below). > ... > .PHONY: install-perl-script install-sh-script install-python-script > install-sh-script: $(SCRIPT_SH_INS) > - $(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' > + $(INSTALL) $^ $(call sq,$(DESTDIR)$(gitexec_instdir))
Hmph, I do not see it as bad as the "make-var", which forces you to say $(eval $(call ...)); this $(call sq, ...) is fairly readable.