]> jfr.im git - irc/quakenet/newserv.git/blobdiff - build.mk.in
jupe: Clean up single list code.
[irc/quakenet/newserv.git] / build.mk.in
index b1f3982e87f4535a7d05bff47f41c128f16ee7ad..049b726463d7d26533a79c0dcc0d21908a9dd29c 100644 (file)
@@ -2,6 +2,7 @@ ifndef INCPATH
 INCPATH=../
 endif
 
+CONFIGURED=1
 CFLAGS=
 LEX=flex
 MFLAGS=
@@ -50,23 +51,25 @@ 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 *.d)
+
+.c.o:
+       $(CC) $(CFLAGS) -MMD -c -o $@ $<
+
 .o.so:
-       $(CC) -nostartfiles -shared -o $@ $^ $(LDFLAGS)
+       $(CC) -nostartfiles -Wl,--export-dynamic -shared -o $@ $^ $(LDFLAGS)
 
 .y.c:  ;
 
 .l.c:  ;
 
-default: all
-
 CFLAGS+=-I./ -DBUILDID=$(BUILDID) -fPIC
 CFLAGS+=-Wall -g -finline-functions -funroll-loops -Werror=format-security
 
-ifndef CLANG
 ifndef NOC99
 CFLAGS+=-std=c99
 endif
-CFLAGS+=-export-dynamic
-endif