OSDN Git Service

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