Home | History | Annotate | Download | only in slang
      1 #
      2 # Copyright (C) 2010 The Android Open Source Project
      3 #
      4 # Licensed under the Apache License, Version 2.0 (the "License");
      5 # you may not use this file except in compliance with the License.
      6 # You may obtain a copy of the License at
      7 #
      8 #      http://www.apache.org/licenses/LICENSE-2.0
      9 #
     10 # Unless required by applicable law or agreed to in writing, software
     11 # distributed under the License is distributed on an "AS IS" BASIS,
     12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 # See the License for the specific language governing permissions and
     14 # limitations under the License.
     15 #
     16 LOCAL_PATH := $(call my-dir)
     17 RS_SPEC_GEN := $(BUILD_OUT_EXECUTABLES)/rs-spec-gen$(BUILD_EXECUTABLE_SUFFIX)
     18 
     19 define generate-rs-spec-inc
     20 @mkdir -p $(dir $@)
     21 @echo "Host RSSpecGen: $(LOCAL_MODULE) (gen-$(1)) <= $<"
     22 $(hide) $(RS_SPEC_GEN) \
     23   -gen-$(strip $(1))  \
     24   > $@
     25 endef
     26 
     27 ifneq ($(strip $(TBLGEN_TABLES)),)
     28 
     29 ifneq ($(findstring RSClangBuiltinEnums.inc,$(RS_SPEC_TABLES)),)
     30 LOCAL_GENERATED_SOURCES += $(intermediates)/RSClangBuiltinEnums.inc
     31 $(intermediates)/RSClangBuiltinEnums.inc: $(RS_SPEC_GEN)
     32 	$(call generate-rs-spec-inc,clang-builtin-enums)
     33 endif
     34 
     35 ifneq ($(findstring RSDataTypeEnums.inc,$(RS_SPEC_TABLES)),)
     36 LOCAL_GENERATED_SOURCES += $(intermediates)/RSDataTypeEnums.inc
     37 $(intermediates)/RSDataTypeEnums.inc: $(RS_SPEC_GEN)
     38 	$(call generate-rs-spec-inc,rs-data-type-enums)
     39 endif
     40 
     41 ifneq ($(findstring RSMatrixTypeEnums.inc,$(RS_SPEC_TABLES)),)
     42 LOCAL_GENERATED_SOURCES += $(intermediates)/RSMatrixTypeEnums.inc
     43 $(intermediates)/RSMatrixTypeEnums.inc: $(RS_SPEC_GEN)
     44 	$(call generate-rs-spec-inc,rs-matrix-type-enums)
     45 endif
     46 
     47 ifneq ($(findstring RSObjectTypeEnums.inc,$(RS_SPEC_TABLES)),)
     48 LOCAL_GENERATED_SOURCES += $(intermediates)/RSObjectTypeEnums.inc
     49 $(intermediates)/RSObjectTypeEnums.inc: $(RS_SPEC_GEN)
     50 	$(call generate-rs-spec-inc,rs-object-type-enums)
     51 endif
     52 
     53 ifneq ($(findstring RSDataElementEnums.inc,$(RS_SPEC_TABLES)),)
     54 LOCAL_GENERATED_SOURCES += $(intermediates)/RSDataElementEnums.inc
     55 $(intermediates)/RSDataElementEnums.inc: $(RS_SPEC_GEN)
     56 	$(call generate-rs-spec-inc,rs-data-element-enums)
     57 endif
     58 
     59 endif
     60