3379a3d6a8998ceeefa9f4fcc8155e036392b475
[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.h
27
28 lib_LTLIBRARIES = libvulkan_radeon.la
29
30 # The gallium includes are for the util/u_math.h include from main/macros.h
31
32 AM_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
53 AM_CFLAGS = \
54 $(VISIBILITY_CFLAGS) \
55 $(PTHREAD_CFLAGS) \
56 $(LLVM_CFLAGS)
57
58 VULKAN_SOURCES = \
59 $(VULKAN_GENERATED_FILES) \
60 $(VULKAN_FILES)
61
62 VULKAN_LIB_DEPS =
63
64
65 if HAVE_PLATFORM_X11
66 AM_CPPFLAGS += \
67 $(XCB_DRI3_CFLAGS) \
68 -DVK_USE_PLATFORM_XCB_KHR \
69 -DVK_USE_PLATFORM_XLIB_KHR
70
71 VULKAN_SOURCES += $(VULKAN_WSI_X11_FILES)
72
73 # FIXME: Use pkg-config for X11-xcb ldflags.
74 VULKAN_LIB_DEPS += $(XCB_DRI3_LIBS) -lX11-xcb
75 endif
76
77
78 if HAVE_PLATFORM_WAYLAND
79 AM_CPPFLAGS += \
80 -I$(top_builddir)/src/egl/wayland/wayland-drm \
81 -I$(top_srcdir)/src/egl/wayland/wayland-drm \
82 $(WAYLAND_CFLAGS) \
83 -DVK_USE_PLATFORM_WAYLAND_KHR
84
85 VULKAN_SOURCES += $(VULKAN_WSI_WAYLAND_FILES)
86
87 VULKAN_LIB_DEPS += \
88 $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la \
89 $(WAYLAND_LIBS)
90 endif
91
92 noinst_LTLIBRARIES = libvulkan_common.la
93 libvulkan_common_la_SOURCES = $(VULKAN_SOURCES)
94
95 VULKAN_LIB_DEPS += \
96 libvulkan_common.la \
97 $(top_builddir)/src/vulkan/libvulkan_util.la \
98 $(top_builddir)/src/vulkan/libvulkan_wsi.la \
99 $(top_builddir)/src/amd/common/libamd_common.la \
100 $(top_builddir)/src/amd/addrlib/libamdgpu_addrlib.la \
101 $(top_builddir)/src/compiler/nir/libnir.la \
102 $(top_builddir)/src/util/libmesautil.la \
103 $(LLVM_LIBS) \
104 $(LIBELF_LIBS) \
105 $(PTHREAD_LIBS) \
106 $(AMDGPU_LIBS) \
107 $(LIBDRM_LIBS) \
108 $(PTHREAD_LIBS) \
109 $(DLOPEN_LIBS) \
110 -lm
111
112 nodist_EXTRA_libvulkan_radeon_la_SOURCES = dummy.cpp
113 libvulkan_radeon_la_SOURCES = $(VULKAN_GEM_FILES)
114
115 vulkan_api_xml = $(top_srcdir)/src/vulkan/registry/vk.xml
116
117 radv_entrypoints.h : radv_entrypoints_gen.py $(vulkan_api_xml)
118 $(AM_V_GEN) cat $(vulkan_api_xml) |\
119 $(PYTHON2) $(srcdir)/radv_entrypoints_gen.py header > $@
120
121 radv_entrypoints.c : radv_entrypoints_gen.py $(vulkan_api_xml)
122 $(AM_V_GEN) cat $(vulkan_api_xml) |\
123 $(PYTHON2) $(srcdir)/radv_entrypoints_gen.py code > $@
124
125 vk_format_table.c: vk_format_table.py \
126 vk_format_parse.py \
127 vk_format_layout.csv
128 $(PYTHON2) $(srcdir)/vk_format_table.py $(srcdir)/vk_format_layout.csv > $@
129
130 BUILT_SOURCES = $(VULKAN_GENERATED_FILES)
131 CLEANFILES = $(BUILT_SOURCES) dev_icd.json radeon_icd.@host_cpu@.json
132 EXTRA_DIST = \
133 $(top_srcdir)/include/vulkan/vk_icd.h \
134 dev_icd.json.in \
135 radeon_icd.json.in \
136 radv_entrypoints_gen.py \
137 vk_format_layout.csv \
138 vk_format_parse.py \
139 vk_format_table.py
140
141 libvulkan_radeon_la_LIBADD = $(VULKAN_LIB_DEPS)
142
143 libvulkan_radeon_la_LDFLAGS = \
144 -shared \
145 -module \
146 -no-undefined \
147 -avoid-version \
148 $(BSYMBOLIC) \
149 $(LLVM_LDFLAGS) \
150 $(GC_SECTIONS) \
151 $(LD_NO_UNDEFINED)
152
153
154 icdconfdir = @VULKAN_ICD_INSTALL_DIR@
155 icdconf_DATA = radeon_icd.@host_cpu@.json
156 # The following is used for development purposes, by setting VK_ICD_FILENAMES.
157 noinst_DATA = dev_icd.json
158
159 dev_icd.json : dev_icd.json.in
160 $(AM_V_GEN) $(SED) \
161 -e "s#@build_libdir@#${abs_top_builddir}/${LIB_DIR}#" \
162 < $(srcdir)/dev_icd.json.in > $@
163
164 radeon_icd.@host_cpu@.json : radeon_icd.json.in
165 $(AM_V_GEN) $(SED) \
166 -e "s#@install_libdir@#${libdir}#" \
167 < $(srcdir)/radeon_icd.json.in > $@
168
169 include $(top_srcdir)/install-lib-links.mk