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