X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/773391f45b1c67f453f61fe0a48357776cbcb51b..056e1ea46d3a0707ca0bb46af4abd429e55c4196:/build.mk.in diff --git a/build.mk.in b/build.mk.in index 4d711c6a..3049edd7 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 (hg id || echo "unknown") | sed -e "s/[()]//g;s/+ /+/g;s/ /-/g" ) +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