From: Todd C. Miller Date: Thu, 8 Dec 2011 18:41:35 +0000 (-0500) Subject: If srcdir is "." just use the basename of the yacc/lex file when X-Git-Tag: SUDO_1_8_4~106^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=27616d1f3edc3adc62925bc7307bc09577616f08;p=sudo If srcdir is "." just use the basename of the yacc/lex file when generating the C version. This matches the generated files currently in the repo. --- diff --git a/plugins/sudoers/Makefile.in b/plugins/sudoers/Makefile.in index fa92d78ae..7438586a8 100644 --- a/plugins/sudoers/Makefile.in +++ b/plugins/sudoers/Makefile.in @@ -193,13 +193,23 @@ GENERATED = gram.h gram.c toke.c def_data.c def_data.h getdate.c $(devdir)/gram.c $(devdir)/gram.h: $(srcdir)/gram.y @if [ -n "$(DEVEL)" ]; then \ - cmd='$(YACC) -d $(srcdir)/gram.y; echo "#include " > $(devdir)/gram.c; cat y.tab.c >> $(devdir)/gram.c; rm -f y.tab.c; mv -f y.tab.h $(devdir)/gram.h'; \ + if test "$(srcdir)" = "."; then \ + gram_y="gram.y"; \ + else \ + gram_y="$(srcdir)/gram.y"; \ + fi; \ + cmd='$(YACC) -d '"$$gram_y"'; echo "#include " > $(devdir)/gram.c; cat y.tab.c >> $(devdir)/gram.c; rm -f y.tab.c; mv -f y.tab.h $(devdir)/gram.h'; \ echo "$$cmd"; eval $$cmd; \ fi $(devdir)/toke.c: $(srcdir)/toke.l @if [ -n "$(DEVEL)" ]; then \ - cmd='$(FLEX) $(srcdir)/toke.l; echo "#include " > $(devdir)/toke.c; cat lex.yy.c >> $(devdir)/toke.c'; \ + if test "$(srcdir)" = "."; then \ + toke_l="toke.l"; \ + else \ + toke_l="$(srcdir)/toke.l"; \ + fi; \ + cmd='$(FLEX) '"$$toke_l"'; echo "#include " > $(devdir)/toke.c; cat lex.yy.c >> $(devdir)/toke.c'; \ echo "$$cmd"; eval $$cmd; \ fi @@ -207,7 +217,12 @@ $(devdir)/toke.c: $(srcdir)/toke.l $(devdir)/getdate.c: $(srcdir)/getdate.y @if [ -n "$(DEVEL)" ]; then \ echo "expect 10 shift/reduce conflicts"; \ - cmd='$(YACC) $(srcdir)/getdate.y; echo "#include " > $(devdir)/getdate.c; cat y.tab.c >> $(devdir)/getdate.c; rm -f y.tab.c'; \ + if test "$(srcdir)" = "."; then \ + getdate_y="getdate.y"; \ + else \ + getdate_y="$(srcdir)/getdate.y"; \ + fi; \ + cmd='$(YACC) '"$$getdate_y"'; echo "#include " > $(devdir)/getdate.c; cat y.tab.c >> $(devdir)/getdate.c; rm -f y.tab.c'; \ echo "$$cmd"; eval $$cmd; \ fi