tests/*/*.exp
tests/*/*.log
tests/*/*.sh
+/compiler.h
+/parser.h
+/parser_proc.h
+/validator.h
./lemon: lemon.c | lempar.c
-$(PHP_PSI_BUILDDIR)/src/parser_proc.c: $(PHP_PSI_SRCDIR)/src/parser_proc.y $(LEMON)
+$(PHP_PSI_SRCDIR)/src/parser_proc.c: $(PHP_PSI_SRCDIR)/src/parser_proc.y $(LEMON)
$(LEMON) -c $<
-$(PHP_PSI_BUILDDIR)/src/parser.c: $(PHP_PSI_SRCDIR)/src/parser.re
+$(PHP_PSI_SRCDIR)/src/parser.c: $(PHP_PSI_SRCDIR)/src/parser.re
$(RE2C) -o $@ $<
PHP_PSI_HEADERS=`(cd $PHP_PSI_SRCDIR/src && echo *.h)`
PHP_PSI_SOURCES=`(cd $PHP_PSI_SRCDIR && echo src/*.c)`
+ PHP_PSI_SOURCES="src/parser.c src/parser_proc.c"
PHP_NEW_EXTENSION(psi, $PHP_PSI_SOURCES, $ext_shared)
PHP_INSTALL_HEADERS(ext/psi, php_psi.h $PHP_PSI_HEADERS)
-CFLAGS += -g -D$(shell uname | tr a-z A-Z)
+PHP_INCLUDES := -I/Users/Mike/Sources/php-src.git/{.,main,includes,Zend,TSRM,ext}
+JIT_INCLUDES := -I/usr/local/include
+UNAME := $(shell uname | tr a-z A-Z)
+INCLUDES += $(PHP_INCLUDES) $(JIT_INCLUDES)
+CFLAGS += -g -D$(UNAME) $(INCLUDES)
+LDFLAGS += -ljit -ljitdynamic /usr/local/php7/lib/libphp7.dylib -Xlinker -rpath -Xlinker /usr/local/php7/lib
SOURCES := parser_proc.c parser.c validator.c compiler.c main.c
GENERATED_FILES := $(addsuffix .h, $(basename $(SOURCES)))
##
# Main test program
##
+$(SOURCES): Makefile
+
GENERATED_FILES += main
main: $(SOURCES)
#include "parser.h"
#include "validator.h"
-static int TRACE;
-
int main(int argc, char *argv[])
{
PSI_Parser P;
PSI_Validator V;
+ unsigned flags = 0;
- TRACE = !!getenv("TRACE");
+ if (getenv("TRACE")) {
+ flags |= PSI_PARSER_DEBUG;
+ }
- if (!PSI_ParserInit(&P, argv[1])) {
+ if (!PSI_ParserInit(&P, argv[1], flags)) {
perror("Failer to init parser");
return 1;
}
}
PHP_MSHUTDOWN_FUNCTION(psi)
{
- jit_context_t *ctx = PSI_G(context);
+ jit_context_t ctx = PSI_G(context);
jit_context_destroy(ctx);
-
+
UNREGISTER_INI_ENTRIES();
return SUCCESS;