diff mbox

[4/4] libsepol,libsemanage: write file name in flex output

Message ID 20161128214018.7861-4-nicolas.iooss@m4x.org (mailing list archive)
State Not Applicable
Headers show

Commit Message

Nicolas Iooss Nov. 28, 2016, 9:40 p.m. UTC
Tools like lcov (for code coverage) does not like files named
"<stdout>". For example it reports errors like:

    genhtml: ERROR: cannot read
    /usr/src/selinux/libsemanage/src/<stdout>

When using flex -o option, the output file name gets written in the
generated C code, which solves this issue.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
---
 libsemanage/src/Makefile | 2 +-
 libsepol/src/Makefile    | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Stephen Smalley Nov. 29, 2016, 1:59 p.m. UTC | #1
On 11/28/2016 04:40 PM, Nicolas Iooss wrote:
> Tools like lcov (for code coverage) does not like files named
> "<stdout>". For example it reports errors like:
> 
>     genhtml: ERROR: cannot read
>     /usr/src/selinux/libsemanage/src/<stdout>
> 
> When using flex -o option, the output file name gets written in the
> generated C code, which solves this issue.
> 
> Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>

Thanks, applied all four.

> ---
>  libsemanage/src/Makefile | 2 +-
>  libsepol/src/Makefile    | 3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/libsemanage/src/Makefile b/libsemanage/src/Makefile
> index ef25902bb019..df5809645a00 100644
> --- a/libsemanage/src/Makefile
> +++ b/libsemanage/src/Makefile
> @@ -101,7 +101,7 @@ semanageswig_python_exception.i: ../include/semanage/semanage.h
>  	bash -e exception.sh > $@ || (rm -f $@ ; false)
>  
>  conf-scan.c: conf-scan.l conf-parse.h
> -	$(LEX) $(LFLAGS) -t $< > $@
> +	$(LEX) $(LFLAGS) -o $@ $<
>  
>  conf-parse.c: conf-parse.y
>  	$(YACC) $(YFLAGS) -o $@ $<
> diff --git a/libsepol/src/Makefile b/libsepol/src/Makefile
> index 72724580eb98..497cd5675bd9 100644
> --- a/libsepol/src/Makefile
> +++ b/libsepol/src/Makefile
> @@ -67,7 +67,8 @@ $(CILDIR)/src/cil_lexer.lo: $(CILDIR)/src/cil_lexer.c
>  	$(CC) $(filter-out -Werror, $(CFLAGS)) -fPIC -DSHARED -c -o $@ $<
>  
>  $(CILDIR)/src/cil_lexer.c: $(CILDIR)/src/cil_lexer.l
> -	$(LEX) -t $< > $@
> +	$(LEX) -o $@ $<
> +
>  endif
>  
>  %.o:  %.c 
>
diff mbox

Patch

diff --git a/libsemanage/src/Makefile b/libsemanage/src/Makefile
index ef25902bb019..df5809645a00 100644
--- a/libsemanage/src/Makefile
+++ b/libsemanage/src/Makefile
@@ -101,7 +101,7 @@  semanageswig_python_exception.i: ../include/semanage/semanage.h
 	bash -e exception.sh > $@ || (rm -f $@ ; false)
 
 conf-scan.c: conf-scan.l conf-parse.h
-	$(LEX) $(LFLAGS) -t $< > $@
+	$(LEX) $(LFLAGS) -o $@ $<
 
 conf-parse.c: conf-parse.y
 	$(YACC) $(YFLAGS) -o $@ $<
diff --git a/libsepol/src/Makefile b/libsepol/src/Makefile
index 72724580eb98..497cd5675bd9 100644
--- a/libsepol/src/Makefile
+++ b/libsepol/src/Makefile
@@ -67,7 +67,8 @@  $(CILDIR)/src/cil_lexer.lo: $(CILDIR)/src/cil_lexer.c
 	$(CC) $(filter-out -Werror, $(CFLAGS)) -fPIC -DSHARED -c -o $@ $<
 
 $(CILDIR)/src/cil_lexer.c: $(CILDIR)/src/cil_lexer.l
-	$(LEX) -t $< > $@
+	$(LEX) -o $@ $<
+
 endif
 
 %.o:  %.c