]>
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 | default: 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 | ||
70 | CFLAGS+=-I./ -DBUILDID=$(BUILDID) -fPIC | |
71 | CFLAGS+=-Wall -g -finline-functions -funroll-loops -Werror=format-security | |
72 | ||
73 | ifndef NOC99 | |
74 | CFLAGS+=-std=c99 | |
75 | endif |