-@ifndef@ INCPATH
+ifndef INCPATH
INCPATH=../
-@endif@
+endif
+CONFIGURED=1
CFLAGS=
-CC=gcc
+LEX=flex
+MFLAGS=
-@sinclude@ @includel@$(INCPATH)settings.mk@includel@
+ifeq (${HOOKS_NEW},1)
+HOOK_ENGINE=new
+else
+HOOK_ENGINE=old
+endif
-@ifndef@ BUILDID
-BUILDID @shell@ (hg id || echo "unknown") | sed -e "s/+ /-/;s/ /-/" @shellend@
-@endif@
+ifndef BUILDID
+BUILDID = $(shell (hg id || echo "unknown") | sed -e "s/[()]//g;s/+ /+/g;s/ /-/g" )
+endif
+MFLAGS+=BUILDID=$(BUILDID)
-.SUFFIXES: .so
+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:
- @-ldline-@ $(LDFLAGS)
+ $(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=
-CFLAGS+=-Wall -g -finline-functions -funroll-loops -std=c99 -I./ -DBUILDID=$(BUILDID)
-CFLAGS+=-fPIC -export-dynamic
+ifndef NOC99
+CFLAGS+=-std=c99
+endif