From 4dc72467425dbc063c30a871350a896b225ff224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sun, 25 May 2014 11:49:19 +0200 Subject: [PATCH] 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. --- configure.ac | 1 + lib/Makefile.am | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index bbe4e29..879aea5 100644 --- a/configure.ac +++ b/configure.ac @@ -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') diff --git a/lib/Makefile.am b/lib/Makefile.am index b2d142c..1aae6fe 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -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 = \