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