Skip to content

Make failed when building out-of-source #3371

@gyatpear

Description

@gyatpear

Describe the bug

Make failed building out-of-source, because of the disabling rebuilding src/lexer.c and src/parser.c.

To Reproduce

Do this:

git submodule update --init
autoreconf -i
mkdir build
cd build
../configure --with-oniguruma=builtin
make

And get the error message:

  YACC     src/lexer.c
NOT building lexer.c!
  CC       src/lexer.lo
cc: error: no such file or directory: 'src/lexer.c'
cc: error: no input file

This is because the implicit rules of GNU Make. The existence of $(srcdir)/src/lexer.l will disable the VPATH $(srcdir)/src/lexer.c to be the input file for src/lexer.o. So as src/parser.c.

However, if configure without maintainer-mode enabled, Makefile.am has a rule to disable %.l: %.c and %.y: %.c generation.

And if you are not building out-of-source, src/lexer.c and src/parser.c should be fine as input, instead of VPATH $(srcdir)/src/lexer.c and $(srcdir)/src/parser.c.

Expected behavior

jq to be built.

Environment (please complete the following information):

  • OS and Version: Ubuntu 24.04.1 LTS
  • jq version: jq-1.8.1 (git tag)
  • GNU Make: 4.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions