android: vulkan: add support for libmesa_vulkan_util
[mesa.git] / src / vulkan / Makefile.am
index c816f97034f43e54aa2383df6a482ab53ba06d52..072e45e3469b966eaf7856ec88f3ee643cc670d3 100644 (file)
@@ -1,95 +1,66 @@
-# Copyright © 2015 Intel Corporation
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
+include Makefile.sources
 
+noinst_LTLIBRARIES = libvulkan_wsi.la libvulkan_util.la
 
 vulkan_includedir = $(includedir)/vulkan
+vulkan_api_xml = $(top_srcdir)/src/vulkan/registry/vk.xml
 
-vulkan_include_HEADERS =                               \
-       $(top_srcdir)/include/vulkan/vk_platform.h      \
-       $(top_srcdir)/include/vulkan/vulkan.h           \
-       $(top_srcdir)/include/vulkan/vulkan_intel.h     \
-       $(top_srcdir)/include/vulkan/vk_wsi_lunarg.h
+MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
+PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
 
-lib_LTLIBRARIES = libvulkan.la
+EXTRA_DIST = \
+       util/gen_enum_to_str.py
 
-# The gallium includes are for the util/u_math.h include from main/macros.h
+BUILT_SOURCES = \
+       util/vk_enum_to_str.c \
+       util/vk_enum_to_str.h
+
+util/vk_enum_to_str.c util/vk_enum_to_str.h: util/gen_enum_to_str.py $(vulkan_api_xml)
+       $(MKDIR_GEN)
+       $(PYTHON_GEN) $(srcdir)/util/gen_enum_to_str.py --outdir $(top_builddir)/src/vulkan/util
+
+libvulkan_util_la_SOURCES = $(VULKAN_UTIL_FILES)
 
 AM_CPPFLAGS = \
-       $(INTEL_CFLAGS) \
-       $(VALGRIND_CFLAGS) \
        $(DEFINES) \
        -I$(top_srcdir)/include \
        -I$(top_srcdir)/src \
-       -I$(top_srcdir)/src/mapi \
-       -I$(top_srcdir)/src/mesa \
-       -I$(top_srcdir)/src/mesa/drivers/dri/common \
-       -I$(top_srcdir)/src/mesa/drivers/dri/i965 \
        -I$(top_srcdir)/src/gallium/auxiliary \
-       -I$(top_srcdir)/src/gallium/include \
-       -I$(top_builddir)/src/vulkan
-
-libvulkan_la_CFLAGS =                                                  \
-       -Wall -Wextra -Wno-unused-parameter -fvisibility=hidden -O0 -g  \
-       -Wstrict-prototypes -Wmissing-prototypes -Wno-override-init
-
-libvulkan_la_CXXFLAGS =                                                        \
-       -Wall -Wextra -Wno-unused-parameter -fvisibility=hidden -O0 -g
-
-libvulkan_la_SOURCES =                                  \
-       anv_allocator.c                                 \
-       anv_aub.c                                       \
-       anv_cmd_buffer.c                                \
-       anv_batch_chain.c                               \
-       anv_compiler.cpp                                \
-       anv_device.c                                    \
-       anv_entrypoints.c                               \
-       anv_entrypoints.h                               \
-       anv_formats.c                                   \
-       anv_gem.c                                       \
-       anv_image.c                                     \
-       anv_intel.c                                     \
-       anv_meta.c                                      \
-       anv_pipeline.c                                  \
-       anv_private.h                                   \
-       anv_query.c                                     \
-       anv_util.c                                      \
-       anv_x11.c
-
-BUILT_SOURCES =                                         \
-       anv_entrypoints.h                               \
-       anv_entrypoints.c                               \
-       anv_meta_spirv.h
-
-anv_entrypoints.h : anv_entrypoints_gen.py $(vulkan_include_HEADERS)
-       $(AM_V_GEN)cat $(vulkan_include_HEADERS) | $(PYTHON2) $< header > $@
-
-anv_entrypoints.c : anv_entrypoints_gen.py $(vulkan_include_HEADERS)
-       $(AM_V_GEN)cat $(vulkan_include_HEADERS) | $(PYTHON2) $< code > $@
-
-%_spirv.h: %.c glsl_scraper.py
-       $(AM_V_GEN) $(PYTHON2) $(srcdir)/glsl_scraper.py --glsl-only -o $@ $<
-
-CLEANFILES = $(BUILT_SOURCES)
-
-libvulkan_la_LIBADD = -lxcb -lxcb-dri3 \
-       $(top_builddir)/src/mesa/drivers/dri/i965/libi965_compiler.la
-
-include $(top_srcdir)/install-lib-links.mk
+       -I$(top_srcdir)/src/gallium/include
+
+AM_CFLAGS = \
+       $(LIBDRM_CFLAGS) \
+       $(VISIBILITY_CFLAGS)
+
+VULKAN_LIB_DEPS =
+
+VULKAN_WSI_SOURCES = \
+       $(VULKAN_WSI_FILES)
+
+if HAVE_PLATFORM_X11
+AM_CPPFLAGS += \
+       $(XCB_DRI3_CFLAGS) \
+       -DVK_USE_PLATFORM_XCB_KHR \
+       -DVK_USE_PLATFORM_XLIB_KHR
+
+VULKAN_WSI_SOURCES += $(VULKAN_WSI_X11_FILES)
+
+# FIXME: Use pkg-config for X11-xcb ldflags.
+VULKAN_LIB_DEPS += $(XCB_DRI3_LIBS) -lX11-xcb
+endif
+
+if HAVE_PLATFORM_WAYLAND
+AM_CPPFLAGS += \
+       -I$(top_builddir)/src/egl/wayland/wayland-drm \
+       -I$(top_srcdir)/src/egl/wayland/wayland-drm \
+       $(WAYLAND_CFLAGS) \
+       -DVK_USE_PLATFORM_WAYLAND_KHR
+
+VULKAN_WSI_SOURCES += $(VULKAN_WSI_WAYLAND_FILES)
+
+VULKAN_LIB_DEPS += \
+       $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la \
+       $(WAYLAND_LIBS)
+endif
+
+libvulkan_wsi_la_SOURCES = $(VULKAN_WSI_SOURCES)