+# Binary File Compiler
+# This target gets as input a binary file *.bin and produces an ELF/etc. output
+# object file *.bin.o and the corresponding libtool file *.bin.lo.
+# Note that we fake the libtool object files as there is no way to make libtool
+# create it. The comments in the .lo file are mandatory so don't remove them!
+#
+
+CLEANFILES += src/*.bin.lo src/*.bin.o
+
+src/%.bin.lo: src/%.bin
+ $(AM_V_GEN)$(LD) -r -o "src/$*.bin.o" -z noexecstack --format=binary "$<"
+ $(AM_V_at)$(OBJCOPY) --rename-section .data=.rodata,alloc,load,readonly,data,contents "src/$*.bin.o"
+ $(AM_V_at)echo "# $@ - a libtool object file" >"$@"
+ $(AM_V_at)echo "# Generated by $(shell $(LIBTOOL) --version | head -n 1)" >>"$@"
+ $(AM_V_at)echo "#" >>"$@"
+ $(AM_V_at)echo "# Please DO NOT delete this file!" >>"$@"
+ $(AM_V_at)echo "# It is necessary for linking the library." >>"$@"
+ $(AM_V_at)echo >>"$@"
+ $(AM_V_at)echo "# Name of the PIC object." >>"$@"
+ $(AM_V_at)echo "pic_object='$*.bin.o'" >>"$@"
+ $(AM_V_at)echo >>"$@"
+ $(AM_V_at)echo "# Name of the non-PIC object" >>"$@"
+ $(AM_V_at)echo "non_pic_object='$*.bin.o'" >>"$@"
+ $(AM_V_at)echo >>"$@"
+
+#
+# Shader Converter
+# We use a few built-in shader files. To reduce memory-consumption, this helper
+# removes useless lines from the shaders before they are compiled into an object
+# file.
+#
+# Following regexp are used to remove characters/lines:
+# ^/*.*$ Start of multi-line comment
+# ^ *.*$ Multi-line comment body
+# ^[ \t]* Indentation whitespace
+# [\r\n] Newlines
+#
+
+CLEANFILES += src/*.vert.bin src/*.frag.bin
+SHADER_SED = -e 's/^\/\*.*$$//' -e 's/^ \*.*$$//' -e 's/^[ \t]*//'
+SHADER_TR = -d "\r\n"
+
+src/%.vert.bin: $(top_srcdir)/src/%.vert
+ $(AM_V_at)$(SED) $(SHADER_SED) "$<" | tr $(SHADER_TR) >"$@"
+
+src/%.frag.bin: $(top_srcdir)/src/%.frag
+ $(AM_V_at)$(SED) $(SHADER_SED) "$<" | tr $(SHADER_TR) >"$@"
+
+#
+# XKB Fallback Converter
+# We use a static built-in XKB fallback keymap. To avoid huge memory consumption
+# we remove useless lines/characters first.
+# We also append an ASCII 0 character so it can be used as regular C-string.
+#
+# Following regexp are used to remove characters/lines:
+# *= * Whitespace around assignments
+# *, * Whitespace around commatas
+# *[][{}()] * Whitespace around braces
+# ^[ \t]* Indentation whitespace
+# [\r\n] Newlines
+#
+
+CLEANFILES += src/*.xkb.bin
+XKB_SED = -e 's/^[ \t]*//' -e 's/ *\([,=]\) */\1/g' -e 's/ *\([][{}()]\) */\1/g'
+XKB_TR = -d "\r\n"
+
+src/%.xkb.bin: $(top_srcdir)/src/%.xkb
+ $(AM_V_at)$(SED) $(XKB_SED) "$<" | tr $(XKB_TR) >"$@"
+ $(AM_V_at)echo -ne "\x00" >>"$@"
+
+#