]> jfr.im git - irc/quakenet/newserv.git/blobdiff - build.mk.in
LUA: port luadb to dbapi2 to drop postgres dependency
[irc/quakenet/newserv.git] / build.mk.in
index ab0cf3752e2b9cf5fa9b123ebb7a64ed7cf14841..efd26ce8eab4e4e3946be1ea570ff32dafda75c8 100644 (file)
@@ -1,20 +1,44 @@
-@ifndef@ INCPATH
+ifndef INCPATH
 INCPATH=../
-@endif@
+endif
 
+CONFIGURED=1
 CFLAGS=
+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 (git describe --long --dirty --all --abbrev=10 || echo "unknown"))"
+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:
-       ld -shared -Bdynamic -o $@ @srcs@ $(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=
 
-CC=gcc
-CFLAGS+=-Wall -g -finline-functions -funroll-loops -std=c99 -I./ -DBUILDID=$(BUILDID)
-CFLAGS+=-fPIC -export-dynamic
+ifndef NOC99
+CFLAGS+=-std=c99
+endif