1<?xml version="1.0" encoding="UTF-8"?> 2<!-- 3 4 This file is part of GtkSourceView 5 6 Author: P. F. Chimento <philip.chimento@gmail.com> 7 Copyright (C) 2011 P. F. Chimento <philip.chimento@gmail.com> 8 9 GtkSourceView is free software; you can redistribute it and/or 10 modify it under the terms of the GNU Lesser General Public 11 License as published by the Free Software Foundation; either 12 version 2.1 of the License, or (at your option) any later version. 13 14 GtkSourceView is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 Lesser General Public License for more details. 18 19 You should have received a copy of the GNU Lesser General Public License 20 along with this library; if not, see <http://www.gnu.org/licenses/>. 21 22--> 23<language id="automake" name="Automake" version="2.0" _section="Source"> 24 <metadata> 25 <property name="globs">Makefile.am;GNUmakefile.am</property> 26 <property name="line-comment-start">#</property> 27 </metadata> 28 29 <!-- 30 Early versions of this were based on Vim's Automake syntax highlighting 31 file. This language definition is for Automake's Makefile.am files. It is 32 based on the definition of Makefile, except it highlights Makefile variables 33 which are significant to Automake, as well as Autoconf-style @variable@ 34 substitutions. 35 --> 36 37 <styles> 38 <style id="lhs" name="Automake Variable" map-to="def:identifier"/> 39 <style id="primary" name="Primary" map-to="def:type"/> 40 <style id="secondary" name="Secondary" map-to="def:statement"/> 41 <style id="prefix" name="Prefix" map-to="def:statement"/> 42 <style id="target" name="Optional Target" map-to="def:statement"/> 43 <style id="dirname" name="Built-in Target" map-to="def:statement"/> 44 <style id="keyword" name="Other Keyword" map-to="def:statement"/> 45 <style id="subst" name="Substitution" map-to="def:preprocessor"/> 46 </styles> 47 48 <definitions> 49 <!-- Allow substitutions on RHS of assignment --> 50 <replace id="makefile:assignment-rhs" ref="assignment-rhs"/> 51 <!-- Also allow substitutions in makefile's shell code --> 52 <replace id="makefile:command" ref="command"/> 53 54 <!-- Also allow substitutions in automake variable names, that's why the 55 @ is in here; as in libfoobar_@VERSION@_SOURCES --> 56 <define-regex id="variable">[A-Za-z0-9_@]+</define-regex> 57 58 <!-- What is allowed on a line before an Automake variable - no tabs! --> 59 <define-regex id="space">^ *</define-regex> 60 61 <!-- What must come after an Automake variable - one of the assignment 62 operators =, +=, ?=, := (Not sure what := does, but Webkit's GNUmakefile.am 63 uses it, for example --> 64 <define-regex id="operator">\s*[\+\?:]?=</define-regex> 65 66 <!-- Prefixes for primaries and secondaries --> 67 <define-regex id="prefix">(?:no)?dist|no(?:base|trans)</define-regex> 68 69 <!-- "Primaries", or the last component of Product List Variables --> 70 <define-regex id="primary" extended="true"> 71 PROGRAMS| 72 (?:LT)?LIBRARIES| 73 LISP| 74 PYTHON| 75 JAVA| 76 SCRIPTS| 77 DATA| 78 HEADERS| 79 MANS| 80 TEXINFOS 81 </define-regex> 82 83 <!-- Non-directory installation targets --> 84 <define-regex id="target">noinst|check|EXTRA</define-regex> 85 86 <!-- The list of things that can go before "FLAGS" --> 87 <define-regex id="flags" extended="true"> 88 C| 89 CCAS| 90 CPP| 91 CXX| 92 F| 93 GCJ| 94 JAVAC| 95 L| 96 LD| 97 LIBTOOL| 98 (?:[A-Z]+_)?LOG| 99 MAKEINFO(?:HTML)?| 100 OBJC| 101 R| 102 UPC| 103 VALA| 104 Y 105 </define-regex> 106 107 <!-- "Secondaries", or the last component of Product Source Variables --> 108 <define-regex id="secondary" extended="true"> 109 AR| 110 DEPENDENCIES| 111 LDADD| 112 LIBADD| 113 LINK| 114 SHORTNAME| 115 SOURCES| 116 \%{flags}FLAGS 117 </define-regex> 118 119 <!-- Names of other Automake variables that aren't primaries, secondaries, 120 flags, or target directories --> 121 <define-regex id="keyword" extended="true"> 122 ACLOCAL_AMFLAGS| 123 AM_DEFAULT_SOURCE_EXT| 124 AUTOMAKE_OPTIONS| 125 BUILT_SOURCES| 126 CC| 127 CLASSPATH_ENV| 128 (?:DIST|MAINTAINER|MOSTLY)?CLEANFILES| 129 COMPILE| 130 (?:CXX|FC|OBJC|UPC)(?:COMPILE|LINK)?| 131 DEFAULT_INCLUDES| 132 DEFS| 133 DISTCHECK_CONFIGURE_FLAGS| 134 DVIPS| 135 ETAGS_ARGS| 136 EXTRA_DIST| 137 F77(?:COMPILE)?| 138 FLINK| 139 INCLUDE| 140 JAVAC| 141 JAVAROOT| 142 LIBS| 143 LINK| 144 (?:[A-Z]+_)?LOG_COMPILER| 145 MAKEINFO(?:HTML)?| 146 (?:OMIT|TAGS)_DEPENDENCIES| 147 (?:DIST_)?SUBDIRS| 148 SUFFIXES| 149 (?:AM_)?TESTS_ENVIRONMENT| 150 TESTS| 151 TEXI2(?:DVI|PDF)| 152 TEXINFO_TEX| 153 VALAC 154 </define-regex> 155 156 <!-- Predefined directory targets --> 157 <define-regex id="dirname" extended="true"> 158 s?bin| 159 (?:pkg)?lib(?:exec)?| 160 (?:pkg)?data| 161 (?:pkg|old)?include| 162 dataroot| 163 sysconf| 164 (?:shared|local)state| 165 doc| 166 info| 167 html| 168 dvi| 169 pdf| 170 ps| 171 lisp| 172 locale| 173 man[1-8]?(?:ext)?| 174 src| 175 (?:pkg)?python| 176 (?:pkg)?pyexec 177 </define-regex> 178 179 <!-- Substitutions from AC_SUBST --> 180 <context id="subst" style-ref="subst"> 181 <match>@\%{variable}@</match> 182 </context> 183 184 <!-- Lines starting with ## are not copied into Makefile.in, and no 185 substitutions are performed --> 186 <context id="nosubcomment" end-at-line-end="true" class-disabled="no-spell-check"> 187 <start>^##</start> 188 <include> 189 <context ref="def:in-comment"/> 190 </include> 191 </context> 192 193 <!-- Copy of def:shell-like-comment, except it includes substitutions --> 194 <context id="comment" end-at-line-end="true" class-disabled="no-spell-check"> 195 <start>#</start> 196 <include> 197 <context ref="subst"/> 198 <context ref="def:in-comment"/> 199 </include> 200 </context> 201 202 <!-- Assignment to a FLAGS variable --> 203 <context id="flags-assignment" end-at-line-end="true"> 204 <start>\%{space}((?:AM_)?\%{flags}FLAGS)\%{operator}</start> 205 <include> 206 <context sub-pattern="1" where="start" style-ref="keyword"/> 207 <context ref="assignment-rhs"/> 208 </include> 209 </context> 210 211 <!-- Assignment to a non-primary, secondary, flags, or dir variable --> 212 <context id="keyword-assignment" end-at-line-end="true"> 213 <start>\%{space}(\%{keyword})\%{operator}</start> 214 <include> 215 <context sub-pattern="1" where="start" style-ref="keyword"/> 216 <context ref="assignment-rhs"/> 217 </include> 218 </context> 219 220 <!-- Assignment to a primary. The subpatterns are named. Subpattern names 221 must not conflict subpattern names in other expressions, so some are 222 prefixed with a 'p' --> 223 <context id="primary-assignment" end-at-line-end="true"> 224 <start extended="true"> 225 \%{space} # beginning of line 226 (?P<pprefix>(?:\%{prefix}_)*) # any number of prefixes_ 227 (?: # either... 228 (?P<target>\%{target})| # ...a nondir target (e.g. noinst), 229 (?P<dirname>\%{dirname})| # ...a dir target (e.g. bin) 230 (?P<pvariable>\%{variable}) # ...or a user-defined dir 231 ) 232 (?P<primary>_\%{primary}) # and a _PRIMARY 233 \%{operator} # an assignment operator 234 </start> 235 <include> 236 <context sub-pattern="primary" where="start" style-ref="primary"/> 237 <context sub-pattern="pprefix" where="start" style-ref="prefix"/> 238 <context sub-pattern="target" where="start" style-ref="target"/> 239 <context sub-pattern="dirname" where="start" style-ref="dirname"/> 240 <context sub-pattern="pvariable" where="start" style-ref="lhs"/> 241 <context ref="assignment-rhs"/> 242 </include> 243 </context> 244 245 <!-- Assignment to a secondary. Again, some subpatterns have to be prefixed 246 with an 's' --> 247 <context id="secondary-assignment" end-at-line-end="true"> 248 <start extended="true"> 249 \%{space} # beginning of line 250 (?P<sprefix> 251 (?:(?:\%{prefix}|EXTRA)_)*) # any number of prefix_ or EXTRA_ 252 (?P<svariable>\%{variable}) # the canonicalized_program_name 253 (?P<secondary>_\%{secondary}) # and a _SECONDARY 254 \%{operator} # an assignment operator 255 </start> 256 <include> 257 <context sub-pattern="sprefix" where="start" style-ref="prefix"/> 258 <context sub-pattern="svariable" where="start" style-ref="lhs"/> 259 <context sub-pattern="secondary" where="start" style-ref="secondary"/> 260 <context ref="assignment-rhs"/> 261 </include> 262 </context> 263 264 <!-- Assignment to a directory variable (e.g. foobardir) --> 265 <context id="dir-assignment" end-at-line-end="true"> 266 <start>\%{space}(\%{variable})(dir)\%{operator}</start> 267 <include> 268 <context id="dir-lhs" sub-pattern="1" where="start" style-ref="lhs"/> 269 <context id="dir" sub-pattern="2" where="start" style-ref="keyword"/> 270 <context ref="assignment-rhs"/> 271 </include> 272 </context> 273 274 <!-- What is allowed on the right-hand side of an assignment --> 275 <context id="assignment-rhs" end-at-line-end="true"> 276 <start></start> 277 <include> 278 <context ref="def:line-continue"/> 279 <context ref="def:shell-like-comment"/> 280 <context ref="makefile:variable"/> 281 <context ref="makefile:string"/> 282 <context ref="def:single-quoted-string"/> 283 <context ref="sh:backtick-subshell"/> 284 <context ref="subst"/> 285 </include> 286 </context> 287 288 <!-- Copy of makefile:command, except it includes substitutions --> 289 <context id="command" extend-parent="false" end-at-line-end="true"> 290 <start></start> 291 <include> 292 <context ref="def:line-continue"/> 293 <context ref="subst"/> 294 <context ref="sh:sh" original="true"/> 295 </include> 296 </context> 297 298 <!-- All the contexts listed here represent an assignment to a variable 299 (Automake variable or otherwise), and they all contain the "assignment-rhs" 300 context --> 301 <context id="assignment"> 302 <include> 303 <context ref="flags-assignment"/> 304 <context ref="keyword-assignment"/> 305 <context ref="primary-assignment"/> 306 <context ref="secondary-assignment"/> 307 <context ref="dir-assignment"/> 308 <context ref="makefile:assignment"/> 309 </include> 310 </context> 311 312 <!-- The main context --> 313 <context id="automake"> 314 <include> 315 <context ref="makefile:directives" style-ref="def:keyword"/> 316 <context ref="makefile:functions" style-ref="def:function"/> 317 <context ref="subst" style-ref="subst"/> 318 <!-- Must come before 'comment' --> 319 <context ref="nosubcomment" style-ref="def:comment"/> 320 <context ref="comment" style-ref="def:comment"/> 321 <context ref="assignment"/> 322 <!-- Must come after 'comment', otherwise we can get rules starting 323 with #; must also come after 'assignment' because of := operator --> 324 <context ref="makefile:rule"/> 325 </include> 326 </context> 327 </definitions> 328 329</language> 330