automake
[Top][All Lists]
Advanced

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

Re: Parallel build sometimes resulting in "fatal error: config.h: No suc


From: Nick Bowler
Subject: Re: Parallel build sometimes resulting in "fatal error: config.h: No such file or directory"
Date: Mon, 16 Oct 2017 16:19:34 -0400

Hi Simon,

On 10/16/17, Simon Sobisch <address@hidden> wrote:
[...]
> Running without `make -j` always work but using parallel builds sometime
> break with the mentioned error.
[...]
> ~~~
> gcc -O2 -pipe -finline-functions -fsigned-char -Wall -Wwrite-strings
> -Wmissing-prototypes -Wno-format-y2k -U_FORTIFY_SOURCE
> -Wl,-z,relro,-z,now,-O1  /home/simon/gnucobol/cobc/../cobc/cobc.c   -o
> ../cobc/cobc
> /home/simon/gnucobol/cobc/../cobc/cobc.c:26:10: fatal error: config.h:
> No such file or directory
>  #include "config.h"
>           ^~~~~~~~~~
> compilation terminated.

I took a quick look at your project.  The problem is likely this bit
from cobc/Makefile.am:

  COBC = $(top_builddir)/cobc/cobc$(EXEEXT)

  cobc.1: [...] $(COBC)

The problem is that this COBC macro does not match the Automake generated
target name.  When it gets pulled in as a prerequisite for cobc.1 and the
file does not already exist, the built-in GNU make rule applies, which
produces cobc from cobc.c.

This is the wrong rule, so the compilation fails.

The prerequisites in make rules typically should match the target names
exactly.  In this case, it should be:

  cobc.1: [...] cobc$(EXEEXT)

Hope that helps,
  Nick



reply via email to

[Prev in Thread] Current Thread [Next in Thread]