From: Heiko Stuebner <heiko@sntech.de>
Subject: [PATCH] Enable out of tree build

This also includes a backported gen-tags.sh to fix
build-failures.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>

---
 doc/Makefile.am |    6 +++---
 doc/gen-tags.sh |   10 ++--------
 lib/Makefile.am |    4 ++++
 3 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/doc/Makefile.am b/doc/Makefile.am
index 9b964b5..e60fed7 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -79,16 +79,16 @@ EXTRA_DIST = \
 	images/icons/callouts/15.png
 
 %.html: %.txt
-	./resolve-asciidoc-refs.py $< > asciidoc.tmp
+	../../../../doc/resolve-asciidoc-refs.py $< > asciidoc.tmp
 	asciidoc $(ASCIIDOCOPTS) -o $@ asciidoc.tmp
-	./doxygen-link.py libnl.dict $@ > asciidoc.tmp
+	../../../../doc/doxygen-link.py libnl.dict $@ > asciidoc.tmp
 	mv asciidoc.tmp $@
 
 asciidoc: core.html route.html index.html
 
 api_ref:
 	doxygen Doxyfile;
-	./gen-tags.sh | ./tags2dict.sh > libnl.dict
+	../../../../doc/gen-tags.sh > libnl.dict
 
 gendoc:
 	$(MAKE) api_ref
diff --git a/doc/gen-tags.sh b/doc/gen-tags.sh
index aba6672..862ec09 100755
--- a/doc/gen-tags.sh
+++ b/doc/gen-tags.sh
@@ -5,16 +5,10 @@
 # written by Carsten Haitzler <ras...@rasterman.com>
 #
 
-echo '<libnltags>'
 for f in api/group__*.html
 do
 	bf=$(basename $f)
 
-	grep -oE '<!-- doxytag.* -->' $f |
-		sed 's/<!-- doxytag:/<libnltag/' |
-		sed "s/-->/file=\"$bf\" \/>/" |
-		sed "s/ ref=\"/ href=\"$bf#/" |
-		sed 's/ member="\([^:]*::\)\([^"]*\)"/ member="\2"/' |
-		sed 's/ member="\([^"]*\)"/ short="\1"/'
+	grep -oE "href=\"$bf#[a-z0-9]+\">[^<]+</a>" $f |
+		sed 's/href="\([^"]*\)">\([^<]*\)<\/a>/\2=api\/\1/'
 done
-echo '</libnltags>'
diff --git a/lib/Makefile.am b/lib/Makefile.am
index c2668ef..e37d77e 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -39,15 +39,19 @@ 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) install -d route/
 	$(AM_V_GEN) $(LEX) --header-file=route/pktloc_grammar.h $(LFLAGS) -o $@ $^
 
 route/pktloc_syntax.c: route/pktloc_syntax.y
+	$(AM_V_GEN) install -d route/
 	$(AM_V_GEN) $(YACC) -d $(YFLAGS) -o $@ $^
 
 route/cls/ematch_grammar.c: route/cls/ematch_grammar.l
+	$(AM_V_GEN) install -d route/cls/
 	$(AM_V_GEN) $(LEX) --header-file=route/cls/ematch_grammar.h $(LFLAGS) -o $@ $^
 
 route/cls/ematch_syntax.c: route/cls/ematch_syntax.y
+	$(AM_V_GEN) install -d route/cls/
 	$(AM_V_GEN) $(YACC) -d $(YFLAGS) -o $@ $^
 
 libnl_route_3_la_LIBADD  = libnl-3.la
-- 
tg: (782035e..) debian/out-of-tree (depends on: upstream-dist)
