X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/866f59c99e74d4d6677a3caea81dda6467b1d472..3898f97325dbed800d4b424e68a0c2858b8d8be7:/build.mk.in diff --git a/build.mk.in b/build.mk.in index d2e335cc..d2fb54b4 100644 --- a/build.mk.in +++ b/build.mk.in @@ -1,16 +1,43 @@ -ifeq ($(INCPATH),) +ifndef INCPATH INCPATH=../ endif -@include@ @includel@$(INCPATH)configure.mk@includel@ -@sinclude@ @includel@$(INCPATH)settings.mk@includel@ +CONFIGURED=1 +CFLAGS= +LEX=flex +MFLAGS= -ifeq ($(BUILDID),) -BUILDID := \"$(shell (hg id || echo "unknown") | sed -e "s/ /-/;s/+-/-/")\" -export BUILDID +ifeq (${HOOKS_NEW},1) +HOOK_ENGINE=new +else +HOOK_ENGINE=old endif -CC=gcc -CFLAGS+=-Wall -g -fPIC -export-dynamic -finline-functions -funroll-loops -std=c99 -I./ -DBUILDID=${BUILDID} +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,$@) -c -o $@ $< -export CC CFLAGS +.o.so: + $(CC) -nostartfiles -Wl,--export-dynamic -shared -o $@ $^ $(LDFLAGS) + +.y.c: ; + +.l.c: ; + +CFLAGS+=-I./ -DBUILDID=$(BUILDID) -fPIC +CFLAGS+=-Wall -g -finline-functions -funroll-loops -Werror=format-security + +ifndef NOC99 +CFLAGS+=-std=c99 +endif