gen/genX_pack: Add genxml to the pack header path
[mesa.git] / src / intel / vulkan / Makefile.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 SUBDIRS = . tests
23
24 vulkan_includedir = $(includedir)/vulkan
25
26 vulkan_include_HEADERS = \
27 $(top_srcdir)/include/vulkan/vk_platform.h \
28 $(top_srcdir)/include/vulkan/vulkan.h \
29 $(top_srcdir)/include/vulkan/vulkan_intel.h
30
31 # Used when generating entrypoints to filter out unwanted extensions
32 VULKAN_ENTRYPOINT_CPPFLAGS = \
33 -I$(top_srcdir)/include/vulkan \
34 -DVK_USE_PLATFORM_XCB_KHR \
35 -DVK_USE_PLATFORM_WAYLAND_KHR
36
37 lib_LTLIBRARIES = libvulkan_intel.la
38
39 check_LTLIBRARIES = libvulkan-test.la
40
41 PER_GEN_LIBS = \
42 libanv-gen7.la \
43 libanv-gen75.la \
44 libanv-gen8.la \
45 libanv-gen9.la
46
47 noinst_LTLIBRARIES = $(PER_GEN_LIBS)
48
49 # The gallium includes are for the util/u_math.h include from main/macros.h
50
51 AM_CPPFLAGS = \
52 $(INTEL_CFLAGS) \
53 $(VALGRIND_CFLAGS) \
54 $(DEFINES) \
55 -I$(top_srcdir)/include \
56 -I$(top_srcdir)/src \
57 -I$(top_srcdir)/src/compiler \
58 -I$(top_srcdir)/src/mapi \
59 -I$(top_srcdir)/src/mesa \
60 -I$(top_srcdir)/src/mesa/drivers/dri/common \
61 -I$(top_srcdir)/src/mesa/drivers/dri/i965 \
62 -I$(top_srcdir)/src/gallium/auxiliary \
63 -I$(top_srcdir)/src/gallium/include \
64 -I$(top_srcdir)/src/intel/ \
65 -I$(top_builddir)/src \
66 -I$(top_builddir)/src/compiler \
67 -I$(top_builddir)/src/compiler/nir \
68 -I$(top_builddir)/src/intel \
69 -I$(top_builddir)/src/vulkan
70
71 libvulkan_intel_la_CFLAGS = $(CFLAGS) -Wno-override-init
72
73 VULKAN_SOURCES = \
74 anv_allocator.c \
75 anv_cmd_buffer.c \
76 anv_batch_chain.c \
77 anv_descriptor_set.c \
78 anv_device.c \
79 anv_dump.c \
80 anv_entrypoints.c \
81 anv_entrypoints.h \
82 anv_formats.c \
83 anv_image.c \
84 anv_intel.c \
85 anv_meta.c \
86 anv_meta_blit.c \
87 anv_meta_clear.c \
88 anv_meta_resolve.c \
89 anv_nir_apply_dynamic_offsets.c \
90 anv_nir_apply_pipeline_layout.c \
91 anv_nir_lower_push_constants.c \
92 anv_pass.c \
93 anv_pipeline.c \
94 anv_pipeline_cache.c \
95 anv_private.h \
96 anv_query.c \
97 anv_util.c \
98 anv_wsi.c \
99 anv_wsi_x11.c
100
101 BUILT_SOURCES = \
102 anv_entrypoints.h \
103 anv_entrypoints.c
104
105 libanv_gen7_la_SOURCES = \
106 genX_cmd_buffer.c \
107 genX_pipeline.c \
108 gen7_cmd_buffer.c \
109 gen7_pipeline.c \
110 gen7_state.c
111 libanv_gen7_la_CFLAGS = $(libvulkan_intel_la_CFLAGS) -DGEN_VERSIONx10=70
112
113 libanv_gen75_la_SOURCES = \
114 genX_cmd_buffer.c \
115 genX_pipeline.c \
116 gen7_cmd_buffer.c \
117 gen7_pipeline.c \
118 gen7_state.c
119 libanv_gen75_la_CFLAGS = $(libvulkan_intel_la_CFLAGS) -DGEN_VERSIONx10=75
120
121 libanv_gen8_la_SOURCES = \
122 genX_cmd_buffer.c \
123 genX_pipeline.c \
124 gen8_cmd_buffer.c \
125 gen8_pipeline.c \
126 gen8_state.c
127 libanv_gen8_la_CFLAGS = $(libvulkan_intel_la_CFLAGS) -DGEN_VERSIONx10=80
128
129 libanv_gen9_la_SOURCES = \
130 genX_cmd_buffer.c \
131 genX_pipeline.c \
132 gen8_cmd_buffer.c \
133 gen8_pipeline.c \
134 gen8_state.c
135 libanv_gen9_la_CFLAGS = $(libvulkan_intel_la_CFLAGS) -DGEN_VERSIONx10=90
136
137 if HAVE_EGL_PLATFORM_WAYLAND
138 BUILT_SOURCES += \
139 wayland-drm-protocol.c \
140 wayland-drm-client-protocol.h
141
142 %-protocol.c : $(top_srcdir)/src/egl/wayland/wayland-drm/%.xml
143 $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
144
145 %-client-protocol.h : $(top_srcdir)/src/egl/wayland/wayland-drm/%.xml
146 $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
147
148 AM_CPPFLAGS += -I$(top_srcdir)/src/egl/wayland/wayland-drm
149 VULKAN_SOURCES += \
150 wayland-drm-protocol.c \
151 anv_wsi_wayland.c
152 libvulkan_intel_la_CFLAGS += -DHAVE_WAYLAND_PLATFORM
153 endif
154
155 libvulkan_intel_la_SOURCES = \
156 $(VULKAN_SOURCES) \
157 anv_gem.c
158
159 anv_entrypoints.h : anv_entrypoints_gen.py $(vulkan_include_HEADERS)
160 $(AM_V_GEN) cat $(vulkan_include_HEADERS) | $(CPP) $(VULKAN_ENTRYPOINT_CPPFLAGS) - | $(PYTHON2) $< header > $@
161
162 anv_entrypoints.c : anv_entrypoints_gen.py $(vulkan_include_HEADERS)
163 $(AM_V_GEN) cat $(vulkan_include_HEADERS) | $(CPP) $(VULKAN_ENTRYPOINT_CPPFLAGS) - | $(PYTHON2) $< code > $@
164
165 CLEANFILES = $(BUILT_SOURCES)
166
167 libvulkan_intel_la_LIBADD = $(WAYLAND_LIBS) -lxcb -lxcb-dri3 \
168 $(top_builddir)/src/intel/isl/libisl.la \
169 $(top_builddir)/src/mesa/drivers/dri/i965/libi965_compiler.la \
170 $(top_builddir)/src/mesa/libmesa.la \
171 $(top_builddir)/src/mesa/drivers/dri/common/libdri_test_stubs.la \
172 -lpthread -ldl -lstdc++ \
173 $(PER_GEN_LIBS)
174
175 libvulkan_intel_la_LDFLAGS = \
176 -module -avoid-version -shared -shrext .so
177
178
179 # Generate icd files. It would be nice to just be able to add these to
180 # AC_CONFIG_FILES, but @libdir@ typically expands to '${exec_prefix}/lib64',
181 # which we can't put in the icd file. When running sed from the Makefile we
182 # can use ${libdir}, which expands completely and we avoid putting Makefile
183 # variables in the icd file.
184
185 icdconfdir=$(sysconfdir)/vulkan/icd.d
186 icdconf_DATA = intel_icd.json
187 noinst_DATA = dev_icd.json
188
189 %.json : %.json.in
190 $(AM_V_GEN) $(SED) \
191 -e "s#@build_libdir@#${abs_top_builddir}/${LIB_DIR}#" \
192 -e "s#@install_libdir@#${libdir}#" < $< > $@
193
194
195 # Libvulkan with dummy gem. Used for unit tests.
196
197 libvulkan_test_la_SOURCES = \
198 $(VULKAN_SOURCES) \
199 anv_gem_stubs.c
200
201 libvulkan_test_la_CFLAGS = $(libvulkan_la_CFLAGS)
202 libvulkan_test_la_LIBADD = $(libvulkan_la_LIBADD)
203
204 include $(top_srcdir)/install-lib-links.mk