Skip to content
This repository
tree: 17f05e1ecc
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 47 lines (32 sloc) 1.111 kb
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 42 43 44 45 46
ifdef DEBUG
CPPFLAGS = -fPIC -ggdb -Wall -DDEBUG
else
CPPFLAGS = -fPIC -g -Wall -O3 -minline-all-stringops
endif

ifdef PROFILE
CPPFLAGS += -pg
endif

all: libxhp.a libxhp.so

clean:
-rm libxhp.a xhpize parser.yacc.cpp scanner.lex.cpp scanner.lex.hpp parser.yacc.output parser.yacc.hpp fastpath.cpp *.o 2>/dev/null

parser.yacc.cpp: parser.y
bison --debug --verbose -d -o $@ $<

parser.yacc.hpp: parser.yacc.cpp

scanner.lex.cpp: scanner.l
`which flex35 2>/dev/null || which flex 2>/dev/null` \
-C --header-file=scanner.lex.hpp -o $@ -d $<

scanner.lex.hpp: scanner.lex.cpp

fastpath.cpp: fastpath.re
re2c -c -o $@ $<

%.o: %.cpp
$(CXX) -c $(CPPFLAGS) -o $@ $<

xhp_preprocess.o: xhp_preprocess.cpp scanner.lex.hpp parser.yacc.hpp
parser.yacc.o: scanner.lex.hpp
scanner.lex.o: parser.yacc.hpp

libxhp.a: code_rope.o scanner.lex.o parser.yacc.o fastpath.o xhp_preprocess.o
$(AR) -crs $@ $^

libxhp.so: code_rope.o scanner.lex.o parser.yacc.o fastpath.o xhp_preprocess.o
g++ -shared -Wl,-soname,libxhp.so -o libxhp.so $^

xhpize: xhpize.cpp libxhp.a
$(CXX) $(CPPFLAGS) -o $@ $^

.PHONY: all clean tags
Something went wrong with that request. Please try again.