summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2020-02-23 09:49:32 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2020-02-23 09:49:32 +0000
commitbdcdaf2ae22457f7ffae3787eb0b9ffd6ca9f082 (patch)
tree7faecd496a714007a938f5ba9309cac8f4e37dd8 /src
parent6f42c731b926c9ccb553fb3031dea34ac5bddc85 (diff)
downloadlibnslog-bdcdaf2ae22457f7ffae3787eb0b9ffd6ca9f082.tar.gz
libnslog-bdcdaf2ae22457f7ffae3787eb0b9ffd6ca9f082.tar.bz2
Infra: Prevent scan-build considering the lexer for now
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'src')
-rw-r--r--src/Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Makefile b/src/Makefile
index 3ca70cd..d598cf5 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -4,11 +4,17 @@ CFLAGS := $(CFLAGS) -I$(BUILDDIR) -Isrc/
SOURCES := $(SOURCES) $(BUILDDIR)/filter-parser.c $(BUILDDIR)/filter-lexer.c
-$(BUILDDIR)/%-lexer.c $(BUILDDIR)/%-lexer.h: src/%-lexer.l
+$(BUILDDIR)/%-lexer.inc $(BUILDDIR)/%-lexer.h: src/%-lexer.l
$(VQ)$(ECHO) " FLEX: $<"
- $(Q)$(FLEX) --outfile=$(BUILDDIR)/$(*F)-lexer.c --header-file=$(BUILDDIR)/$(*F)-lexer.h $<
+ $(Q)$(FLEX) --outfile=$(BUILDDIR)/$(*F)-lexer.inc --header-file=$(BUILDDIR)/$(*F)-lexer.h $<
+.PRECIOUS: $(BUILDDIR)/%-lexer.inc
-$(BUILDDIR)/%-lexer.c: $(BUILDDIR)/%-parser.h
+$(BUILDDIR)/%-lexer.inc: $(BUILDDIR)/%-parser.h
+
+$(BUILDDIR)/%-lexer.c: $(BUILDDIR)/%-lexer.inc
+ $(Q)echo "#ifndef __clang_analyzer__" > $@
+ $(Q)echo "#include \"$(notdir $<)\"" >> $@
+ $(Q)echo "#endif" >> $@
# Bison 3.0 and later require api.prefix in curly braces
# Bison 2.6 and later require api.prefix