The highlighting of assignments is not syntax controlled in
It is done via regular expressions in
makefile-font-lock-keywords is constructed by the function
makefile-make-font-lock-keywords which uses the variable
makefile-macroassign-regex for macro assignments.
If you change
makefile-macroassign-regex you must also re-run
makefile-make-font-lock-keywords to reconstruct the font-lock keyword lists you need.
makefile-imenu-generic-expression is constructed from
makefile-macroassign-regex so you need to reconstruct the value of that variable as well.
I demonstrate that by a self-defined major mode derived from
The most important change in that major mode is the added
+-sign in the character groups of
(define-derived-mode my-makefile-mode makefile-mode "myMake"
"Makefiles with additional operator +=."
"\\(?:^\\|^export\\|^override\\|:\\|:[ \t]*override\\)[ \t]*\\([^ \n\t+][^:#= \t\n+]*\\)[ \t]*\\(?:!=\\|[*:+]?[:?]?=\\)")
`(("Dependencies" makefile-previous-dependency 1)
("Macro Assignment" ,makefile-macroassign-regex 1))))