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:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -100,3 +100,4 @@ Makefile.in | ||||
| /docs/reference/*/xml/ | ||||
| /docs/reference/*/html/ | ||||
| /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_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 | ||||
		Reference in New Issue
	
	Block a user