- ;;
- ;; Variable references even in targets/strings/comments:
- '("\\$[({]\\([-a-zA-Z0-9_.]+\\)[}):]" 1 font-lock-constant-face prepend)
- ;;
- ;; Automatic variable references.
- '("\\$\\([@%<?^+*]\\)" 1 font-lock-reference-face prepend)
- ;;
+
+ ;; Variable references even in targets/strings/comments.
+ '("[^$]\\$[({]\\([-a-zA-Z0-9_.]+\\|[@%<?^+*][FD]?\\)[}):]"
+ 1 font-lock-constant-face prepend)
+
+ ;; Automatic variable references and single character variable references,
+ ;; but not shell variables references.
+ '("[^$]\\$\\([@%<?^+*_]\\|[a-zA-Z0-9]\\>\\)"
+ 1 font-lock-constant-face prepend)
+
+ ;; Fontify conditionals and includes.
+ ;; Note that plain `if' is an automake conditional, and not a bug.
+ (list
+ (concat "^\\(?: [ \t]*\\)?"
+ (regexp-opt '("-include" "-sinclude" "include" "sinclude" "ifeq"
+ "if" "ifneq" "ifdef" "ifndef" "endif" "else"
+ "define" "endef" "override"
+ "export" "unexport" "vpath") t)
+ "\\>[ \t]*\\([^: \t\n#]*\\)")
+ '(1 font-lock-keyword-face) '(2 font-lock-variable-name-face))
+