]>
Commit | Line | Data |
---|---|---|
1 | ifndef INCPATH | |
2 | INCPATH=../ | |
3 | endif | |
4 | ||
5 | CONFIGURED=1 | |
6 | CFLAGS= | |
7 | LEX=flex | |
8 | MFLAGS= | |
9 | ||
10 | ifeq (${HOOKS_NEW},1) | |
11 | HOOK_ENGINE=new | |
12 | else | |
13 | HOOK_ENGINE=old | |
14 | endif | |
15 | ||
16 | # if USE_VALGRIND == 1 | |
17 | ifeq (${USE_VALGRIND},1) | |
18 | CFLAGS+=-DUSE_VALGRIND | |
19 | SSTRING_ENGINE=valgrind | |
20 | ||
21 | ## if SSTRING_NEW == 1 | |
22 | ifeq (${SSTRING_NEW},1) | |
23 | IMPOSSIBLE="USE_VALGRIND and SSTRING_NEW" | |
24 | endif # SSTRING_NEW == 1 | |
25 | ||
26 | ## if SSTRING_MMAP == 1 | |
27 | ifeq (${SSTRING_MMAP},1) | |
28 | IMPOSSIBLE="USE_VALGRIND and SSTRING_MMAP" | |
29 | endif ## SSTRING_MMAP == 1 | |
30 | else # USE_VALGRIND == 1 | |
31 | ||
32 | ## if SSTRING_NEW == 1 | |
33 | ifeq (${SSTRING_NEW},1) | |
34 | SSTRING_ENGINE=new | |
35 | else ## SSTRING_NEW == 1 | |
36 | SSTRING_ENGINE=old | |
37 | ||
38 | ### if SSTRING_MMAP == 1 | |
39 | ifeq (${SSTRING_MMAP},1) | |
40 | IMPOSSIBLE="SSTRING_MMAP without SSTRING_NEW" | |
41 | endif ### SSTRING_MMAP == 1 | |
42 | endif ## SSTRING_NEW == 1 | |
43 | endif # USE_VALGRIND == 1 | |
44 | ||
45 | ifdef IMPOSSIBLE | |
46 | $(error impossible combination of settings: ${IMPOSSIBLE}) | |
47 | endif | |
48 | ||
49 | ifndef BUILDID | |
50 | BUILDID = $(shell (hg id || echo "unknown") | sed -e "s/[()]//g;s/+ /+/g;s/ /-/g" ) | |
51 | endif | |
52 | MFLAGS+=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 | ||
63 | default: all | |
64 | ||
65 | CFLAGS+=-I./ -DBUILDID=$(BUILDID) -fPIC | |
66 | CFLAGS+=-Wall -g -finline-functions -funroll-loops -Werror=format-security | |
67 | ||
68 | ifndef CLANG | |
69 | ifndef NOC99 | |
70 | CFLAGS+=-std=c99 | |
71 | endif | |
72 | CFLAGS+=-export-dynamic | |
73 | endif |