271b0a5079b2d7af5907dd19c5d413fb11be7f0e
[mesa.git] / src / intel / Makefile.vulkan.am
1 # Copyright © 2015 Intel Corporation
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the "Software"),
5 # to deal in the Software without restriction, including without limitation
6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 # and/or sell copies of the Software, and to permit persons to whom the
8 # Software is furnished to do so, subject to the following conditions:
9 #
10 # The above copyright notice and this permission notice (including the next
11 # paragraph) shall be included in all copies or substantial portions of the
12 # Software.
13 #
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 # IN THE SOFTWARE.
21
22 # Due to a what seems like a autoconf bug, we must ensure that the genaration
23 # rules must be outside of any AM_CONDITIONALs. Otherwise they will be commented
24 # out and we'll fail at `make dist'
25 vulkan_api_xml = $(top_srcdir)/src/vulkan/registry/vk.xml
26 vk_android_native_buffer_xml = $(top_srcdir)/src/vulkan/registry/vk_android_native_buffer.xml
27
28 vulkan/anv_entrypoints.c: vulkan/anv_entrypoints_gen.py \
29 vulkan/anv_extensions.py \
30 $(vulkan_api_xml) \
31 $(vk_android_native_buffer_xml)
32 $(MKDIR_GEN)
33 $(AM_V_GEN)$(PYTHON2) $(srcdir)/vulkan/anv_entrypoints_gen.py \
34 --xml $(vulkan_api_xml) \
35 --xml $(vk_android_native_buffer_xml) \
36 --outdir $(builddir)/vulkan
37 vulkan/anv_entrypoints.h: vulkan/anv_entrypoints.c
38
39 vulkan/anv_extensions.c: vulkan/anv_extensions.py \
40 $(vulkan_api_xml) \
41 $(vk_android_native_buffer_xml)
42 $(MKDIR_GEN)
43 $(AM_V_GEN)$(PYTHON2) $(srcdir)/vulkan/anv_extensions.py \
44 --xml $(vulkan_api_xml) \
45 --xml $(vk_android_native_buffer_xml) \
46 --out $@
47
48 BUILT_SOURCES += $(VULKAN_GENERATED_FILES)
49 CLEANFILES += \
50 $(VULKAN_GENERATED_FILES) \
51 vulkan/dev_icd.json \
52 vulkan/intel_icd.@host_cpu@.json
53
54 EXTRA_DIST += \
55 $(top_srcdir)/include/vulkan/vk_icd.h \
56 vulkan/anv_entrypoints_gen.py \
57 vulkan/anv_extensions.py \
58 vulkan/anv_icd.py \
59 vulkan/TODO
60
61 vulkan/dev_icd.json : vulkan/anv_extensions.py vulkan/anv_icd.py
62 $(AM_V_GEN)$(PYTHON2) $(srcdir)/vulkan/anv_icd.py \
63 --lib-path="${abs_top_builddir}/${LIB_DIR}" --out $@
64
65 vulkan/intel_icd.@host_cpu@.json : vulkan/anv_extensions.py vulkan/anv_icd.py
66 $(AM_V_GEN)$(PYTHON2) $(srcdir)/vulkan/anv_icd.py \
67 --lib-path="${libdir}" --out $@
68
69 if HAVE_INTEL_VULKAN
70
71 vulkan_includedir = $(includedir)/vulkan
72
73 noinst_HEADERS += \
74 $(top_srcdir)/include/vulkan/vk_platform.h \
75 $(top_srcdir)/include/vulkan/vulkan.h
76
77 vulkan_include_HEADERS = \
78 $(top_srcdir)/include/vulkan/vulkan_intel.h
79
80 lib_LTLIBRARIES += vulkan/libvulkan_intel.la
81
82 check_LTLIBRARIES += vulkan/libvulkan-test.la
83
84 VULKAN_PER_GEN_LIBS = \
85 vulkan/libanv-gen7.la \
86 vulkan/libanv-gen75.la \
87 vulkan/libanv-gen8.la \
88 vulkan/libanv-gen9.la \
89 vulkan/libanv-gen10.la
90
91 noinst_LTLIBRARIES += $(VULKAN_PER_GEN_LIBS)
92
93 VULKAN_CFLAGS = \
94 $(AM_CFLAGS) \
95 -msse2
96
97 VULKAN_CPPFLAGS = \
98 -I$(top_srcdir)/src/compiler \
99 -I$(top_srcdir)/src/intel/compiler \
100 -I$(top_srcdir)/include/drm-uapi \
101 -I$(top_builddir)/src/intel/vulkan \
102 -I$(top_srcdir)/src/intel/vulkan \
103 -I$(top_srcdir)/src/vulkan/wsi \
104 -I$(top_builddir)/src/vulkan/util \
105 -I$(top_srcdir)/src/vulkan/util \
106 $(AM_CPPFLAGS) \
107 $(LIBDRM_CFLAGS)
108
109 vulkan_libanv_gen7_la_CFLAGS = $(VULKAN_CFLAGS)
110 vulkan_libanv_gen7_la_CPPFLAGS = $(VULKAN_CPPFLAGS) -DGEN_VERSIONx10=70
111 vulkan_libanv_gen7_la_SOURCES = $(VULKAN_GEN7_FILES)
112
113 vulkan_libanv_gen75_la_CFLAGS = $(VULKAN_CFLAGS)
114 vulkan_libanv_gen75_la_CPPFLAGS = $(VULKAN_CPPFLAGS) -DGEN_VERSIONx10=75
115 vulkan_libanv_gen75_la_SOURCES = $(VULKAN_GEN75_FILES)
116
117 vulkan_libanv_gen8_la_CFLAGS = $(VULKAN_CFLAGS)
118 vulkan_libanv_gen8_la_CPPFLAGS = $(VULKAN_CPPFLAGS) -DGEN_VERSIONx10=80
119 vulkan_libanv_gen8_la_SOURCES = $(VULKAN_GEN8_FILES)
120
121 vulkan_libanv_gen9_la_CFLAGS = $(VULKAN_CFLAGS)
122 vulkan_libanv_gen9_la_CPPFLAGS = $(VULKAN_CPPFLAGS) -DGEN_VERSIONx10=90
123 vulkan_libanv_gen9_la_SOURCES = $(VULKAN_GEN9_FILES)
124
125 vulkan_libanv_gen10_la_CFLAGS = $(VULKAN_CFLAGS)
126 vulkan_libanv_gen10_la_CPPFLAGS = $(VULKAN_CPPFLAGS) -DGEN_VERSIONx10=100
127 vulkan_libanv_gen10_la_SOURCES = $(VULKAN_GEN10_FILES)
128
129 VULKAN_SOURCES = \
130 $(VULKAN_GENERATED_FILES) \
131 $(VULKAN_FILES)
132
133 VULKAN_LIB_DEPS = \
134 vulkan/libvulkan_common.la \
135 $(VULKAN_PER_GEN_LIBS) \
136 compiler/libintel_compiler.la \
137 common/libintel_common.la \
138 isl/libisl.la \
139 blorp/libblorp.la \
140 $(top_builddir)/src/vulkan/libvulkan_util.la \
141 $(top_builddir)/src/vulkan/libvulkan_wsi.la \
142 $(top_builddir)/src/compiler/nir/libnir.la \
143 $(top_builddir)/src/util/libmesautil.la \
144 $(LIBDRM_LIBS) \
145 $(PTHREAD_LIBS) \
146 $(DLOPEN_LIBS) \
147 -lm
148
149 if HAVE_PLATFORM_X11
150 VULKAN_CPPFLAGS += \
151 $(XCB_DRI3_CFLAGS) \
152 -DVK_USE_PLATFORM_XCB_KHR \
153 -DVK_USE_PLATFORM_XLIB_KHR
154
155 VULKAN_SOURCES += $(VULKAN_WSI_X11_FILES)
156
157 VULKAN_LIB_DEPS += $(XCB_DRI3_LIBS)
158 endif
159
160
161 if HAVE_PLATFORM_WAYLAND
162 VULKAN_CPPFLAGS += \
163 $(WAYLAND_CLIENT_CFLAGS) \
164 -DVK_USE_PLATFORM_WAYLAND_KHR
165
166 VULKAN_SOURCES += $(VULKAN_WSI_WAYLAND_FILES)
167
168 VULKAN_LIB_DEPS += $(WAYLAND_CLIENT_LIBS)
169 endif
170
171 noinst_LTLIBRARIES += vulkan/libvulkan_common.la
172 vulkan_libvulkan_common_la_SOURCES = $(VULKAN_SOURCES)
173 vulkan_libvulkan_common_la_CFLAGS = $(VULKAN_CFLAGS)
174 vulkan_libvulkan_common_la_CPPFLAGS = $(VULKAN_CPPFLAGS)
175
176 nodist_EXTRA_vulkan_libvulkan_intel_la_SOURCES = dummy.cpp
177 vulkan_libvulkan_intel_la_SOURCES = $(VULKAN_GEM_FILES)
178 vulkan_libvulkan_intel_la_LIBADD = $(VULKAN_LIB_DEPS)
179 vulkan_libvulkan_intel_la_CFLAGS = $(VULKAN_CFLAGS)
180 vulkan_libvulkan_intel_la_CPPFLAGS = $(VULKAN_CPPFLAGS)
181
182 vulkan_libvulkan_intel_la_LDFLAGS = \
183 -shared \
184 -module \
185 -no-undefined \
186 -avoid-version \
187 -Wl,--build-id=sha1 \
188 $(BSYMBOLIC) \
189 $(GC_SECTIONS) \
190 $(LD_NO_UNDEFINED)
191
192 icdconfdir = @VULKAN_ICD_INSTALL_DIR@
193 icdconf_DATA = vulkan/intel_icd.@host_cpu@.json
194 # The following is used for development purposes, by setting VK_ICD_FILENAMES.
195 noinst_DATA += vulkan/dev_icd.json
196
197 # Libvulkan with dummy gem. Used for unit tests.
198 vulkan_libvulkan_test_la_SOURCES = $(VULKAN_GEM_STUB_FILES)
199 vulkan_libvulkan_test_la_LIBADD = $(VULKAN_LIB_DEPS)
200 vulkan_libvulkan_test_la_CFLAGS = $(VULKAN_CFLAGS)
201 vulkan_libvulkan_test_la_CPPFLAGS = $(VULKAN_CPPFLAGS)
202
203 include $(top_srcdir)/install-lib-links.mk
204
205 noinst_HEADERS += \
206 vulkan/tests/state_pool_test_helper.h
207
208 VULKAN_TESTS = \
209 vulkan/tests/block_pool_no_free \
210 vulkan/tests/state_pool_no_free \
211 vulkan/tests/state_pool_free_list_only \
212 vulkan/tests/state_pool
213
214 VULKAN_TEST_LDADD = \
215 vulkan/libvulkan-test.la \
216 $(PTHREAD_LIBS) -lm -lstdc++
217
218 check_PROGRAMS += $(VULKAN_TESTS)
219 TESTS += $(VULKAN_TESTS)
220
221 vulkan_tests_block_pool_no_free_CPPFLAGS = $(VULKAN_CPPFLAGS)
222 vulkan_tests_block_pool_no_free_LDADD = $(VULKAN_TEST_LDADD)
223
224 vulkan_tests_state_pool_no_free_CPPFLAGS = $(VULKAN_CPPFLAGS)
225 vulkan_tests_state_pool_no_free_LDADD = $(VULKAN_TEST_LDADD)
226
227 vulkan_tests_state_pool_free_list_only_CPPFLAGS = $(VULKAN_CPPFLAGS)
228 vulkan_tests_state_pool_free_list_only_LDADD = $(VULKAN_TEST_LDADD)
229
230 vulkan_tests_state_pool_CPPFLAGS = $(VULKAN_CPPFLAGS)
231 vulkan_tests_state_pool_LDADD = $(VULKAN_TEST_LDADD)
232
233 endif