+ifndef BUILDID
+BUILDID := $(shell (hg id || echo "unknown") | sed -e "s/[()]//g;s/+ /+/g;s/ /-/g" )
+endif
+MFLAGS+=BUILDID=$(BUILDID)
+
+default: all
+
+.SUFFIXES: .so .y .l
+
+-include $(wildcard .deps/*.d)
+
+.c.o:
+ @if [ ! -d .deps ]; then mkdir .deps || true; fi
+ $(CC) $(CFLAGS) -MMD -MF .deps/$(subst .o,.d,$@) -fPIC -c -o $@ $<
+
+.o.so:
+ $(CC) -nostartfiles -Wl,--export-dynamic -shared -o $@ $^ $(LDFLAGS)
+
+.y.c: ;
+
+.l.c: ;
+
+CFLAGS+=-I. -I.. -DBUILDID=$(BUILDID)
+CFLAGS+=-Wall -g -finline-functions -funroll-loops -Werror=format-security
+EXECFLAGS=
+
+ifndef NOC99
+CFLAGS+=-std=c99
+endif