]> jfr.im git - irc/quakenet/newserv.git/blame_incremental - build.mk.in
Add missing #include.
[irc/quakenet/newserv.git] / build.mk.in
... / ...
CommitLineData
1ifndef INCPATH
2INCPATH=../
3endif
4
5CONFIGURED=1
6CFLAGS=
7LEX=flex
8MFLAGS=
9
10ifeq (${HOOKS_NEW},1)
11HOOK_ENGINE=new
12else
13HOOK_ENGINE=old
14endif
15
16# if USE_VALGRIND == 1
17ifeq (${USE_VALGRIND},1)
18 CFLAGS+=-DUSE_VALGRIND
19 SSTRING_ENGINE=valgrind
20
21## if SSTRING_NEW == 1
22ifeq (${SSTRING_NEW},1)
23 IMPOSSIBLE="USE_VALGRIND and SSTRING_NEW"
24endif # SSTRING_NEW == 1
25
26## if SSTRING_MMAP == 1
27ifeq (${SSTRING_MMAP},1)
28 IMPOSSIBLE="USE_VALGRIND and SSTRING_MMAP"
29endif ## SSTRING_MMAP == 1
30else # USE_VALGRIND == 1
31
32## if SSTRING_NEW == 1
33ifeq (${SSTRING_NEW},1)
34 SSTRING_ENGINE=new
35else ## SSTRING_NEW == 1
36 SSTRING_ENGINE=old
37
38### if SSTRING_MMAP == 1
39ifeq (${SSTRING_MMAP},1)
40 IMPOSSIBLE="SSTRING_MMAP without SSTRING_NEW"
41endif ### SSTRING_MMAP == 1
42endif ## SSTRING_NEW == 1
43endif # USE_VALGRIND == 1
44
45ifdef IMPOSSIBLE
46$(error impossible combination of settings: ${IMPOSSIBLE})
47endif
48
49ifndef BUILDID
50BUILDID = $(shell (hg id || echo "unknown") | sed -e "s/[()]//g;s/+ /+/g;s/ /-/g" )
51endif
52MFLAGS+=BUILDID=$(BUILDID)
53
54default: all
55
56.SUFFIXES: .so .y .l
57
58-include $(wildcard *.d)
59
60.c.o:
61 $(CC) $(CFLAGS) -MMD -c -o $@ $<
62
63.o.so:
64 $(CC) -nostartfiles -Wl,--export-dynamic -shared -o $@ $^ $(LDFLAGS)
65
66.y.c: ;
67
68.l.c: ;
69
70CFLAGS+=-I./ -DBUILDID=$(BUILDID) -fPIC
71CFLAGS+=-Wall -g -finline-functions -funroll-loops -Werror=format-security
72
73ifndef NOC99
74CFLAGS+=-std=c99
75endif