[conntrack-tools 6/6] build: fix dependency-tracking of yacc-generated header

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

 



List it as a built source in order to force make to create it before
compilation.  Otherwise, a parallel make can end up attempting to
compile the output of lex before yacc has finished generating its own
output:

  $ make -j17
  [...]
  YACC     read_config_yy.c
  LEX      read_config_lex.c
  CC       stack.o
  CC       resync.o
  CC       cthelper.o
  CC       helpers.o
  CC       utils.o
  CC       expect.o
  CC       systemd.o
  CC       nfct.o
  CC       nfct-extensions/helper.o
  CC       nfct-extensions/timeout.o
  CC       read_config_lex.o
  read_config_lex.l:25:10: fatal error: read_config_yy.h: No such file or directory
  25 | #include "read_config_yy.h"
  |          ^~~~~~~~~~~~~~~~~~
  compilation terminated.
  make[2]: *** [Makefile:701: read_config_lex.o] Error 1
  make[2]: *** Waiting for unfinished jobs....
  updating read_config_yy.h
  make[2]: Leaving directory '/space/azazel/work/git/netfilter/conntrack-tools/src'
  make[1]: *** [Makefile:743: all-recursive] Error 1
  make[1]: Leaving directory '/space/azazel/work/git/netfilter/conntrack-tools/src'
  make: *** [Makefile:541: all-recursive] Error 1

Signed-off-by: Jeremy Sowden <jeremy@xxxxxxxxxx>
---
 src/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/Makefile.am b/src/Makefile.am
index 85ea18888e97..1f234749d35d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,6 +6,7 @@ endif
 
 AM_YFLAGS = -d
 
+BUILT_SOURCES = read_config_yy.h
 MAINTAINERCLEANFILES = read_config_yy.c read_config_yy.h read_config_lex.c
 
 sbin_PROGRAMS = conntrack conntrackd nfct
-- 
2.33.0




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux