]> jfr.im git - irc/quakenet/newserv.git/blobdiff - build.mk.in
CHANSERV: remove accidental sendemail from SETEMAIL command.
[irc/quakenet/newserv.git] / build.mk.in
index bcdfa1ba51960dd4ff3935ceaa781f3211a58fbe..3049edd7cd829eea1332e8053ada2639cab930c8 100644 (file)
@@ -1,26 +1,44 @@
-@ifndef@ INCPATH
+ifndef INCPATH
 INCPATH=../
-@endif@
+endif
 
+CONFIGURED=1
 CFLAGS=
-CC=gcc
 LEX=flex
+MFLAGS=
 
-@sinclude@ @includel@$(INCPATH)defaults.mk@includel@
-@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)
+
+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+=-Wall -g -finline-functions -funroll-loops -std=c99 -I./ -DBUILDID=$(BUILDID)
-CFLAGS+=-fPIC -export-dynamic
+CFLAGS+=-I. -I.. -DBUILDID=$(BUILDID)
+CFLAGS+=-Wall -g -finline-functions -funroll-loops -Werror=format-security
+EXECFLAGS=
+
+ifndef NOC99
+CFLAGS+=-std=c99
+endif