]>
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 | 13 | @ifeq@${HOOKS_NEW}@ifeqsep@1@ifeqend@ |
c5f04094 | 14 | HOOK_ENGINE=new |
780b6d42 CP |
15 | @else@ |
16 | HOOK_ENGINE=old | |
c5f04094 CP |
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 | 47 | |
c5f04094 CP |
48 | @ifdef@ IMPOSSIBLE |
49 | @error@ impossible combination of settings: ${IMPOSSIBLE}@errorend@ | |
50 | @endif@ | |
51 | ||
16fc8bc1 | 52 | @ifndef@ BUILDID |
adc57810 | 53 | BUILDID @shell@ (hg id || echo "unknown") | sed -e "s/[()]//g;s/+ /+/g;s/ /-/g" @shellend@ |
16fc8bc1 | 54 | @endif@ |
1a935a31 | 55 | MFLAGS+=BUILDID=$(BUILDID) |
8b485e91 | 56 | |
ffc11f03 | 57 | .SUFFIXES: .so .y .l |
4bad6412 CP |
58 | |
59 | .o.so: | |
45cb2a9d | 60 | @-ldline-@ $(LDFLAGS) |
4bad6412 | 61 | |
ffc11f03 CP |
62 | .y.c: ; |
63 | ||
64 | .l.c: ; | |
65 | ||
78668b7c CP |
66 | .PHONY: checksettings default |
67 | ||
1a935a31 | 68 | @ifndef@ CHECKEDSETTINGS |
78668b7c CP |
69 | default: checksettings all |
70 | ||
71 | checksettings: | |
96a7a31c CP |
72 | @touch ${INCPATH}/settings.mk |
73 | @test -f ${INCPATH}/.settings.mk || cp ${INCPATH}/settings.mk ${INCPATH}/.settings.mk | |
74 | @diff ${INCPATH}/.settings.mk ${INCPATH}/settings.mk >/dev/null || $(MAKE) -e FORCECHECK=1 realchecksettings | |
78668b7c CP |
75 | |
76 | realchecksettings: | |
77 | ||
78 | @ifdef@ FORCECHECK | |
79 | @error@ you must run make clean if you change settings.mk@errorend@ | |
80 | @endif@ | |
1a935a31 CP |
81 | @endif@ |
82 | MFLAGS+=CHECKEDSETTINGS=1 | |
78668b7c | 83 | |
1613a824 CP |
84 | CFLAGS+=-Wall -g -finline-functions -funroll-loops |
85 | @ifndef@ NOC99 | |
86 | CFLAGS+=-std=c99 | |
87 | @endif@ | |
88 | CFLAGS+=-I./ -DBUILDID=$(BUILDID) -fPIC -export-dynamic |