]> jfr.im git - irc/quakenet/newserv.git/blobdiff - build.mk.in
CHANSERV: better batcher error handling for expired accounts/accounts with no email.
[irc/quakenet/newserv.git] / build.mk.in
index d2e335cc7de1173c42767d1b87baaa556ed33a09..3049edd7cd829eea1332e8053ada2639cab930c8 100644 (file)
@@ -1,16 +1,44 @@
-ifeq ($(INCPATH),)
+ifndef INCPATH
 INCPATH=../
 endif
 
-@include@ @includel@$(INCPATH)configure.mk@includel@
-@sinclude@ @includel@$(INCPATH)settings.mk@includel@
+CONFIGURED=1
+CFLAGS=
+LEX=flex
+MFLAGS=
 
-ifeq ($(BUILDID),)
-BUILDID := \"$(shell (hg id || echo "unknown") | sed -e "s/ /-/;s/+-/-/")\"
-export BUILDID
+ifeq (${HOOKS_NEW},1)
+HOOK_ENGINE=new
+else
+HOOK_ENGINE=old
 endif
 
-CC=gcc
-CFLAGS+=-Wall -g -fPIC -export-dynamic -finline-functions -funroll-loops -std=c99 -I./ -DBUILDID=${BUILDID}
+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 $@ $<
 
-export CC CFLAGS
+.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