]> jfr.im git - irc/quakenet/newserv.git/blame_incremental - build.mk.in
rework of build stage 2:
[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
54.SUFFIXES: .so .y .l
55
56.o.so:
57 $(CC) -nostartfiles -shared -o $@ $^ $(LDFLAGS)
58
59.y.c: ;
60
61.l.c: ;
62
63default: all
64
65CFLAGS+=-I./ -DBUILDID=$(BUILDID) -fPIC
66CFLAGS+=-Wall -g -finline-functions -funroll-loops -Werror=format-security
67
68ifndef CLANG
69ifndef NOC99
70CFLAGS+=-std=c99
71endif
72CFLAGS+=-export-dynamic
73endif