-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
41 lines (29 loc) · 1.42 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
C = gcc
CFLAGS = -g -O2 -fPIC -Wno-parentheses -Wno-macro-redefined -Wno-pointer-sign -Wno-tautological-compare -Wno-return-type -I/usr/local/include -I. -c
LDFLAGS = -L/usr/local/lib -g
LIBS = -lantlr3c
GEN_SRC = VaeQueryLanguageLexer.c VaeQueryLanguageParser.c VaeQueryLanguageTreeParser.c VaeQueryLanguage.tokens
GEN_HEADERS = VaeQueryLanguageLexer.h VaeQueryLanguageParser.h VaeQueryLanguageTreeParser.h
OBJS = VaeQueryLanguageLexer.o VaeQueryLanguageParser.o VaeQueryLanguageTreeParser.o
HEADERS = ${GEN_HEADERS}
default: vaeql.so
clean:
$(RM) vaeql *.o *.so
generate: VaeQueryLanguage.g VaeQueryLanguageTreeParser.g
java -classpath vendor/antlr-3.2.jar org.antlr.Tool VaeQueryLanguage.g VaeQueryLanguageTreeParser.g
install: install-vaeql.so
install-vaeql.so: vaeql.so
mkdir -p `php-config --extension-dir`
sudo cp vaeql.so `php-config --extension-dir`
php_vaeql.o: php_vaeql.c
${C} `php-config --includes` ${CFLAGS} php_vaeql.c
vaeql.o: vaeql.c
${C} ${CFLAGS} vaeql.c
vaeql.so: ${OBJS} php_vaeql.o
${C} ${LDFLAGS} -shared -fPIC -Wl,-undefined,dynamic_lookup php_vaeql.o ${OBJS} ${LIBS} -o vaeql.so
VaeQueryLanguageLexer.o: ${HEADERS} VaeQueryLanguageLexer.c
${C} ${CFLAGS} VaeQueryLanguageLexer.c
VaeQueryLanguageParser.o: ${HEADERS} VaeQueryLanguageParser.c
${C} ${CFLAGS} VaeQueryLanguageParser.c
VaeQueryLanguageTreeParser.o: ${HEADERS} VaeQueryLanguageTreeParser.c
${C} ${CFLAGS} VaeQueryLanguageTreeParser.c