<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!-- Makefile syntaxfile v0.9 by Per Wigren <wigren@home.se> -->
<!-- Modified by Joseph Wenninger <jowenn@kde.org> -->
<language name="Makefile" version="1.01" kateversion="2.1" section="Other" extensions="" mimetype="text/x-makefile">
	<highlighting>
		<list name = "keywords">
			<item> include </item>
			<item> define </item>
			<item> else </item>
			<item> endef </item>
			<item> endif </item>
			<item> ifdef </item>
			<item> ifeq </item>
			<item> ifndef </item>
			<item> ifneq </item>
		</list>

		<contexts>
			<context name="Normal" attribute="Normal Text" lineEndContext="#stay">
				<HlCStringChar attribute="Normal Text" lineEndContext="#stay"/>
				<keyword String="keywords" attribute="Keyword" context="#stay"/>
				<RegExpr String="#.*$" attribute="Comment" context="#stay"/>
				<RegExpr String="(^|;)\s*\S+\s*=" attribute="Variable" context="Value"/>
				<RegExpr String="^.*:" attribute="Section" context="#stay"/>
				<RegExpr attribute="Operator" String="\$\(" context="ParanVarFromNormal"/>
				<RegExpr attribute="Operator" String="\$\{" context="BrackVarFromNormal"/>
				<RegExpr String="[+*/=%$():;\\]" attribute="Operator" context="#stay"/>
			</context>

			<context name="Value" attribute="String" lineEndContext="#stay">
				<HlCStringChar attribute="String Char" context="#stay"/>
				<RegExpr attribute="Operator" String="\\$"     context="#stay"/>
				<RegExpr attribute="String"   String="[^\\]?$" context="#pop"/>
				<RegExpr attribute="Operator" String="\$\("    context="ParanVarFromValue"/>
				<RegExpr attribute="Operator" String="\$\{"    context="BrackVarFromValue"/>
				<RegExpr attribute="Operator" String=";"       context="#pop"/>
			</context>

			<context name="ParanVarFromValue" attribute="Variable" lineEndContext="#stay">
				<HlCStringChar attribute="Variable" context="#stay"/>
				<RegExpr attribute="Operator" String="\)[^$]" context="#pop"/>
				<RegExpr attribute="Operator" String="\)$" context="#pop#pop"/>
			</context>

			<context name="BrackVarFromValue" attribute="Variable" lineEndContext="#stay">
				<HlCStringChar attribute="Variable" context="#stay"/>
				<RegExpr attribute="Operator" String="\}[^$]" context="#pop"/>
				<RegExpr attribute="Operator" String="\}$" context="#pop#pop"/>
			</context>

			<context name="ParanVarFromNormal" attribute="Variable" lineEndContext="#stay">
				<HlCChar attribute="Variable" context="#stay"/>
				<RegExpr attribute="Operator" String="\)" context="#pop"/>
			</context>

			<context name="BrackVarFromNormal" attribute="Variable" lineEndContext="#stay">
				<HlCChar attribute="Variable" context="#stay"/>
				<RegExpr attribute="Operator" String="\}" context="#pop"/>
			</context>

		</contexts>

		<itemDatas>
			<itemData name="Normal Text"	defStyleNum="dsNormal"/>
			<itemData name="Keyword"		defStyleNum="dsKeyword"/>
			<itemData name="Comment"		defStyleNum="dsComment"/>
			<itemData name="String"			defStyleNum="dsString"/>
			<itemData name="String Char"	defStyleNum="dsChar"/>
			<itemData name="Variable"		defStyleNum="dsDataType"/>
			<itemData name="Section"		defStyleNum="dsOthers"/>
			<itemData name="Operator"		defStyleNum="dsChar"/>
		</itemDatas>
	</highlighting>

	<general>
		<comments>
			<comment name = "singleLine" start = "#"/>
		</comments>
		<keywords casesensitive = "1" />
	</general>
</language>
