anv: use the GENERATED_FILES variable
[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 include Makefile.sources
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
36 lib_LTLIBRARIES = libvulkan_intel.la
37
38 check_LTLIBRARIES = libvulkan-test.la
39
40 PER_GEN_LIBS = \
41 libanv-gen7.la \
42 libanv-gen75.la \
43 libanv-gen8.la \
44 libanv-gen9.la
45
46 noinst_LTLIBRARIES = $(PER_GEN_LIBS)
47
48 # The gallium includes are for the util/u_math.h include from main/macros.h
49
50 AM_CPPFLAGS = \
51 $(INTEL_CFLAGS) \
52 $(VALGRIND_CFLAGS) \
53 $(DEFINES) \
54 -I$(top_srcdir)/include \
55 -I$(top_srcdir)/src \
56 -I$(top_srcdir)/src/compiler \
57 -I$(top_srcdir)/src/mapi \
58 -I$(top_srcdir)/src/mesa \
59 -I$(top_srcdir)/src/mesa/drivers/dri/common \
60 -I$(top_srcdir)/src/mesa/drivers/dri/i965 \
61 -I$(top_srcdir)/src/gallium/auxiliary \
62 -I$(top_srcdir)/src/gallium/include \
63 -I$(top_srcdir)/src/intel/ \
64 -I$(top_builddir)/src \
65 -I$(top_builddir)/src/compiler \
66 -I$(top_builddir)/src/compiler/nir \
67 -I$(top_builddir)/src/intel
68
69 AM_CFLAGS = -DVK_USE_PLATFORM_XCB_KHR -Wno-override-init -msse2
70
71 VULKAN_SOURCES = \
72 $(VULKAN_GENERATED_FILES) \
73 $(VULKAN_FILES) \
74 $(VULKAN_WSI_X11_FILES)
75
76 BUILT_SOURCES = \
77 $(VULKAN_GENERATED_FILES)
78
79
80 libanv_gen7_la_CFLAGS = $(AM_CFLAGS) -DGEN_VERSIONx10=70
81 libanv_gen7_la_SOURCES = $(GEN7_FILES)
82
83 libanv_gen75_la_CFLAGS = $(AM_CFLAGS) -DGEN_VERSIONx10=75
84 libanv_gen75_la_SOURCES = $(GEN75_FILES)
85
86 libanv_gen8_la_CFLAGS = $(AM_CFLAGS) -DGEN_VERSIONx10=80
87 libanv_gen8_la_SOURCES = $(GEN8_FILES)
88
89 libanv_gen9_la_CFLAGS = $(AM_CFLAGS) -DGEN_VERSIONx10=90
90 libanv_gen9_la_SOURCES = $(GEN9_FILES)
91
92 if HAVE_EGL_PLATFORM_WAYLAND
93 BUILT_SOURCES += \
94 wayland-drm-protocol.c \
95 wayland-drm-client-protocol.h
96
97 %-protocol.c : $(top_srcdir)/src/egl/wayland/wayland-drm/%.xml
98 $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
99
100 %-client-protocol.h : $(top_srcdir)/src/egl/wayland/wayland-drm/%.xml
101 $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
102
103 AM_CPPFLAGS += -I$(top_srcdir)/src/egl/wayland/wayland-drm
104 VULKAN_SOURCES += \
105 wayland-drm-protocol.c \
106 $(VULKAN_WSI_WAYLAND_FILES)
107 AM_CFLAGS += -DHAVE_WAYLAND_PLATFORM -DVK_USE_PLATFORM_WAYLAND_KHR
108
109 VULKAN_ENTRYPOINT_CPPFLAGS += -DVK_USE_PLATFORM_WAYLAND_KHR
110 endif
111
112 noinst_LTLIBRARIES += libvulkan_common.la
113 libvulkan_common_la_SOURCES = $(VULKAN_SOURCES)
114
115 libvulkan_intel_la_SOURCES = $(VULKAN_GEM_FILES)
116
117 anv_entrypoints.h : anv_entrypoints_gen.py $(vulkan_include_HEADERS)
118 $(AM_V_GEN) cat $(vulkan_include_HEADERS) | $(CPP) $(VULKAN_ENTRYPOINT_CPPFLAGS) - | $(PYTHON2) $< header > $@
119
120 anv_entrypoints.c : anv_entrypoints_gen.py $(vulkan_include_HEADERS)
121 $(AM_V_GEN) cat $(vulkan_include_HEADERS) | $(CPP) $(VULKAN_ENTRYPOINT_CPPFLAGS) - | $(PYTHON2) $< code > $@
122
123 CLEANFILES = $(BUILT_SOURCES)
124
125 libvulkan_intel_la_LIBADD = $(WAYLAND_LIBS) \
126 libvulkan_common.la \
127 -lxcb -lxcb-dri3 -lxcb-present -lxcb-sync -lxshmfence \
128 $(top_builddir)/src/intel/isl/libisl.la \
129 $(top_builddir)/src/mesa/drivers/dri/i965/libi965_compiler.la \
130 $(top_builddir)/src/mesa/libmesa.la \
131 $(top_builddir)/src/mesa/drivers/dri/common/libdri_test_stubs.la \
132 -lpthread -ldl -lstdc++ \
133 $(PER_GEN_LIBS) \
134 -lm
135
136 libvulkan_intel_la_LDFLAGS = \
137 -shared \
138 -module \
139 -no-undefined \
140 -avoid-version \
141 $(GC_SECTIONS) \
142 $(LD_NO_UNDEFINED)
143
144
145 icdconfdir = @VULKAN_ICD_INSTALL_DIR@
146 icdconf_DATA = intel_icd.json
147 # The following is used for development purposes, by setting VK_ICD_FILENAMES.
148 noinst_DATA = dev_icd.json
149
150 dev_icd.json : dev_icd.json.in
151 $(AM_V_GEN) $(SED) \
152 -e "s#@build_libdir@#${abs_top_builddir}/${LIB_DIR}#"
153 < $(srcdir)/dev_icd.json.in > $@
154
155 # Libvulkan with dummy gem. Used for unit tests.
156 libvulkan_test_la_SOURCES = $(VULKAN_GEM_STUB_FILES)
157 libvulkan_test_la_LIBADD = $(libvulkan_intel_la_LIBADD)
158
159 include $(top_srcdir)/install-lib-links.mk
160
161 noinst_HEADERS = \
162 tests/state_pool_test_helper.h
163
164 LDADD = \
165 libvulkan-test.la \
166 $(PTHREAD_LIBS) -lm -lstdc++
167
168 check_PROGRAMS = \
169 tests/block_pool_no_free \
170 tests/state_pool_no_free \
171 tests/state_pool_free_list_only \
172 tests/state_pool
173
174 TESTS = $(check_PROGRAMS)