X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/24e572a95ac1b295c18a24c13da7b448a7eb2d22..f28b61f26dec986fb87602b5c75ad812b8297d85:/build.mk.in diff --git a/build.mk.in b/build.mk.in index 4d711c6a..efd26ce8 100644 --- a/build.mk.in +++ b/build.mk.in @@ -1,20 +1,44 @@ -@ifndef@ INCPATH +ifndef INCPATH INCPATH=../ -@endif@ +endif +CONFIGURED=1 CFLAGS= -CC=gcc +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: - @-ldline-@ $(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= -CFLAGS+=-Wall -g -finline-functions -funroll-loops -std=c99 -I./ -DBUILDID=$(BUILDID) -CFLAGS+=-fPIC -export-dynamic +ifndef NOC99 +CFLAGS+=-std=c99 +endif