Add Makefile rule to generate .dir-locals.el file
It is good for company-mode, so it won’t die due to unknown include directories.
This commit is contained in:
parent
8e828e582c
commit
5071a55dde
1
.gitignore
vendored
1
.gitignore
vendored
@ -100,3 +100,4 @@ Makefile.in
|
|||||||
/docs/reference/*/xml/
|
/docs/reference/*/xml/
|
||||||
/docs/reference/*/html/
|
/docs/reference/*/html/
|
||||||
/gtk-doc.make
|
/gtk-doc.make
|
||||||
|
.dir-locals.el
|
@ -36,3 +36,9 @@ astrognome_LDADD = $(SWE_GLIB_LIBS) $(GTK_LIBS) $(LIBXML_LIBS) $(LIBXSLT_LIBS) $
|
|||||||
astrognome_LDFLAGS = -rdynamic
|
astrognome_LDFLAGS = -rdynamic
|
||||||
astrognome_CFLAGS = $(SWE_GLIB_CFLAGS) $(CFLAGS) $(GTK_CFLAGS) $(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS) $(WEBKIT_CFLAGS) $(GDA_CFLAGS) $(PIXBUF_CFLAGS) $(RSVG_CFLAGS) -Wall
|
astrognome_CFLAGS = $(SWE_GLIB_CFLAGS) $(CFLAGS) $(GTK_CFLAGS) $(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS) $(WEBKIT_CFLAGS) $(GDA_CFLAGS) $(PIXBUF_CFLAGS) $(RSVG_CFLAGS) -Wall
|
||||||
|
|
||||||
|
# The following two lines generate a .dir-locals.el file, so
|
||||||
|
# company-mode won’t die due to unknown includes
|
||||||
|
.dir-locals.el:
|
||||||
|
@echo $(astrognome_CFLAGS) | ./gen-dir-locals-el.sh
|
||||||
|
|
||||||
|
.PHONY: .dir-locals.el
|
||||||
|
8
src/gen-dir-locals-el.sh
Executable file
8
src/gen-dir-locals-el.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
(echo -n "((nil . ((company-clang-arguments . ("
|
||||||
|
for line in `cat - | sed -e 's/\s\+/\n/g' | grep '^-I' | sort | uniq`
|
||||||
|
do
|
||||||
|
echo '"'$line'"'
|
||||||
|
done
|
||||||
|
echo ")))))") > .dir-locals.el
|
Loading…
Reference in New Issue
Block a user