linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Kyle Russell <bkylerussell@gmail.com>
Cc: linux-sparse@vger.kernel.org
Subject: Re: [PATCH] Makefile: add version.h dependency on all objects
Date: Wed, 27 Jan 2021 21:47:45 +0100	[thread overview]
Message-ID: <20210127204745.2k7a3x4djm6mwfwg@mail> (raw)
In-Reply-To: <20210127165856.2090337-1-bkylerussell@gmail.com>

On Wed, Jan 27, 2021 at 11:58:56AM -0500, Kyle Russell wrote:
> This guarantees the generated version.h will exist before attempting
> to compile any c files that include it.
> 
> Several source files include the generated version.h, but not all
> declare a proper make dependency.
> 
> $ grep -r 'version\.h' *.c
> compile-i386.c:#include "version.h"
> lib.c:#include "version.h"
> options.c:#include "version.h"
> 
> This allows a sufficiently parallelized make invocation to encounter
> ENOENT.
> 
>   CC      compile-i386.o
> compile-i386.c:60:21: fatal error: version.h: No such file or directory
> compilation terminated.
> Makefile:253: recipe for target 'compile-i386.o' failed
> make: *** [compile-i386.o] Error 1


Mmmm, yes. I never see this because I always use a plain 'make -j'.
Thanks.

> @@ -249,7 +249,7 @@ libsparse.a: $(LIB_OBJS)
>  cflags   += $($(*)-cflags) $(CPPFLAGS) $(CFLAGS)
> -%.o: %.c
> +%.o: %.c version.h

This is annoying because now all files need to be rebuild at every changes.
I've modified the patch so that single new file (version.c) includes and
depends on the generated file.

Best regards,
-- Luc

      reply	other threads:[~2021-01-27 20:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27 16:58 [PATCH] Makefile: add version.h dependency on all objects Kyle Russell
2021-01-27 20:47 ` Luc Van Oostenryck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210127204745.2k7a3x4djm6mwfwg@mail \
    --to=luc.vanoostenryck@gmail.com \
    --cc=bkylerussell@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).