xref: /PHP-8.0/Zend/Makefile.frag (revision 4cbffd89)
1#
2# Zend
3#
4
5$(builddir)/zend_language_scanner.lo: $(srcdir)/zend_language_parser.h
6$(builddir)/zend_ini_scanner.lo: $(srcdir)/zend_ini_parser.h
7
8$(srcdir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.l
9	@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c Zend/zend_language_scanner.l)
10
11$(srcdir)/zend_language_parser.h: $(srcdir)/zend_language_parser.c
12$(srcdir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y
13# Tweak zendparse to be exported through ZEND_API. This has to be revisited once
14# bison supports foreign skeletons and that bison version is used. Read
15# https://git.savannah.gnu.org/cgit/bison.git/tree/data/README.md for more.
16	@$(YACC) $(YFLAGS) -v -d $(srcdir)/zend_language_parser.y -o $@
17	@$(SED) -e 's,^int zendparse\(.*\),ZEND_API int zendparse\1,g' < $@ \
18	> $@.tmp && \
19	mv $@.tmp $@
20	@$(SED) -e 's,^int zendparse\(.*\),ZEND_API int zendparse\1,g' < $(srcdir)/zend_language_parser.h \
21	> $(srcdir)/zend_language_parser.h.tmp && \
22	mv $(srcdir)/zend_language_parser.h.tmp $(srcdir)/zend_language_parser.h
23	@nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \
24	$(SED) -e "s/^#ifndef YYTOKENTYPE/#include \"zend.h\"\\$${nl}#ifndef YYTOKENTYPE/" < $(srcdir)/zend_language_parser.h \
25	> $(srcdir)/zend_language_parser.h.tmp && \
26	mv $(srcdir)/zend_language_parser.h.tmp $(srcdir)/zend_language_parser.h
27
28$(srcdir)/zend_ini_parser.h: $(srcdir)/zend_ini_parser.c
29$(srcdir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
30	$(YACC) $(YFLAGS) -v -d $(srcdir)/zend_ini_parser.y -o $@
31
32$(srcdir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
33	@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l)
34
35$(builddir)/zend_highlight.lo $(builddir)/zend_compile.lo: $(srcdir)/zend_language_parser.h
36
37Zend/zend_execute.lo: $(srcdir)/zend_vm_execute.h $(srcdir)/zend_vm_opcodes.h
38