diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-03-03 18:03:29 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-03-03 18:03:29 +0000 |
commit | 460ed38aa977fd9c4318ba8e67e65805cddad6bb (patch) | |
tree | c9b34d3db7985be071e699c127121e075728c09a | |
parent | 368faf835b45647bd1961a3a2321daa45ad31568 (diff) | |
parent | 9484e2e13ff9024a5498fbc4cf98f1750558dd6a (diff) | |
download | build-460ed38aa977fd9c4318ba8e67e65805cddad6bb.zip build-460ed38aa977fd9c4318ba8e67e65805cddad6bb.tar.gz build-460ed38aa977fd9c4318ba8e67e65805cddad6bb.tar.bz2 |
Merge "Extend YACC and LEX handling to .yy and .ll files."
-rw-r--r-- | core/binary.mk | 54 |
1 files changed, 42 insertions, 12 deletions
diff --git a/core/binary.mk b/core/binary.mk index d926c37..bb83126 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -452,22 +452,38 @@ endif # $(proto_sources) non-empty ########################################################### -## YACC: Compile .y files to .cpp and the to .o. +## YACC: Compile .y and .yy files to .cpp and the to .o. ########################################################### -yacc_sources := $(filter %.y,$(my_src_files)) -yacc_cpps := $(addprefix \ - $(intermediates)/,$(yacc_sources:.y=$(LOCAL_CPP_EXTENSION))) +y_yacc_sources := $(filter %.y,$(my_src_files)) +y_yacc_cpps := $(addprefix \ + $(intermediates)/,$(y_yacc_sources:.y=$(LOCAL_CPP_EXTENSION))) + +yy_yacc_sources := $(filter %.yy,$(my_src_files)) +yy_yacc_cpps := $(addprefix \ + $(intermediates)/,$(yy_yacc_sources:.yy=$(LOCAL_CPP_EXTENSION))) + +yacc_cpps := $(y_yacc_cpps) $(yy_yacc_cpps) yacc_headers := $(yacc_cpps:$(LOCAL_CPP_EXTENSION)=.h) yacc_objects := $(yacc_cpps:$(LOCAL_CPP_EXTENSION)=.o) -ifneq ($(strip $(yacc_cpps)),) -$(yacc_cpps): $(intermediates)/%$(LOCAL_CPP_EXTENSION): \ +ifneq ($(strip $(y_yacc_cpps)),) +$(y_yacc_cpps): $(intermediates)/%$(LOCAL_CPP_EXTENSION): \ $(TOPDIR)$(LOCAL_PATH)/%.y \ $(lex_cpps) $(LOCAL_ADDITIONAL_DEPENDENCIES) $(call transform-y-to-cpp,$(PRIVATE_CPP_EXTENSION)) $(yacc_headers): $(intermediates)/%.h: $(intermediates)/%$(LOCAL_CPP_EXTENSION) +endif + +ifneq ($(strip $(yy_yacc_cpps)),) +$(yy_yacc_cpps): $(intermediates)/%$(LOCAL_CPP_EXTENSION): \ + $(TOPDIR)$(LOCAL_PATH)/%.yy \ + $(lex_cpps) $(LOCAL_ADDITIONAL_DEPENDENCIES) + $(call transform-y-to-cpp,$(PRIVATE_CPP_EXTENSION)) +$(yacc_headers): $(intermediates)/%.h: $(intermediates)/%$(LOCAL_CPP_EXTENSION) +endif +ifneq ($(strip $(yacc_cpps)),) $(yacc_objects): PRIVATE_ARM_MODE := $(normal_objects_mode) $(yacc_objects): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags) $(yacc_objects): $(intermediates)/%.o: $(intermediates)/%$(LOCAL_CPP_EXTENSION) @@ -475,19 +491,33 @@ $(yacc_objects): $(intermediates)/%.o: $(intermediates)/%$(LOCAL_CPP_EXTENSION) endif ########################################################### -## LEX: Compile .l files to .cpp and then to .o. +## LEX: Compile .l and .ll files to .cpp and then to .o. ########################################################### -lex_sources := $(filter %.l,$(my_src_files)) -lex_cpps := $(addprefix \ - $(intermediates)/,$(lex_sources:.l=$(LOCAL_CPP_EXTENSION))) +l_lex_sources := $(filter %.l,$(my_src_files)) +l_lex_cpps := $(addprefix \ + $(intermediates)/,$(l_lex_sources:.l=$(LOCAL_CPP_EXTENSION))) + +ll_lex_sources := $(filter %.ll,$(my_src_files)) +ll_lex_cpps := $(addprefix \ + $(intermediates)/,$(ll_lex_sources:.ll=$(LOCAL_CPP_EXTENSION))) + +lex_cpps := $(l_lex_cpps) $(ll_lex_cpps) lex_objects := $(lex_cpps:$(LOCAL_CPP_EXTENSION)=.o) -ifneq ($(strip $(lex_cpps)),) -$(lex_cpps): $(intermediates)/%$(LOCAL_CPP_EXTENSION): \ +ifneq ($(strip $(l_lex_cpps)),) +$(l_lex_cpps): $(intermediates)/%$(LOCAL_CPP_EXTENSION): \ $(TOPDIR)$(LOCAL_PATH)/%.l $(transform-l-to-cpp) +endif +ifneq ($(strip $(ll_lex_cpps)),) +$(ll_lex_cpps): $(intermediates)/%$(LOCAL_CPP_EXTENSION): \ + $(TOPDIR)$(LOCAL_PATH)/%.ll + $(transform-l-to-cpp) +endif + +ifneq ($(strip $(lex_cpps)),) $(lex_objects): PRIVATE_ARM_MODE := $(normal_objects_mode) $(lex_objects): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags) $(lex_objects): $(intermediates)/%.o: \ |