]> 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 a892369046cb97d098fce04d6d9824e46d9e206d..3049edd7cd829eea1332e8053ada2639cab930c8 100644 (file)
@@ -13,41 +13,8 @@ else
 HOOK_ENGINE=old
 endif
 
-# if USE_VALGRIND == 1
-ifeq (${USE_VALGRIND},1)
-  CFLAGS+=-DUSE_VALGRIND
-  SSTRING_ENGINE=valgrind
-
-## if SSTRING_NEW == 1
-ifeq (${SSTRING_NEW},1)
-    IMPOSSIBLE="USE_VALGRIND and SSTRING_NEW"
-endif # SSTRING_NEW == 1
-
-## if SSTRING_MMAP == 1
-ifeq (${SSTRING_MMAP},1)
-    IMPOSSIBLE="USE_VALGRIND and SSTRING_MMAP"
-endif ## SSTRING_MMAP == 1
-else # USE_VALGRIND == 1
-
-## if SSTRING_NEW == 1
-ifeq (${SSTRING_NEW},1)
-    SSTRING_ENGINE=new
-else ## SSTRING_NEW == 1
-    SSTRING_ENGINE=old
-
-### if SSTRING_MMAP == 1
-ifeq (${SSTRING_MMAP},1)
-      IMPOSSIBLE="SSTRING_MMAP without SSTRING_NEW"
-endif ### SSTRING_MMAP == 1
-endif ## SSTRING_NEW == 1
-endif # USE_VALGRIND == 1
-
-ifdef IMPOSSIBLE
-$(error impossible combination of settings: ${IMPOSSIBLE})
-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)
 
@@ -55,10 +22,11 @@ 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)
@@ -67,8 +35,9 @@ default: all
 
 .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