]>
Commit | Line | Data |
---|---|---|
16fc8bc1 | 1 | @ifndef@ INCPATH |
866f59c9 | 2 | INCPATH=../ |
16fc8bc1 | 3 | @endif@ |
8b485e91 | 4 | |
4bad6412 | 5 | CFLAGS= |
773391f4 | 6 | CC=gcc |
91bf3d57 | 7 | LEX=flex |
1a935a31 | 8 | MFLAGS= |
4bad6412 | 9 | |
53eff0a9 | 10 | @sinclude@ @includel@$(INCPATH)defaults.mk@includel@ |
866f59c9 CP |
11 | @sinclude@ @includel@$(INCPATH)settings.mk@includel@ |
12 | ||
c5f04094 CP |
13 | @ifeq@${HOOKS_NEW}@ifeqsep@1@ifeqend@ |
14 | HOOK_ENGINE=old | |
15 | @else@ | |
16 | HOOK_ENGINE=new | |
17 | @endif@ | |
18 | ||
19 | # if USE_VALGRIND == 1 | |
20 | @ifeq@${USE_VALGRIND}@ifeqsep@1@ifeqend@ | |
21 | CFLAGS+=-DUSE_VALGRIND | |
22 | SSTRING_ENGINE=valgrind | |
23 | ||
73ae62df CP |
24 | ## if SSTRING_NEW == 1 |
25 | @ifeq@${SSTRING_NEW}@ifeqsep@1@ifeqend@ | |
c5f04094 | 26 | IMPOSSIBLE="USE_VALGRIND and SSTRING_NEW" |
73ae62df | 27 | @endif@ # SSTRING_NEW == 1 |
c5f04094 | 28 | |
73ae62df CP |
29 | ## if SSTRING_MMAP == 1 |
30 | @ifeq@${SSTRING_MMAP}@ifeqsep@1@ifeqend@ | |
c5f04094 | 31 | IMPOSSIBLE="USE_VALGRIND and SSTRING_MMAP" |
73ae62df CP |
32 | @endif@ ## SSTRING_MMAP == 1 |
33 | @else@ # USE_VALGRIND == 1 | |
c5f04094 | 34 | |
73ae62df CP |
35 | ## if SSTRING_NEW == 1 |
36 | @ifeq@${SSTRING_NEW}@ifeqsep@1@ifeqend@ | |
c5f04094 | 37 | SSTRING_ENGINE=new |
73ae62df | 38 | @else@ ## SSTRING_NEW == 1 |
c5f04094 CP |
39 | SSTRING_ENGINE=old |
40 | ||
73ae62df CP |
41 | ### if SSTRING_MMAP == 1 |
42 | @ifeq@${SSTRING_MMAP}@ifeqsep@1@ifeqend@ | |
c5f04094 | 43 | IMPOSSIBLE="SSTRING_MMAP without SSTRING_NEW" |
73ae62df CP |
44 | @endif@ ### SSTRING_MMAP == 1 |
45 | @endif@ ## SSTRING_NEW == 1 | |
46 | @endif@ # USE_VALGRIND == 1 | |
c5f04094 CP |
47 | |
48 | @ifeq@${SSTRING_NEW}@ifeqsep@1@ifeqend@ | |
49 | HOOK_ENGINE=old | |
50 | @else@ | |
51 | HOOK_ENGINE=new | |
52 | @endif@ | |
53 | ||
54 | @ifdef@ IMPOSSIBLE | |
55 | @error@ impossible combination of settings: ${IMPOSSIBLE}@errorend@ | |
56 | @endif@ | |
57 | ||
16fc8bc1 | 58 | @ifndef@ BUILDID |
e147b4a2 | 59 | BUILDID @shell@ (hg id || echo "unknown") | sed -e "s/+ /-/;s/ /-/" @shellend@ |
16fc8bc1 | 60 | @endif@ |
1a935a31 | 61 | MFLAGS+=BUILDID=$(BUILDID) |
8b485e91 | 62 | |
ffc11f03 | 63 | .SUFFIXES: .so .y .l |
4bad6412 CP |
64 | |
65 | .o.so: | |
45cb2a9d | 66 | @-ldline-@ $(LDFLAGS) |
4bad6412 | 67 | |
ffc11f03 CP |
68 | .y.c: ; |
69 | ||
70 | .l.c: ; | |
71 | ||
78668b7c CP |
72 | .PHONY: checksettings default |
73 | ||
1a935a31 | 74 | @ifndef@ CHECKEDSETTINGS |
78668b7c CP |
75 | default: checksettings all |
76 | ||
77 | checksettings: | |
96a7a31c CP |
78 | @touch ${INCPATH}/settings.mk |
79 | @test -f ${INCPATH}/.settings.mk || cp ${INCPATH}/settings.mk ${INCPATH}/.settings.mk | |
80 | @diff ${INCPATH}/.settings.mk ${INCPATH}/settings.mk >/dev/null || $(MAKE) -e FORCECHECK=1 realchecksettings | |
78668b7c CP |
81 | |
82 | realchecksettings: | |
83 | ||
84 | @ifdef@ FORCECHECK | |
85 | @error@ you must run make clean if you change settings.mk@errorend@ | |
86 | @endif@ | |
1a935a31 CP |
87 | @endif@ |
88 | MFLAGS+=CHECKEDSETTINGS=1 | |
78668b7c | 89 | |
4bad6412 CP |
90 | CFLAGS+=-Wall -g -finline-functions -funroll-loops -std=c99 -I./ -DBUILDID=$(BUILDID) |
91 | CFLAGS+=-fPIC -export-dynamic |