michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: PARSER_SRCS = \ michael@0: header.py \ michael@0: typelib.py \ michael@0: xpidl.py \ michael@0: $(NULL) michael@0: michael@0: SDK_BINARY = \ michael@0: $(PARSER_SRCS) \ michael@0: $(IDL_PARSER_CACHE_DIR)/xpidllex.py \ michael@0: $(IDL_PARSER_CACHE_DIR)/xpidlyacc.py \ michael@0: $(NULL) michael@0: michael@0: SDK_BINARY_TARGET = xpidl-parser michael@0: michael@0: PLY_FILES = \ michael@0: $(topsrcdir)/other-licenses/ply/ply/__init__.py \ michael@0: $(topsrcdir)/other-licenses/ply/ply/lex.py \ michael@0: $(topsrcdir)/other-licenses/ply/ply/yacc.py \ michael@0: $(NULL) michael@0: michael@0: PLY_DEST = $(SDK_BIN_DIR)/ply michael@0: INSTALL_TARGETS += PLY michael@0: PLY_TARGET = xpidl-parser michael@0: michael@0: include $(topsrcdir)/config/rules.mk michael@0: michael@0: # Generate the PLY lexer and parser. michael@0: $(IDL_PARSER_CACHE_DIR)/xpidllex.py: $(PARSER_SRCS) $(PLY_FILES) michael@0: $(PYTHON_PATH) \ michael@0: $(PLY_INCLUDE) \ michael@0: $(srcdir)/header.py --cachedir=$(IDL_PARSER_CACHE_DIR) --regen michael@0: michael@0: # generating xpidllex.py generates xpidlyacc.py too michael@0: $(IDL_PARSER_CACHE_DIR)/xpidlyacc.py: $(IDL_PARSER_CACHE_DIR)/xpidllex.py michael@0: michael@0: check:: michael@0: $(PYTHON_PATH) \ michael@0: $(PLY_INCLUDE) \ michael@0: -I. \ michael@0: $(srcdir)/runtests.py michael@0: michael@0: garbage_files := \ michael@0: xpidllex.py \ michael@0: xpidllex.pyc \ michael@0: xpidlyacc.py \ michael@0: xpidlyacc.pyc \ michael@0: xpidl_debug \ michael@0: $(NULL) michael@0: michael@0: GARBAGE += $(addprefix $(IDL_PARSER_CACHE_DIR)/,$(garbage_files))