[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Avoid unnecessary binary calls in makefiles



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

Attachment: pgp554BhuGsFe.pgp
Description: PGP signature