Put bison/flex files in parsers dir, so scan-build --exclude can be used

The autogenerated files create warnings that we can't do much about, so
exclude them.
This commit is contained in:
ejurgensen
2022-01-11 18:54:47 +01:00
parent 397800c9cd
commit f36d1cce6d
11 changed files with 15 additions and 17 deletions

3
src/.gitignore vendored
View File

@@ -1,8 +1,5 @@
owntone
*_lexer.[ch]
*_parser.[ch]
daap_query_hash.h
rsp_query_hash.h
dacp_prop_hash.h

View File

@@ -62,14 +62,8 @@ GPERF_FILES = \
GPERF_SRC = $(GPERF_FILES:.gperf=_hash.h)
LEXER_SRC = daap_lexer.l smartpl_lexer.l
PARSER_SRC = daap_parser.y smartpl_parser.y
# This flag is given to flex and tells it to produce headers. automake's ylwrap
# doesn't seem to rename the header like it does with the .c flex output, so
# here we give it the final name. The "$(@:.c=.h)" uses substitution reference
# and means 'change .c to .h in $@' (the target name, e.g. calc_lexer.c).
AM_LFLAGS = --header-file=$(@:.c=.h)
LEXER_SRC = parsers/daap_lexer.l parsers/smartpl_lexer.l
PARSER_SRC = parsers/daap_parser.y parsers/smartpl_parser.y
# This flag is given to Bison and tells it to produce headers. Note that
# automake recognizes this flag too, and has special logic around it, so don't
@@ -153,7 +147,7 @@ owntone_SOURCES = main.c \
# the C files as target, as the AM_LFLAGS will make sure headers are produced.
BUILT_SOURCES = \
$(GPERF_SRC) \
$(LEXER_SRC:.l=.c) $(PARSER_SRC:.y=.h)
$(LEXER_SRC:.l=.h) $(PARSER_SRC:.y=.h)
# automake doesn't know how to make lexer headers, nor does it automatically
# include them, so need to specify them as EXTRA_DIST.
@@ -165,6 +159,11 @@ EXTRA_DIST = \
%_hash.h: %.gperf
$(AM_V_GEN)$(GPERF) --output-file=$@ $<
# Rule for generating lexer headers. $@ is an automatic variable that is equal
# to the particular target name, so a header file name.
$(LEXER_SRC:.l=.h): $(LEXER_SRC)
$(LEX) --header-file=$@ --stdout $(@:.h=.l) > /dev/null
# Anything built by make should be cleaned by make clean, but when it comes to
# flex/bison automake's support leaves something to be desired
clean-local:

View File

@@ -26,7 +26,7 @@
#include <errno.h>
#include "daap_query.h"
#include "daap_parser.h"
#include "parsers/daap_parser.h"
#include "logger.h"
#include "misc.h"

2
src/parsers/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*_lexer.[ch]
*_parser.[ch]

View File

@@ -32,7 +32,7 @@
#include <errno.h>
#include "smartpl_query.h"
#include "smartpl_parser.h"
#include "parsers/smartpl_parser.h"
#include "logger.h"
#include "misc.h"