diff --git a/.gitignore b/.gitignore index 18bca68..da55882 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ Makefile.in /GTAGS /INSTALL /ChangeLog +/.dir-locals.el /src/matrix-version.h /src/matrix-enumtypes.[ch] /src/matrix-marshalers.[ch] diff --git a/Makefile.am b/Makefile.am index 5f55bde..b68c985 100644 --- a/Makefile.am +++ b/Makefile.am @@ -63,4 +63,22 @@ ChangeLog: echo A git checkout and git-log is required to generate this file >> $@); \ fi -.PHONY: ChangeLog +.PHONY: ChangeLog .dir-locals.el + +.dir-locals.el: + @echo -n ""; \ + includes=`echo -I$(top_srcdir) $(GLIB_CFLAGS) $(GOBJECT_CFLAGS) $(SOUP_CFLAGS) $(JSON_CFLAGS) $(VALA_CFLAGS) | tr " " "\n" | grep '^-I' | sed 's/^-I//'`; \ + flycheck_path='('; \ + company_path='('; \ + for incl in $$includes; \ + do \ + if [ "$$incl" == "." ]; \ + then \ + incl="$(abs_top_srcdir)"; \ + fi; \ + flycheck_path="$$flycheck_path \"$$incl\""; \ + company_path="$$company_path \"-I$$incl\""; \ + done; \ + flycheck_path="$$flycheck_path)"; \ + company_path="$$company_path)"; \ + echo "((c-mode . ((flycheck-clang-include-path . $$flycheck_path) (company-clang-arguments . $$company_path))))" > $@