endif
ifndef BUILDID
-BUILDID = $(shell (hg id || echo "unknown") | sed -e "s/[()]//g;s/+ /+/g;s/ /-/g" )
+BUILDID := $(shell (hg id || echo "unknown") | sed -e "s/[()]//g;s/+ /+/g;s/ /-/g" )
endif
MFLAGS+=BUILDID=$(BUILDID)
.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