OSDN Git Service

34dea83f166a76b49928e2d9e2b0b8891d5d0552
[android-x86/hardware-intel-common-vaapi.git] / src / Makefile.am
1 # Copyright (c) 2007 Intel Corporation. All Rights Reserved.
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the
5 # "Software"), to deal in the Software without restriction, including
6 # without limitation the rights to use, copy, modify, merge, publish,
7 # distribute, sub license, and/or sell copies of the Software, and to
8 # permit persons to whom the Software is furnished to do so, subject to
9 # the following conditions:
10
11 # The above copyright notice and this permission notice (including the
12 # next paragraph) shall be included in all copies or substantial portions
13 # of the Software.
14
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
18 # IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
19 # ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23 SUBDIRS         = shaders
24 DIST_SUBDIRS    = $(SUBDIRS)
25 EXTRA_DIST      =
26 BUILT_SOURCES   =
27
28 AM_CPPFLAGS = \
29         -DPTHREADS              \
30         $(DRM_CFLAGS)           \
31         $(LIBVA_DEPS_CFLAGS)    \
32         -DVA_DRIVERS_PATH="\"$(LIBVA_DRIVERS_PATH)\"" \
33         $(NULL)
34
35 driver_cflags = \
36         -Wall                   \
37         -fvisibility=hidden     \
38         $(NULL)
39
40 driver_ldflags = \
41         -avoid-version          \
42         -no-undefined           \
43         -Wl,--no-undefined      \
44         $(NULL)
45
46 driver_libs = \
47         -lpthread -lm -ldl      \
48         $(DRM_LIBS)             \
49         $(NULL)
50
51 include Makefile.sources
52
53 # convenience library that can be linked by driver and tests
54 noinst_LTLIBRARIES              = libi965_drv_video.la
55 libi965_drv_video_la_CFLAGS     = $(driver_cflags)
56 libi965_drv_video_la_LDFLAGS    = $(driver_ldflags)
57 libi965_drv_video_la_LIBADD     = $(driver_libs)
58 libi965_drv_video_la_SOURCES    = $(source_c)
59
60 # driver module
61 i965_drv_video_la_LTLIBRARIES   = i965_drv_video.la
62 i965_drv_video_ladir            = $(LIBVA_DRIVERS_PATH)
63 i965_drv_video_la_CFLAGS        = $(driver_cflags)
64 i965_drv_video_la_LDFLAGS       = -module $(driver_ldflags)
65 i965_drv_video_la_LIBADD        = libi965_drv_video.la $(driver_libs)
66 i965_drv_video_la_SOURCES       =
67
68 noinst_HEADERS                  = $(source_h)
69
70 if USE_X11
71 source_c                        += i965_output_dri.c
72 source_h                        += i965_output_dri.h
73 endif
74
75 if USE_WAYLAND
76 source_c                        += i965_output_wayland.c
77 source_h                        += i965_output_wayland.h
78 source_h                        += $(protocol_source_h)
79 driver_cflags                   += $(WAYLAND_CLIENT_CFLAGS)
80 endif
81
82 # git version
83 VERSION_FILE                    = .VERSION
84 OLD_VERSION_FILE                = $(VERSION_FILE).old
85 NEW_VERSION_FILE                = $(VERSION_FILE).new
86 PKG_VERSION_FILE                = $(VERSION_FILE).pkg
87
88 intel_version.h: gen-version
89         $(AM_V_GEN)                                                      \
90         OV=`[ -f $(OLD_VERSION_FILE) ] && cat $(OLD_VERSION_FILE) || :`; \
91         NV=`cat $(NEW_VERSION_FILE)`;                                    \
92         if [ "$$OV" != "$$NV" -o ! -f intel_version.h ]; then            \
93                 cp -f $(NEW_VERSION_FILE) $(OLD_VERSION_FILE);           \
94                 $(SED) -e "s|\@INTEL_DRIVER_GIT_VERSION\@|$${NV}|"       \
95                         $(srcdir)/intel_version.h.in > intel_version.h;  \
96         fi
97
98 gen-version:
99         @echo $(VERSION) > $(NEW_VERSION_FILE)
100 if HAVE_GIT
101         @[ -d $(top_srcdir)/.git ] && \
102         (cd $(top_srcdir) && $(GIT) describe --tags) > $(NEW_VERSION_FILE) || :
103 endif
104         @[ -f $(srcdir)/$(PKG_VERSION_FILE) ] && \
105         cp -f $(srcdir)/$(PKG_VERSION_FILE) $(NEW_VERSION_FILE) || :
106
107 $(PKG_VERSION_FILE): $(NEW_VERSION_FILE)
108         @cp -f $< $@
109
110 BUILT_SOURCES   += intel_version.h
111 EXTRA_DIST      += Android.mk intel_version.h.in $(PKG_VERSION_FILE)
112
113 # Wayland protocol
114 if USE_WAYLAND
115 protocol_source_h = wayland-drm-client-protocol.h
116 i965_output_wayland.c: $(protocol_source_h)
117 %-client-protocol.h : %.xml
118         $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
119
120 BUILT_SOURCES += $(protocol_source_h)
121 endif
122
123 EXTRA_DIST += \
124         wayland-drm.xml         \
125         $(NULL)
126
127 CLEANFILES = $(BUILT_SOURCES)
128
129 # Extra clean files so that maintainer-clean removes *everything*
130 MAINTAINERCLEANFILES = Makefile.in config.h.in