meta/blit: Write depth only when asked for
[mesa.git] / src / mesa / Makefile.am
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
22 AUTOMAKE_OPTIONS = subdir-objects
23
24 SUBDIRS = . main/tests
25
26 if HAVE_X11_DRIVER
27 SUBDIRS += drivers/x11
28 endif
29
30 if HAVE_DRICOMMON
31 SUBDIRS += drivers/dri
32 endif
33
34 if HAVE_OSMESA
35 SUBDIRS += drivers/osmesa
36 endif
37
38 gldir = $(includedir)/GL
39 gl_HEADERS = $(top_srcdir)/include/GL/*.h
40
41 .PHONY: main/git_sha1.h.tmp
42 main/git_sha1.h.tmp:
43 @touch main/git_sha1.h.tmp
44 @if test -d $(top_srcdir)/.git; then \
45 if which git > /dev/null; then \
46 git --git-dir=$(top_srcdir)/.git log -n 1 --oneline | \
47 sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
48 > main/git_sha1.h.tmp ; \
49 fi \
50 fi
51
52 main/git_sha1.h: main/git_sha1.h.tmp
53 @echo "updating main/git_sha1.h"
54 @if ! cmp -s main/git_sha1.h.tmp main/git_sha1.h; then \
55 mv main/git_sha1.h.tmp main/git_sha1.h ;\
56 else \
57 rm main/git_sha1.h.tmp ;\
58 fi
59
60 include Makefile.sources
61
62 EXTRA_DIST = \
63 drivers/haiku \
64 drivers/SConscript \
65 drivers/windows \
66 main/format_info.py \
67 main/format_pack.py \
68 main/format_parser.py \
69 main/format_unpack.py \
70 main/formats.csv \
71 main/get_hash_generator.py \
72 main/get_hash_params.py \
73 program/program_lexer.l \
74 program/program_parse.y \
75 SConscript \
76 swrast/NOTES \
77 swrast_setup/NOTES \
78 tnl/NOTES \
79 tnl_dd
80
81 BUILT_SOURCES = \
82 main/get_hash.h \
83 main/format_info.c \
84 main/git_sha1.h \
85 main/format_pack.c \
86 main/format_unpack.c \
87 program/program_parse.tab.c \
88 program/lex.yy.c
89 CLEANFILES = \
90 $(BUILT_SOURCES) \
91 program/program_parse.tab.h \
92 main/git_sha1.h.tmp
93
94 GET_HASH_GEN = main/get_hash_generator.py
95
96 main/get_hash.h: ../mapi/glapi/gen/gl_and_es_API.xml main/get_hash_params.py \
97 $(GET_HASH_GEN) Makefile
98 $(AM_V_GEN)set -e; \
99 $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/$(GET_HASH_GEN) \
100 -f $< > $@.tmp; \
101 mv $@.tmp $@;
102
103 main/format_info.c: main/formats.csv \
104 main/format_parser.py main/format_info.py
105 $(AM_V_GEN)set -e; \
106 $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/main/format_info.py \
107 $< > $@.tmp; \
108 mv $@.tmp $@;
109
110 main/format_pack.c: main/format_pack.py main/formats.csv \
111 main/format_parser.py
112 $(AM_V_GEN)set -e; \
113 $(PYTHON2) $(PYTHON_FLAGS) \
114 $(srcdir)/main/format_pack.py \
115 $(srcdir)/main/formats.csv \
116 | $(INDENT) $(INDENT_FLAGS) > $@;
117
118 main/format_unpack.c: main/format_unpack.py main/formats.csv \
119 main/format_parser.py
120 $(AM_V_GEN)set -e; \
121 $(PYTHON2) $(PYTHON_FLAGS) \
122 $(srcdir)/main/format_unpack.py \
123 $(srcdir)/main/formats.csv \
124 | $(INDENT) $(INDENT_FLAGS) > $@;
125
126 main/formats.c: main/format_info.c
127
128 noinst_LTLIBRARIES = $(ARCH_LIBS)
129 if NEED_LIBMESA
130 noinst_LTLIBRARIES += libmesa.la
131 else
132 check_LTLIBRARIES = libmesa.la
133 endif
134 if HAVE_GALLIUM
135 noinst_LTLIBRARIES += libmesagallium.la
136 endif
137
138 AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS)
139 AM_CFLAGS = $(LLVM_CFLAGS) $(VISIBILITY_CFLAGS)
140 AM_CXXFLAGS = $(LLVM_CFLAGS) $(VISIBILITY_CXXFLAGS)
141
142 ARCH_LIBS =
143
144 if SSE41_SUPPORTED
145 ARCH_LIBS += libmesa_sse41.la
146 endif
147
148 MESA_ASM_FILES_FOR_ARCH =
149
150 if HAVE_X86_ASM
151 noinst_PROGRAMS = gen_matypes
152
153 gen_matypes_SOURCES = x86/gen_matypes.c
154 BUILT_SOURCES += matypes.h
155
156 if HAVE_X86_64_ASM
157 MESA_ASM_FILES_FOR_ARCH += $(X86_64_FILES)
158 AM_CPPFLAGS += -I$(builddir)/x86-64 -I$(srcdir)/x86-64
159 else
160 MESA_ASM_FILES_FOR_ARCH += $(X86_FILES)
161 AM_CPPFLAGS += -I$(builddir)/x86 -I$(srcdir)/x86
162 endif
163 endif
164 if HAVE_SPARC_ASM
165 MESA_ASM_FILES_FOR_ARCH += $(SPARC_FILES)
166 AM_CPPFLAGS += -I$(builddir)/sparc -I$(srcdir)/sparc
167 endif
168
169 libmesa_la_SOURCES = \
170 $(MESA_FILES) \
171 $(PROGRAM_FILES) \
172 $(MESA_ASM_FILES_FOR_ARCH)
173
174 libmesa_la_LIBADD = \
175 $(top_builddir)/src/glsl/libglsl.la \
176 $(ARCH_LIBS)
177
178 libmesagallium_la_SOURCES = \
179 $(MESA_GALLIUM_FILES) \
180 $(PROGRAM_FILES) \
181 $(MESA_ASM_FILES_FOR_ARCH)
182
183 libmesagallium_la_LIBADD = \
184 $(top_builddir)/src/glsl/libglsl.la \
185 $(ARCH_LIBS)
186
187 libmesa_sse41_la_SOURCES = \
188 main/streaming-load-memcpy.c \
189 main/streaming-load-memcpy.h \
190 main/sse_minmax.c \
191 main/sse_minmax.h
192 libmesa_sse41_la_CFLAGS = $(AM_CFLAGS) $(SSE41_CFLAGS)
193
194 pkgconfigdir = $(libdir)/pkgconfig
195 pkgconfig_DATA = gl.pc
196
197 program/lex.yy.c: program/program_lexer.l
198 $(AM_V_at)$(MKDIR_P) program
199 $(AM_V_GEN) $(LEX) --never-interactive --outfile=$@ $<
200
201 program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y
202 $(AM_V_at)$(MKDIR_P) program
203 $(AM_V_GEN) $(YACC) -p "_mesa_program_" -v -d --output=program/program_parse.tab.c $<
204
205 if GEN_ASM_OFFSETS
206 matypes.h: $(gen_matypes_SOURCES)
207 $(AM_V_GEN)$(COMPILE) $< -DASM_OFFSETS -S -o - | \
208 sed -n '/^->/{s:^->::;/[$$]/{s:^:#define :;s:[$$]::};p}' > $@
209 else
210 matypes.h: gen_matypes
211 $(AM_V_GEN)./gen_matypes > $@
212 endif
213
214 # Emacs tags
215 tags:
216 etags `find . -name \*.[ch]` $(top_srcdir)/include/GL/*.h