[PATCH] Avoid unnecessary binary calls in makefiles

Thorsten Wißmann edu at thorsten-wissmann.de
Tue Feb 4 18:22:01 CET 2014


On Wed, Jan 08, 2014 at 06:00:31PM +0100, Florian Bruhin wrote:
> This avoids calling binaries from the Makefile more often than they
> need to.
> 
> before:
> 
> $ make clean > /dev/null; strace -f make 2>&1 | grep -c 'execve(.* = 0'
> 558
> 
> after:
> 
> $ make clean > /dev/null; strace -f make 2>&1 | grep -c 'execve(.* = 0'
> 153

Is this really of relevance?

-INCS = -Isrc/ -I/usr/include -I${X11INC}  `pkg-config --cflags glib-2.0`
-LIBS = -lc -L${X11LIB} -lXext -lX11 $(XINERAMALIBS) `pkg-config --libs glib-2.0`
+INCS := -Isrc/ -I/usr/include -I${X11INC} $(shell pkg-config --cflags glib-2.0)
+LIBS := -lc -L${X11LIB} -lXext -lX11 $(XINERAMALIBS) $(shell pkg-config --libs glib-2.0)

IMO the first one looks more compact and more make'ish, as everything
with parenthesis $(...) is GNU Make only. Our makefile is gnu make only,
anyway, but is it such important for you? I mean it only affects build
performance and is not run regularly.

Cheers,
Thorsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 230 bytes
Desc: not available
URL: <https://listi.jpberlin.de/pipermail/hlwm/attachments/20140204/5182c760/attachment.sig>


More information about the hlwm mailing list