endif
ifndef BUILDID
-BUILDID = $(shell (hg id || echo "unknown") | sed -e "s/[()]//g;s/+ /+/g;s/ /-/g" )
+BUILDID := "$(shell (git describe --long --dirty --all --abbrev=10 || echo "unknown"))"
endif
-MFLAGS+=BUILDID=$(BUILDID)
+MFLAGS+=BUILDID='${BUILDID}'
default: all
.SUFFIXES: .so .y .l
--include $(wildcard *.d)
+-include $(wildcard .deps/*.d)
.c.o:
- $(CC) $(CFLAGS) -MMD -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)
.l.c: ;
-CFLAGS+=-I./ -DBUILDID=$(BUILDID) -fPIC
+CFLAGS+=-I. -I.. -DBUILDID='${BUILDID}'
CFLAGS+=-Wall -g -finline-functions -funroll-loops -Werror=format-security
+EXECFLAGS=
ifndef NOC99
CFLAGS+=-std=c99