262 |
;; index in makefile-imenu-generic-expression. |
;; index in makefile-imenu-generic-expression. |
263 |
(defvar makefile-dependency-regex |
(defvar makefile-dependency-regex |
264 |
;; Allow for two nested levels $(v1:$(v2:$(v3:a=b)=c)=d) |
;; Allow for two nested levels $(v1:$(v2:$(v3:a=b)=c)=d) |
265 |
"^ *\\(\\(?: *\\$\\(?:[({]\\(?:\\$\\(?:[({]\\(?:\\$\\(?:[^({]\\|.[^\n$#})]+?[})]\\)\\|[^\n$#)}]\\)+?[})]\\|[^({]\\)\\|[^\n$#)}]\\)+?[})]\\|[^({]\\)\\| *[^ \n$#:=]+\\)+?\\)[ \t]*\\(:\\)\\(?:[ \t]*$\\|[^=\n]\\(?:[^#\n]*?;[ \t]*\\(.+\\)\\)?\\)" |
"^\\(\\(?:\\$\\(?:[({]\\(?:\\$\\(?:[({]\\(?:\\$\\(?:[^({]\\|.[^\n$#})]+?[})]\\)\\|[^\n$#)}]\\)+?[})]\\|[^({]\\)\\|[^\n$#)}]\\)+?[})]\\|[^({]\\)\\|[^\n$#:=]\\)+?\\)\\(:\\)\\(?:[ \t]*$\\|[^=\n]\\(?:[^#\n]*?;[ \t]*\\(bb.+\\)\\)?\\)" |
266 |
"Regex used to find dependency lines in a makefile.") |
"Regex used to find dependency lines in a makefile.") |
267 |
|
|
268 |
(defconst makefile-bsdmake-dependency-regex |
(defconst makefile-bsdmake-dependency-regex |
291 |
;; that if you change this regexp you might have to fix the imenu index in |
;; that if you change this regexp you might have to fix the imenu index in |
292 |
;; makefile-imenu-generic-expression. |
;; makefile-imenu-generic-expression. |
293 |
(defconst makefile-macroassign-regex |
(defconst makefile-macroassign-regex |
294 |
"^ *\\([^ \n\t][^:#= \t\n]*\\)[ \t]*\\(?:!=[ \t]*\\(\\(?:.+\\\\\n\\)*.+\\)\\|[*:+]?[:?]?=[ \t]*\\(\\(?:.*\\\\\n\\)*.*\\)\\)" |
"^ *\\([^ \n\t][^:#= \t\n]*\\)[ \t]*\\(?:!=\\|[*:+]?[:?]?=\\)" |
295 |
"Regex used to find macro assignment lines in a makefile.") |
"Regex used to find macro assignment lines in a makefile.") |
296 |
|
|
297 |
(defconst makefile-var-use-regex |
(defconst makefile-var-use-regex |
1704 |
(when (save-excursion |
(when (save-excursion |
1705 |
(beginning-of-line) |
(beginning-of-line) |
1706 |
(looking-at makefile-dependency-regex)) |
(looking-at makefile-dependency-regex)) |
1707 |
|
(save-excursion |
1708 |
|
(let ((deps-end (match-end 1)) |
1709 |
|
(match-data (match-data))) |
1710 |
|
(goto-char deps-end) |
1711 |
|
(skip-chars-backward " \t") |
1712 |
|
(setq deps-end (point)) |
1713 |
|
(beginning-of-line) |
1714 |
|
(skip-chars-forward " \t") |
1715 |
|
;; Alter the bounds recorded for subexp 1, |
1716 |
|
;; which is what is supposed to match the targets. |
1717 |
|
(setcar (nthcdr 2 match-data) (point)) |
1718 |
|
(setcar (nthcdr 3 match-data) deps-end) |
1719 |
|
(store-match-data match-data))) |
1720 |
(end-of-line) |
(end-of-line) |
1721 |
(throw 'found (point))))) |
(throw 'found (point))))) |
1722 |
(goto-char pt)) |
(goto-char pt)) |