libsepol,libsemanage: write file name in flex output

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>
This commit is contained in:
Nicolas Iooss 2016-11-28 22:40:18 +01:00 committed by Stephen Smalley
parent 1c187d797f
commit ab27085099
2 changed files with 3 additions and 2 deletions

View File

@ -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 $@ $<

View File

@ -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