38dbeb85f2572a8f8a01ad7d212c5493fc2c53f8
[mesa.git] / src / gallium / targets / osmesa / Makefile.am
1 #
2 # Permission is hereby granted, free of charge, to any person obtaining a
3 # copy of this software and associated documentation files (the "Software"),
4 # to deal in the Software without restriction, including without limitation
5 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
6 # and/or sell copies of the Software, and to permit persons to whom the
7 # Software is furnished to do so, subject to the following conditions:
8 #
9 # The above copyright notice and this permission notice (including the next
10 # paragraph) shall be included in all copies or substantial portions of the
11 # Software.
12 #
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 # DEALINGS IN THE SOFTWARE.
21
22 include $(top_srcdir)/src/gallium/Automake.inc
23
24 AM_CFLAGS = $(GALLIUM_CFLAGS)
25
26 AM_CPPFLAGS = \
27 -I$(top_srcdir)/include \
28 -I$(top_srcdir)/src/mapi \
29 -I$(top_srcdir)/src/mesa \
30 -I$(top_srcdir)/src/gallium/include \
31 -I$(top_srcdir)/src/gallium/drivers \
32 -I$(top_srcdir)/src/gallium/winsys \
33 -I$(top_srcdir)/src/gallium/auxiliary \
34 -DGALLIUM_SOFTPIPE \
35 -DGALLIUM_TRACE
36
37 lib_LTLIBRARIES = lib@OSMESA_LIB@.la
38
39 lib@OSMESA_LIB@_la_SOURCES = target.c
40
41 lib@OSMESA_LIB@_la_LDFLAGS = -module -version-number @OSMESA_VERSION@ -no-undefined
42
43 GLAPI_LIB = $(top_builddir)/src/mapi/glapi/libglapi.la
44 if HAVE_SHARED_GLAPI
45 GLAPI_LIB += $(top_builddir)/src/mapi/shared-glapi/libglapi.la
46 endif
47
48 lib@OSMESA_LIB@_la_LIBADD = \
49 $(top_builddir)/src/mesa/libmesagallium.la \
50 $(top_builddir)/src/gallium/auxiliary/libgallium.la \
51 $(top_builddir)/src/gallium/winsys/sw/null/libws_null.la \
52 $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
53 $(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la \
54 $(top_builddir)/src/gallium/state_trackers/osmesa/libosmesa.la \
55 $(GLAPI_LIB) \
56 $(OSMESA_LIB_DEPS) \
57 $(CLOCK_LIB)
58
59
60
61 if HAVE_MESA_LLVM
62 lib@OSMESA_LIB@_la_LINK = $(CXXLINK) $(lib@OSMESA_LIB@_la_LDFLAGS)
63 # Mention a dummy pure C++ file to trigger generation of the $(LINK) variable
64 nodist_EXTRA_lib@OSMESA_LIB@_la_SOURCES = dummy-cpp.cpp
65
66 lib@OSMESA_LIB@_la_LIBADD += $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la $(LLVM_LIBS)
67 AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
68 lib@OSMESA_LIB@_la_LDFLAGS += $(LLVM_LDFLAGS)
69 else
70 lib@OSMESA_LIB@_la_LINK = $(CXXLINK) $(lib@OSMESA_LIB@_la_LDFLAGS)
71 # Mention a dummy pure C file to trigger generation of the $(LINK) variable
72 nodist_EXTRA_lib@OSMESA_LIB@_la_SOURCES = dummy-c.c
73 endif
74
75
76
77 if BUILD_SHARED
78 # Provide compatibility with scripts for the old Mesa build system for
79 # a while by putting a link to the driver into /lib of the build tree.
80 all-local: lib@OSMESA_LIB@.la
81 $(MKDIR_P) $(top_builddir)/$(LIB_DIR);
82 $(MKDIR_P) $(top_builddir)/$(LIB_DIR)/gallium;
83 ln -f .libs/lib@OSMESA_LIB@.so $(top_builddir)/$(LIB_DIR)/gallium/lib@OSMESA_LIB@.so;
84 ln -f .libs/lib@OSMESA_LIB@.so.@OSMESA_VERSION@ $(top_builddir)/$(LIB_DIR)/gallium/lib@OSMESA_LIB@.so.@OSMESA_VERSION@;
85 cp .libs/lib@OSMESA_LIB@.so.@OSMESA_VERSION@.0.0 $(top_builddir)/$(LIB_DIR)/gallium/
86 endif
87
88 # XXX fix-up?
89 #pkgconfigdir = $(libdir)/pkgconfig
90 #pkgconfig_DATA = osmesa.pc