]>
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 | ifndef BUILDID | |
17 | BUILDID = $(shell (hg id || echo "unknown") | sed -e "s/[()]//g;s/+ /+/g;s/ /-/g" ) | |
18 | endif | |
19 | MFLAGS+=BUILDID=$(BUILDID) | |
20 | ||
21 | default: all | |
22 | ||
23 | .SUFFIXES: .so .y .l | |
24 | ||
25 | -include $(wildcard .deps/*.d) | |
26 | ||
27 | .c.o: | |
28 | @if [ ! -d .deps ]; then mkdir .deps || true; fi | |
29 | $(CC) $(CFLAGS) -MMD -MF .deps/$(subst .o,.d,$@) -c -o $@ $< | |
30 | ||
31 | .o.so: | |
32 | $(CC) -nostartfiles -Wl,--export-dynamic -shared -o $@ $^ $(LDFLAGS) | |
33 | ||
34 | .y.c: ; | |
35 | ||
36 | .l.c: ; | |
37 | ||
38 | CFLAGS+=-I./ -DBUILDID=$(BUILDID) -fPIC | |
39 | CFLAGS+=-Wall -g -finline-functions -funroll-loops -Werror=format-security | |
40 | ||
41 | ifndef NOC99 | |
42 | CFLAGS+=-std=c99 | |
43 | endif |