blob: ba9c01621f86076d2b46c73a7e66d2bd810b118e [file] [log] [blame]
Zonr Changa65ec162010-10-17 01:53:05 +08001#
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)
Raphael11e2b932011-01-13 15:13:35 -080017RS_SPEC_GEN := $(BUILD_OUT_EXECUTABLES)/rs-spec-gen$(BUILD_EXECUTABLE_SUFFIX)
Zonr Changa65ec162010-10-17 01:53:05 +080018
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
Zonr Changb1771ef2010-10-22 18:03:46 +080041ifneq ($(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
Zonr Changa65ec162010-10-17 01:53:05 +080047ifneq ($(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
Zonr Changa65ec162010-10-17 01:53:05 +080053ifneq ($(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