00b808229fa52531877e68ad67af524377fa97ea
[mesa.git] / src / amd / vulkan / Makefile.am
1 # Copyright © 2016 Red Hat
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 noinst_HEADERS = \
25 $(top_srcdir)/include/vulkan/vk_platform.h \
26 $(top_srcdir)/include/vulkan/vulkan_core.h \
27 $(top_srcdir)/include/vulkan/vulkan_wayland.h \
28 $(top_srcdir)/include/vulkan/vulkan_xcb.h \
29 $(top_srcdir)/include/vulkan/vulkan_xlib.h \
30 $(top_srcdir)/include/vulkan/vulkan.h
31
32 lib_LTLIBRARIES = libvulkan_radeon.la
33
34 # The gallium includes are for the util/u_math.h include from main/macros.h
35
36 AM_CPPFLAGS = \
37 -I$(top_srcdir)/include \
38 -I$(top_builddir)/src \
39 -I$(top_srcdir)/src \
40 -I$(top_srcdir)/src/vulkan/wsi \
41 -I$(top_builddir)/src/vulkan/util \
42 -I$(top_srcdir)/src/vulkan/util \
43 -I$(top_srcdir)/src/amd \
44 -I$(top_srcdir)/src/amd/common \
45 -I$(top_builddir)/src/compiler \
46 -I$(top_builddir)/src/compiler/nir \
47 -I$(top_srcdir)/src/compiler \
48 -I$(top_srcdir)/src/mapi \
49 -I$(top_srcdir)/src/mesa \
50 -I$(top_srcdir)/src/mesa/drivers/dri/common \
51 -I$(top_srcdir)/src/gallium/auxiliary \
52 -I$(top_srcdir)/src/gallium/include \
53 $(AMDGPU_CFLAGS) \
54 $(VALGRIND_CFLAGS) \
55 $(DEFINES)
56
57 AM_CFLAGS = \
58 $(VISIBILITY_CFLAGS) \
59 $(PTHREAD_CFLAGS) \
60 $(LLVM_CFLAGS)
61
62 VULKAN_SOURCES = \
63 $(VULKAN_GENERATED_FILES) \
64 $(VULKAN_FILES)
65
66 VULKAN_LIB_DEPS = \
67 libvulkan_common.la \
68 $(top_builddir)/src/vulkan/libvulkan_util.la \
69 $(top_builddir)/src/vulkan/libvulkan_wsi.la \
70 $(top_builddir)/src/amd/common/libamd_common.la \
71 $(top_builddir)/src/amd/addrlib/libamdgpu_addrlib.la \
72 $(top_builddir)/src/compiler/nir/libnir.la \
73 $(top_builddir)/src/util/libmesautil.la \
74 $(LLVM_LIBS) \
75 $(LIBELF_LIBS) \
76 $(PTHREAD_LIBS) \
77 $(AMDGPU_LIBS) \
78 $(LIBDRM_LIBS) \
79 $(PTHREAD_LIBS) \
80 $(DLOPEN_LIBS) \
81 -lm
82
83 if HAVE_PLATFORM_X11
84 AM_CPPFLAGS += \
85 $(XCB_DRI3_CFLAGS) \
86 -DVK_USE_PLATFORM_XCB_KHR \
87 -DVK_USE_PLATFORM_XLIB_KHR
88
89 VULKAN_SOURCES += $(VULKAN_WSI_X11_FILES)
90
91 VULKAN_LIB_DEPS += $(XCB_DRI3_LIBS)
92 endif
93
94
95 if HAVE_PLATFORM_WAYLAND
96 AM_CPPFLAGS += \
97 $(WAYLAND_CLIENT_CFLAGS) \
98 -DVK_USE_PLATFORM_WAYLAND_KHR
99
100 VULKAN_SOURCES += $(VULKAN_WSI_WAYLAND_FILES)
101
102 VULKAN_LIB_DEPS += \
103 $(WAYLAND_CLIENT_LIBS)
104 endif
105
106 if HAVE_PLATFORM_ANDROID
107 AM_CPPFLAGS += $(ANDROID_CPPFLAGS)
108 AM_CFLAGS += $(ANDROID_CFLAGS)
109 VULKAN_LIB_DEPS += $(ANDROID_LIBS)
110 VULKAN_SOURCES += $(VULKAN_ANDROID_FILES)
111 endif
112
113 noinst_LTLIBRARIES = libvulkan_common.la
114 libvulkan_common_la_SOURCES = $(VULKAN_SOURCES)
115
116 nodist_EXTRA_libvulkan_radeon_la_SOURCES = dummy.cpp
117 libvulkan_radeon_la_SOURCES = $(VULKAN_GEM_FILES)
118
119 vulkan_api_xml = $(top_srcdir)/src/vulkan/registry/vk.xml
120 vk_android_native_buffer_xml = $(top_srcdir)/src/vulkan/registry/vk_android_native_buffer.xml
121
122 radv_entrypoints.c: radv_entrypoints_gen.py radv_extensions.py $(vulkan_api_xml)
123 $(MKDIR_GEN)
124 $(AM_V_GEN)$(PYTHON2) $(srcdir)/radv_entrypoints_gen.py \
125 --xml $(vulkan_api_xml) \
126 --xml $(vk_android_native_buffer_xml) \
127 --outdir $(builddir)
128 radv_entrypoints.h: radv_entrypoints.c
129
130 radv_extensions.c: radv_extensions.py \
131 $(vulkan_api_xml)
132 $(MKDIR_GEN)
133 $(AM_V_GEN)$(PYTHON2) $(srcdir)/radv_extensions.py \
134 --xml $(vulkan_api_xml) \
135 --xml $(vk_android_native_buffer_xml) \
136 --out-c radv_extensions.c \
137 --out-h radv_extensions.h
138 radv_extensions.h: radv_extensions.c
139
140 vk_format_table.c: vk_format_table.py \
141 vk_format_parse.py \
142 vk_format_layout.csv
143 $(PYTHON2) $(srcdir)/vk_format_table.py $(srcdir)/vk_format_layout.csv > $@
144
145 BUILT_SOURCES = $(VULKAN_GENERATED_FILES)
146 CLEANFILES = $(BUILT_SOURCES) dev_icd.json radeon_icd.@host_cpu@.json
147 EXTRA_DIST = \
148 $(top_srcdir)/include/vulkan/vk_icd.h \
149 radv_entrypoints_gen.py \
150 radv_extensions.py \
151 radv_icd.py \
152 vk_format_layout.csv \
153 vk_format_parse.py \
154 vk_format_table.py \
155 meson.build
156
157 libvulkan_radeon_la_LIBADD = $(VULKAN_LIB_DEPS)
158
159 libvulkan_radeon_la_LDFLAGS = \
160 -shared \
161 -module \
162 -no-undefined \
163 -avoid-version \
164 $(BSYMBOLIC) \
165 $(LLVM_LDFLAGS) \
166 $(GC_SECTIONS) \
167 $(LD_NO_UNDEFINED)
168
169
170 icdconfdir = @VULKAN_ICD_INSTALL_DIR@
171 icdconf_DATA = radeon_icd.@host_cpu@.json
172 # The following is used for development purposes, by setting VK_ICD_FILENAMES.
173 noinst_DATA = dev_icd.json
174
175 dev_icd.json : radv_extensions.py radv_icd.py
176 $(AM_V_GEN)$(PYTHON2) $(srcdir)/radv_icd.py \
177 --lib-path="${abs_top_builddir}/${LIB_DIR}" --out $@
178
179 radeon_icd.@host_cpu@.json : radv_extensions.py radv_icd.py
180 $(AM_V_GEN)$(PYTHON2) $(srcdir)/radv_icd.py \
181 --lib-path="${libdir}" --out $@
182
183 include $(top_srcdir)/install-lib-links.mk