summaryrefslogtreecommitdiff
path: root/src/Makefile.am
blob: 8874c5ede71f0d514649d4a075663a1bec9d178d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# Copyright (c) 2007 Intel Corporation. All Rights Reserved.
#
# 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, sub license, 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 NON-INFRINGEMENT.
# IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.

SUBDIRS		= shaders
DIST_SUBDIRS	= $(SUBDIRS)
EXTRA_DIST	= meson.build
BUILT_SOURCES	=

AM_CPPFLAGS = \
	-DPTHREADS		\
	$(DRM_CFLAGS)		\
	$(LIBVA_DEPS_CFLAGS)	\
	-DVA_DRIVERS_PATH="\"$(LIBVA_DRIVERS_PATH)\"" \
	$(NULL)

driver_cflags = \
	-Wall			\
	-fvisibility=hidden	\
	$(NULL)

if USE_SSP
driver_cflags += -fstack-protector
endif

driver_ldflags = \
	-avoid-version		\
	-no-undefined		\
	-Wl,--no-undefined	\
	$(NULL)

driver_libs = \
	-lpthread -lm -ldl	\
	$(DRM_LIBS)		\
	$(NULL)

include Makefile.sources

# convenience library that can be linked by driver and tests
noinst_LTLIBRARIES		= libi965_drv_video.la
libi965_drv_video_la_CFLAGS	= $(driver_cflags)
libi965_drv_video_la_LDFLAGS	= $(driver_ldflags)
libi965_drv_video_la_LIBADD	= $(driver_libs)
libi965_drv_video_la_SOURCES	= $(source_c)

# driver module
i965_drv_video_la_LTLIBRARIES	= i965_drv_video.la
i965_drv_video_ladir		= $(LIBVA_DRIVERS_PATH)
i965_drv_video_la_CFLAGS	= $(driver_cflags)
i965_drv_video_la_LDFLAGS	= -module $(driver_ldflags)
i965_drv_video_la_LIBADD	= libi965_drv_video.la $(driver_libs)
i965_drv_video_la_SOURCES	=

noinst_HEADERS			= $(source_h)

if USE_X11
source_c			+= i965_output_dri.c
source_h			+= i965_output_dri.h
endif

if USE_WAYLAND
source_c			+= i965_output_wayland.c
source_h			+= i965_output_wayland.h
source_h			+= $(protocol_source_h)
driver_cflags			+= $(WAYLAND_CLIENT_CFLAGS)
endif

# git version
VERSION_FILE			= .VERSION
OLD_VERSION_FILE		= $(VERSION_FILE).old
NEW_VERSION_FILE		= $(VERSION_FILE).new
PKG_VERSION_FILE		= $(VERSION_FILE).pkg

intel_version.h: gen-version
	$(AM_V_GEN)							 \
	OV=`[ -f $(OLD_VERSION_FILE) ] && cat $(OLD_VERSION_FILE) || :`; \
	NV=`cat $(NEW_VERSION_FILE)`;					 \
	if [ "$$OV" != "$$NV" -o ! -f intel_version.h ]; then		 \
		cp -f $(NEW_VERSION_FILE) $(OLD_VERSION_FILE);		 \
		$(SED) -e "s|\@INTEL_DRIVER_GIT_VERSION\@|$${NV}|"	 \
			$(srcdir)/intel_version.h.in > intel_version.h;	 \
	fi

gen-version:
	@echo $(VERSION) > $(NEW_VERSION_FILE)
if HAVE_GIT
	@[ -d $(top_srcdir)/.git ] && \
	(cd $(top_srcdir) && $(GIT) describe --tags) > $(NEW_VERSION_FILE) || :
endif
	@[ -f $(srcdir)/$(PKG_VERSION_FILE) ] && \
	cp -f $(srcdir)/$(PKG_VERSION_FILE) $(NEW_VERSION_FILE) || :

$(PKG_VERSION_FILE): $(NEW_VERSION_FILE)
	@cp -f $< $@

BUILT_SOURCES	+= intel_version.h
EXTRA_DIST	+= Android.mk intel_version.h.in $(PKG_VERSION_FILE)

# Wayland protocol
if USE_WAYLAND
protocol_source_h = wayland-drm-client-protocol.h
i965_output_wayland.c: $(protocol_source_h)
%-client-protocol.h : %.xml
	$(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@

BUILT_SOURCES += $(protocol_source_h)
endif

EXTRA_DIST += \
	wayland-drm.xml         \
	$(NULL)

CLEANFILES = $(BUILT_SOURCES)

DISTCLEANFILES = \
	$(VERSION_FILE)	\
	$(OLD_VERSION_FILE)	\
	$(PKG_VERSION_FILE)	\
	$(NEW_VERSION_FILE)	\
	$(NULL)

# Extra clean files so that maintainer-clean removes *everything*
MAINTAINERCLEANFILES = Makefile.in config.h.in