[PATCH libX11] Don't rebuild ks_tables.h if nothing changed.

Matthieu Herrb matthieu at herrb.eu
Sat Oct 8 21:45:50 UTC 2016


On Sat, Oct 08, 2016 at 11:22:45PM +0200, Martin Natano wrote:
> On Sat, Oct 08, 2016 at 09:45:09PM +0200, Matthieu Herrb wrote:
> > 
> > It looks good to me. 2 little things though:
> > 
> > - you should use 'git commit -s' to generate a Signed-off-by: field in
> >   the commit message
> 
> See the updated diff below.
> 
> 
> > 
> > - the reason why this patch is needed is a limitation of BSD make
> >   GNU make doesn't trigger the extra rebuild during make install.
> > 
> > PS: I tend to consider the BSD make behaviour as a bug, but no one ever
> > cared to fix it :(
> 
> Curious, What's the bug? The force target is not marked phony, so it's
> always out-of-date due to the eponymous file not existing. Then force
> out-of-date -> rebuild makekeys, makekeys newer than ks_tables.h ->
> rebuild ks_tables.h. What should the behaviour be instead?

Unless I'm wrong 'force' will force make to recurse in utils/ but if
makekeys is up-to-date, it won't be rebuilt the 2nd time, its
timestamp doesn't change, and so ks_tables.h should not be rebuilt.

I had a small test case for that behaviour somewhere... 

> 
> natano
> 
> 
> From 75d5e9b763069310cb2b0d0bac2a49175029449a Mon Sep 17 00:00:00 2001
> From: Martin Natano <natano at natano.net>
> Date: Sat, 8 Oct 2016 19:57:50 +0200
> Subject: [PATCH] Don't rebuild ks_tables.h if nothing changed.
> 
> ks_tables.h is always considered out of date due to the forced rebuild
> of the makekeys util. This means the file is also rebuilt during 'make
> install', which is usually performed as root, which can to lead
> permission problems later on.
> 
> Signed-off-by: Martin Natano <natano at natano.net>
> ---
>  src/Makefile.am | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 15de59b..f8c476d 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -415,7 +415,5 @@ ks_tables.h: $(KEYSYMDEFS) $(top_builddir)/src/util/makekeys$(EXEEXT)
>  	$(top_builddir)/src/util/makekeys $(KEYSYMDEFS) > ks_tables_h
>  	mv ks_tables_h $@
>  
> -$(top_builddir)/src/util/makekeys$(EXEEXT): force
> +$(top_builddir)/src/util/makekeys$(EXEEXT): $(top_builddir)/src/util/makekeys.c
>  	cd util && $(MAKE)
> -
> -force:
> -- 
> 2.9.3

-- 
Matthieu Herrb
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 793 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20161008/c232d78b/attachment.sig>


More information about the xorg-devel mailing list