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