RSSpec.mk revision 2b8fb64be3047df940a219872b331eb11de2758d
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#
16LOCAL_PATH := $(call my-dir)
17RS_SPEC_GEN := $(BUILD_OUT_EXECUTABLES)/rs-spec-gen$(BUILD_EXECUTABLE_SUFFIX)
18
19define 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  > $@
25endef
26
27ifneq ($(strip $(TBLGEN_TABLES)),)
28
29ifneq ($(findstring RSClangBuiltinEnums.inc,$(RS_SPEC_TABLES)),)
30LOCAL_GENERATED_SOURCES += $(intermediates)/RSClangBuiltinEnums.inc
31$(intermediates)/RSClangBuiltinEnums.inc: $(RS_SPEC_GEN)
32	$(call generate-rs-spec-inc,clang-builtin-enums)
33endif
34
35ifneq ($(findstring RSDataTypeEnums.inc,$(RS_SPEC_TABLES)),)
36LOCAL_GENERATED_SOURCES += $(intermediates)/RSDataTypeEnums.inc
37$(intermediates)/RSDataTypeEnums.inc: $(RS_SPEC_GEN)
38	$(call generate-rs-spec-inc,rs-data-type-enums)
39endif
40
41ifneq ($(findstring RSMatrixTypeEnums.inc,$(RS_SPEC_TABLES)),)
42LOCAL_GENERATED_SOURCES += $(intermediates)/RSMatrixTypeEnums.inc
43$(intermediates)/RSMatrixTypeEnums.inc: $(RS_SPEC_GEN)
44	$(call generate-rs-spec-inc,rs-matrix-type-enums)
45endif
46
47ifneq ($(findstring RSObjectTypeEnums.inc,$(RS_SPEC_TABLES)),)
48LOCAL_GENERATED_SOURCES += $(intermediates)/RSObjectTypeEnums.inc
49$(intermediates)/RSObjectTypeEnums.inc: $(RS_SPEC_GEN)
50	$(call generate-rs-spec-inc,rs-object-type-enums)
51endif
52
53ifneq ($(findstring RSDataElementEnums.inc,$(RS_SPEC_TABLES)),)
54LOCAL_GENERATED_SOURCES += $(intermediates)/RSDataElementEnums.inc
55$(intermediates)/RSDataElementEnums.inc: $(RS_SPEC_GEN)
56	$(call generate-rs-spec-inc,rs-data-element-enums)
57endif
58
59endif
60