mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 14:52:40 +01:00
47 lines
972 B
Makefile
47 lines
972 B
Makefile
|
ifdef DEBUG
|
||
|
CPPFLAGS = -fPIC -ggdb -Wall -DDEBUG
|
||
|
else
|
||
|
CPPFLAGS = -fPIC -g -Wall -O3 -minline-all-stringops
|
||
|
endif
|
||
|
|
||
|
ifdef PROFILE
|
||
|
CPPFLAGS += -pg
|
||
|
endif
|
||
|
|
||
|
all: xhpast
|
||
|
|
||
|
clean:
|
||
|
-rm xhpast parser.yacc.cpp scanner.lex.cpp scanner.lex.hpp parser.yacc.output parser.yacc.hpp libxhpast.a *.o 2>/dev/null
|
||
|
|
||
|
install: xhpast
|
||
|
cp xhpast ../../src/staticanalysis/parsers/xhpast/bin/
|
||
|
|
||
|
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
|
||
|
|
||
|
node_names.hpp: generate_nodes.php
|
||
|
php -f generate_nodes.php
|
||
|
|
||
|
%.o: %.cpp
|
||
|
$(CXX) -c $(CPPFLAGS) -o $@ $<
|
||
|
|
||
|
parser.yacc.o: scanner.lex.hpp
|
||
|
|
||
|
scanner.lex.o: parser.yacc.hpp node_names.hpp
|
||
|
|
||
|
libxhpast.a: astnode.o scanner.lex.o parser.yacc.o
|
||
|
$(AR) -crs $@ $^
|
||
|
|
||
|
xhpast: xhpast.cpp libxhpast.a
|
||
|
$(CXX) $(CPPFLAGS) -o $@ $^
|
||
|
|
||
|
.PHONY: all clean tags
|