1# Copyright © 2012 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
22TOP=$(top_srcdir)
23SRCDIR=$(top_srcdir)/src/mesa/
24BUILDDIR=$(top_builddir)/src/mesa/
25include ../sources.mak
26include ../../glsl/Makefile.sources
27
28noinst_PROGRAMS =
29
30AM_CPPFLAGS = \
31	$(INCLUDE_DIRS) \
32	$(API_DEFINES) \
33	$(DEFINES)
34
35AM_CFLAGS = $(CFLAGS_NOVISIBILITY) -DUSE_DRICORE
36AM_CXXFLAGS = $(CXXFLAGS_NOVISIBILITY) -DUSE_DRICORE
37AM_CCASFLAGS = $(CFLAGS_NOVISIBILITY) -DUSE_DRICORE
38
39libdricore@VERSION@_la_SOURCES = \
40	$(MESA_FILES) \
41	$(MESA_CXX_FILES) \
42	$(LIBGLCPP_GENERATED_FILES) \
43	$(LIBGLCPP_FILES) \
44	$(LIBGLSL_FILES) \
45	$(LIBGLSL_CXX_FILES) \
46	$(BUILTIN_COMPILER_GENERATED_CXX_FILES) \
47	$(top_builddir)/src/glsl/builtin_function.cpp
48libdricore@VERSION@_la_LDFLAGS = -version-number 1:0
49libdricore@VERSION@_la_LIBADD = libdricore-asm.la
50
51# This is separated from libdricore to avoid conflics in object
52# outputs between main/clip.c and sparc/clip.c.  The documented way to
53# do this is with the automake option subdir-objects, except that
54# option is broken in the presence of variable expansion in *_SOURCES.
55# I have no idea how that option is supposed to be usable as is.
56libdricore_asm_la_SOURCES =
57libdricore_asm_la_CCASFLAGS = $(AM_CCASFLAGS) -DWORKAROUND_AUTOMAKE_OBJ_FILE_CONFLICTS
58
59if HAVE_X86_ASM
60libdricore_asm_la_SOURCES += $(X86_FILES)
61libdricore_asm_la_CPPFLAGS = $(AM_CPPFLAGS) \
62        -I$(top_builddir)/src/mesa/x86 \
63        -I$(top_srcdir)/src/mesa/x86
64endif
65
66if HAVE_X86_64_ASM
67libdricore_asm_la_SOURCES += $(X86_64_FILES)
68libdricore_asm_la_CPPFLAGS = $(AM_CPPFLAGS) \
69        -I$(top_builddir)/src/mesa/x86-64 \
70        -I$(top_srcdir)/src/mesa/x86-64
71endif
72
73if HAVE_SPARC_ASM
74libdricore_asm_la_SOURCES += $(SPARC_FILES)
75libdricore_asm_la_CPPFLAGS = $(AM_CPPFLAGS) \
76        -I$(top_builddir)/src/mesa/sparc \
77        -I$(top_srcdir)/src/mesa/sparc
78endif
79
80if HAVE_DRI
81noinst_LTLIBRARIES = libdricore-asm.la
82lib_LTLIBRARIES = libdricore@VERSION@.la
83
84# Provide compatibility with scripts for the old Mesa build system for
85# a while by putting a link to the driver into /lib of the build tree.
86all-local: libdricore@VERSION@.la
87	$(MKDIR_P) $(top_builddir)/$(LIB_DIR);
88	ln -f .libs/libdricore@VERSION@.so.1.0.0 $(top_builddir)/$(LIB_DIR)/libdricore@VERSION@.so.1;
89	ln -sf libdricore@VERSION@.so.1 $(top_builddir)/$(LIB_DIR)/libdricore@VERSION@.so
90endif
91
92CLEANFILES = \
93	$(top_builddir)/$(LIB_DIR)/libdricore@VERSION@.so.1 \
94	$(top_builddir)/$(LIB_DIR)/libdricore@VERSION@.so
95
96-include $(DEPENDS)
97