@@ -400,6 +400,9 @@ sqlhist: samples/sqlhist
samples: libtracefs.a force
$(Q)$(call descend,$(src)/samples,all)
+sqlhist_remake:
+ $(Q)$(call descend,$(src)/src,sqlhist_remake)
+
clean: clean_meson
$(Q)$(call descend_clean,utest)
$(Q)$(call descend_clean,src)
@@ -46,18 +46,20 @@ $(LIBTRACEFS_SHARED_SO): $(LIBTRACEFS_SHARED_VERSION)
libtracefs.so: $(LIBTRACEFS_SHARED_SO)
# bison will create both sqlhist.tab.c and sqlhist.tab.h
-sqlhist.tab.h:
-sqlhist.tab.c: sqlhist.y sqlhist.tab.h
- bison --debug -v --report-file=bison.report -d -o $@ $<
+sqlhist.tab_gen.h:
+sqlhist.tab_gen.c: sqlhist.y sqlhist.tab.h
+ bison --debug -v --report-file=bison.report -d -o $(subst _gen,,$@) $<
-sqlhist-lex.c: sqlhist.l sqlhist.tab.c
- flex -o $@ $<
+sqlhist-lex_gen.c: sqlhist.l sqlhist.tab.c
+ flex -o $(subst _gen,,$@) $<
$(bdir)/%.o: %.c
$(Q)$(call do_fpic_compile)
tracefs-sqlhist.o: sqlhist.tab.h
+sqlhist_remake: sqlhist.tab_gen.c sqlhist-lex_gen.c
+
$(OBJS): | $(bdir)
clean:
@@ -67,4 +69,4 @@ clean:
$(bdir)/tracefs-sqlhist.o tracefs-sqlhist.o: sqlhist.tab.h
-.PHONY: $(LIBTRACEFS_SHARED_SO) $(LIBTRACEFS_STATIC)
+.PHONY: $(LIBTRACEFS_SHARED_SO) $(LIBTRACEFS_STATIC) sqlhist.tab_gen.c sqlhist-lex_gen.c
@@ -1,6 +1,8 @@
%{
/* code here */
+/* If you change this file, run: make sqlhist_remake */
+
#include <stdarg.h>
#include "sqlhist-parse.h"
@@ -1,4 +1,5 @@
%{
+/* If you change this file, run: make sqlhist_remake */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>