]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commit
packages: use backtick instead of $(shell ...) make function
authorArnout Vandecappelle <arnout@mind.be>
Sun, 12 Jul 2015 14:35:26 +0000 (16:35 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 14 Jul 2015 22:42:01 +0000 (00:42 +0200)
commit7d69a79624b1f338950cd6cc650e029dd4d4b91a
tree14699419f86c579e0e285fd9a09c60220754012a
parentb4857df721ae0f01892323b9b744ab3950ce2e4d
packages: use backtick instead of $(shell ...) make function

It is often difficult to know exactly when make will expand the
variable, and usually it can only be expanded after the dependencies
have been built (e.g. pkg-config or the .pc file). Using a backtick
instead makes it very clear that it will be expanded only while
executing the command.

This change is useful for two cases:

1. The per-package staging (and host) directory will be created as part
   of the configure step, so any $(shell ...) variable that is used in
   the configure step will fail because the directory doesn't exist
   yet.

2. 'make printvars' evaluates the variables it prints. It will therefore
   trigger a lot of errors from missing .pc files and others. The
   backticks, on the other hand, are not expanded, so with this change
   the output of 'make printvars' becomes clean again.

This commit contains only the easy changes: replace $(shell ...) with
`...`, and also replace ' with " where needed. Follow-up commits will
tackle the more complicated cases that need additional explanation.

After this change, the following instances of $(shell ...) will remain:

- All assignments that use :=
- All variables that are used in make conditionals (which don't expand
  the backticks).
- All variables that only refer to system executables and make
  variables that don't change.
- The calls to check-host-* in dependencies.mk, because it is eval'ed.

[Original patch by Fabio Porcedda, but extended quite a bit by Arnout.]

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
37 files changed:
package/aiccu/aiccu.mk
package/aircrack-ng/aircrack-ng.mk
package/bustle/bustle.mk
package/dbus-python/dbus-python.mk
package/dhcpdump/dhcpdump.mk
package/ejabberd/ejabberd.mk
package/fbv/fbv.mk
package/gdk-pixbuf/gdk-pixbuf.mk
package/gstreamer1/gst1-plugins-bad/gst1-plugins-bad.mk
package/iftop/iftop.mk
package/knock/knock.mk
package/kodi/kodi.mk
package/libgtk3/libgtk3.mk
package/libmicrohttpd/libmicrohttpd.mk
package/libssh2/libssh2.mk
package/libupnpp/libupnpp.mk
package/lmbench/lmbench.mk
package/logrotate/logrotate.mk
package/madplay/madplay.mk
package/mpg123/mpg123.mk
package/neardal/neardal.mk
package/ngrep/ngrep.mk
package/nmap/nmap.mk
package/openldap/openldap.mk
package/php/php.mk
package/poppler/poppler.mk
package/prboom/prboom.mk
package/ptpd2/ptpd2.mk
package/python-gobject/python-gobject.mk
package/python-pygame/python-pygame.mk
package/qt/qt.mk
package/tcpdump/tcpdump.mk
package/tcpreplay/tcpreplay.mk
package/ti-utils/ti-utils.mk
package/upmpdcli/upmpdcli.mk
package/vsftpd/vsftpd.mk
package/xl2tp/xl2tp.mk