Explicitly create output directories for flex/yacc output.

When out-of-source build with '--disable-dependency-tracking' is
performed, the 'lib/route' and 'lib/route/cls' directories required for
flex/yacc output do not exist. As a result, the flex/yacc calls fail
with ENOENT.

Create the necessary directories explicitly via $(MKDIR_P)
in the flex/yacc rules to guarantee proper out-of-source and in-source
build.
This commit is contained in:
Michał Górny 2014-05-25 11:49:19 +02:00
parent 430eb4004a
commit 4dc7246742
2 changed files with 5 additions and 4 deletions

View file

@ -69,6 +69,7 @@ AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AM_PROG_LIBTOOL
AC_PROG_MKDIR_P
AC_CHECK_PROGS(FLEX, 'flex')
AC_CHECK_PROGS(YACC, 'bison -y')

View file

@ -47,16 +47,16 @@ CLEANFILES = \
# Hack to avoid using ylwrap. It does not function correctly in combination
# with --header-file=
route/pktloc_grammar.c: route/pktloc_grammar.l
$(AM_V_GEN) $(FLEX) --header-file=route/pktloc_grammar.h $(LFLAGS) -o $@ $^
$(AM_V_GEN) $(MKDIR_P) route; $(FLEX) --header-file=route/pktloc_grammar.h $(LFLAGS) -o $@ $^
route/pktloc_syntax.c: route/pktloc_syntax.y
$(AM_V_GEN) $(YACC) -d $(YFLAGS) -o $@ $^
$(AM_V_GEN) $(MKDIR_P) route; $(YACC) -d $(YFLAGS) -o $@ $^
route/cls/ematch_grammar.c: route/cls/ematch_grammar.l
$(AM_V_GEN) $(FLEX) --header-file=route/cls/ematch_grammar.h $(LFLAGS) -o $@ $^
$(AM_V_GEN) $(MKDIR_P) route/cls; $(FLEX) --header-file=route/cls/ematch_grammar.h $(LFLAGS) -o $@ $^
route/cls/ematch_syntax.c: route/cls/ematch_syntax.y
$(AM_V_GEN) $(YACC) -d $(YFLAGS) -o $@ $^
$(AM_V_GEN) $(MKDIR_P) route/cls; $(YACC) -d $(YFLAGS) -o $@ $^
libnl_route_3_la_LIBADD = libnl-3.la
libnl_route_3_la_SOURCES = \