1b8e80941Smrg# Copyright © 2016 Intel Corporation
2b8e80941Smrg# Copyright © 2016 Mauro Rossi <issor.oruam@gmail.com>
3b8e80941Smrg#
4b8e80941Smrg# Permission is hereby granted, free of charge, to any person obtaining a
5b8e80941Smrg# copy of this software and associated documentation files (the "Software"),
6b8e80941Smrg# to deal in the Software without restriction, including without limitation
7b8e80941Smrg# the rights to use, copy, modify, merge, publish, distribute, sublicense,
8b8e80941Smrg# and/or sell copies of the Software, and to permit persons to whom the
9b8e80941Smrg# Software is furnished to do so, subject to the following conditions:
10b8e80941Smrg#
11b8e80941Smrg# The above copyright notice and this permission notice shall be included
12b8e80941Smrg# in all copies or substantial portions of the Software.
13b8e80941Smrg#
14b8e80941Smrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15b8e80941Smrg# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16b8e80941Smrg# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17b8e80941Smrg# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18b8e80941Smrg# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19b8e80941Smrg# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20b8e80941Smrg# DEALINGS IN THE SOFTWARE.
21b8e80941Smrg#
22b8e80941Smrg
23b8e80941Smrg# ---------------------------------------
24b8e80941Smrg# Build libmesa_genxml
25b8e80941Smrg# ---------------------------------------
26b8e80941Smrg
27b8e80941Smrginclude $(CLEAR_VARS)
28b8e80941Smrg
29b8e80941SmrgLOCAL_MODULE := libmesa_genxml
30b8e80941Smrg
31b8e80941SmrgLOCAL_MODULE_CLASS := STATIC_LIBRARIES
32b8e80941Smrg
33b8e80941Smrgintermediates := $(call local-generated-sources-dir)
34b8e80941Smrg
35b8e80941Smrg# dummy.c source file is generated to meet the build system's rules.
36b8e80941SmrgLOCAL_GENERATED_SOURCES += $(intermediates)/dummy.c
37b8e80941Smrg
38b8e80941Smrg$(intermediates)/dummy.c:
39b8e80941Smrg	@mkdir -p $(dir $@)
40b8e80941Smrg	@echo "Gen Dummy: $(PRIVATE_MODULE) <= $(notdir $(@))"
41b8e80941Smrg	$(hide) touch $@
42b8e80941Smrg
43b8e80941Smrg# This is the list of auto-generated files headers
44b8e80941SmrgLOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, $(GENXML_GENERATED_FILES))
45b8e80941Smrg
46b8e80941Smrgdefine header-gen
47b8e80941Smrg	@mkdir -p $(dir $@)
48b8e80941Smrg	@echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
49b8e80941Smrg	$(hide) $(PRIVATE_SCRIPT) $(PRIVATE_SCRIPT_FLAGS) $(PRIVATE_XML) > $@
50b8e80941Smrgendef
51b8e80941Smrg
52b8e80941Smrg$(intermediates)/genxml/genX_bits.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_bits_header.py
53b8e80941Smrg$(intermediates)/genxml/genX_bits.h: PRIVATE_SCRIPT_FLAGS := --cpp-guard=GENX_BITS_H
54b8e80941Smrg$(intermediates)/genxml/genX_bits.h: PRIVATE_XML := $(addprefix $(LOCAL_PATH)/,$(GENXML_XML_FILES))
55b8e80941Smrg$(intermediates)/genxml/genX_bits.h: $(LOCAL_PATH)/genxml/gen_bits_header.py
56b8e80941Smrg$(intermediates)/genxml/genX_bits.h: $(addprefix $(LOCAL_PATH)/,$(GENXML_XML_FILES))
57b8e80941Smrg	$(call header-gen)
58b8e80941Smrg
59b8e80941Smrg$(intermediates)/genxml/gen4_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
60b8e80941Smrg$(intermediates)/genxml/gen4_pack.h: PRIVATE_XML := $(LOCAL_PATH)/genxml/gen4.xml
61b8e80941Smrg$(intermediates)/genxml/gen4_pack.h: $(LOCAL_PATH)/genxml/gen4.xml $(LOCAL_PATH)/genxml/gen_pack_header.py
62b8e80941Smrg	$(call header-gen)
63b8e80941Smrg
64b8e80941Smrg$(intermediates)/genxml/gen45_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
65b8e80941Smrg$(intermediates)/genxml/gen45_pack.h: PRIVATE_XML := $(LOCAL_PATH)/genxml/gen45.xml
66b8e80941Smrg$(intermediates)/genxml/gen45_pack.h: $(LOCAL_PATH)/genxml/gen45.xml $(LOCAL_PATH)/genxml/gen_pack_header.py
67b8e80941Smrg	$(call header-gen)
68b8e80941Smrg
69b8e80941Smrg$(intermediates)/genxml/gen5_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
70b8e80941Smrg$(intermediates)/genxml/gen5_pack.h: PRIVATE_XML := $(LOCAL_PATH)/genxml/gen5.xml
71b8e80941Smrg$(intermediates)/genxml/gen5_pack.h: $(LOCAL_PATH)/genxml/gen5.xml $(LOCAL_PATH)/genxml/gen_pack_header.py
72b8e80941Smrg	$(call header-gen)
73b8e80941Smrg
74b8e80941Smrg$(intermediates)/genxml/gen6_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
75b8e80941Smrg$(intermediates)/genxml/gen6_pack.h: PRIVATE_XML := $(LOCAL_PATH)/genxml/gen6.xml
76b8e80941Smrg$(intermediates)/genxml/gen6_pack.h: $(LOCAL_PATH)/genxml/gen6.xml $(LOCAL_PATH)/genxml/gen_pack_header.py
77b8e80941Smrg	$(call header-gen)
78b8e80941Smrg
79b8e80941Smrg$(intermediates)/genxml/gen7_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
80b8e80941Smrg$(intermediates)/genxml/gen7_pack.h: PRIVATE_XML := $(LOCAL_PATH)/genxml/gen7.xml
81b8e80941Smrg$(intermediates)/genxml/gen7_pack.h: $(LOCAL_PATH)/genxml/gen7.xml $(LOCAL_PATH)/genxml/gen_pack_header.py
82b8e80941Smrg	$(call header-gen)
83b8e80941Smrg
84b8e80941Smrg$(intermediates)/genxml/gen75_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
85b8e80941Smrg$(intermediates)/genxml/gen75_pack.h: PRIVATE_XML := $(LOCAL_PATH)/genxml/gen75.xml
86b8e80941Smrg$(intermediates)/genxml/gen75_pack.h: $(LOCAL_PATH)/genxml/gen75.xml $(LOCAL_PATH)/genxml/gen_pack_header.py
87b8e80941Smrg	$(call header-gen)
88b8e80941Smrg
89b8e80941Smrg$(intermediates)/genxml/gen8_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
90b8e80941Smrg$(intermediates)/genxml/gen8_pack.h: PRIVATE_XML := $(LOCAL_PATH)/genxml/gen8.xml
91b8e80941Smrg$(intermediates)/genxml/gen8_pack.h: $(LOCAL_PATH)/genxml/gen8.xml $(LOCAL_PATH)/genxml/gen_pack_header.py
92b8e80941Smrg	$(call header-gen)
93b8e80941Smrg
94b8e80941Smrg$(intermediates)/genxml/gen9_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
95b8e80941Smrg$(intermediates)/genxml/gen9_pack.h: PRIVATE_XML := $(LOCAL_PATH)/genxml/gen9.xml
96b8e80941Smrg$(intermediates)/genxml/gen9_pack.h: $(LOCAL_PATH)/genxml/gen9.xml $(LOCAL_PATH)/genxml/gen_pack_header.py
97b8e80941Smrg	$(call header-gen)
98b8e80941Smrg
99b8e80941Smrg$(intermediates)/genxml/gen10_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
100b8e80941Smrg$(intermediates)/genxml/gen10_pack.h: PRIVATE_XML := $(LOCAL_PATH)/genxml/gen10.xml
101b8e80941Smrg$(intermediates)/genxml/gen10_pack.h: $(LOCAL_PATH)/genxml/gen10.xml $(LOCAL_PATH)/genxml/gen_pack_header.py
102b8e80941Smrg	$(call header-gen)
103b8e80941Smrg
104b8e80941Smrg$(intermediates)/genxml/gen11_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
105b8e80941Smrg$(intermediates)/genxml/gen11_pack.h: PRIVATE_XML := $(LOCAL_PATH)/genxml/gen11.xml
106b8e80941Smrg$(intermediates)/genxml/gen11_pack.h: $(LOCAL_PATH)/genxml/gen11.xml $(LOCAL_PATH)/genxml/gen_pack_header.py
107b8e80941Smrg	$(call header-gen)
108b8e80941Smrg
109b8e80941Smrg$(intermediates)/genxml/genX_xml.h: $(addprefix $(MESA_TOP)/src/intel/,$(GENXML_XML_FILES)) $(MESA_TOP)/src/intel/genxml/gen_zipped_file.py
110b8e80941Smrg	@mkdir -p $(dir $@)
111b8e80941Smrg	@echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
112b8e80941Smrg	$(hide) $(MESA_PYTHON2) $(MESA_TOP)/src/intel/genxml/gen_zipped_file.py $(addprefix $(MESA_TOP)/src/intel/,$(GENXML_XML_FILES)) > $@ || (rm -f $@; false)
113b8e80941Smrg
114b8e80941SmrgLOCAL_EXPORT_C_INCLUDE_DIRS := \
115b8e80941Smrg	$(MESA_TOP)/src/intel \
116b8e80941Smrg	$(intermediates)
117b8e80941Smrg
118b8e80941Smrginclude $(MESA_COMMON_MK)
119b8e80941Smrginclude $(BUILD_STATIC_LIBRARY)
120