android: fix the building rules for Android 5.0
[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 main/format_info.py \
66 main/format_pack.py \
67 main/format_parser.py \
68 main/format_unpack.py \
69 main/formats.csv \
70 main/get_hash_generator.py \
71 main/get_hash_params.py \
72 program/program_lexer.l \
73 program/program_parse.y \
74 SConscript \
75 swrast/NOTES \
76 swrast_setup/NOTES \
77 tnl/NOTES \
78 tnl_dd
79
80 BUILT_SOURCES = \
81 main/get_hash.h \
82 main/format_info.h \
83 main/git_sha1.h \
84 main/format_pack.c \
85 main/format_unpack.c \
86 program/program_parse.tab.c \
87 program/lex.yy.c
88 CLEANFILES = \
89 $(BUILT_SOURCES) \
90 program/program_parse.tab.h \
91 main/git_sha1.h.tmp
92
93 GET_HASH_GEN = main/get_hash_generator.py
94
95 main/get_hash.h: ../mapi/glapi/gen/gl_and_es_API.xml main/get_hash_params.py \
96 $(GET_HASH_GEN)
97 $(AM_V_GEN)set -e; \
98 $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/$(GET_HASH_GEN) \
99 -f $< > $@.tmp; \
100 mv $@.tmp $@;
101
102 main/format_info.h: main/formats.csv \
103 main/format_parser.py main/format_info.py
104 $(AM_V_GEN)set -e; \
105 $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/main/format_info.py \
106 $< > $@.tmp; \
107 mv $@.tmp $@;
108
109 main/format_pack.c: main/format_pack.py main/formats.csv \
110 main/format_parser.py
111 $(AM_V_GEN)set -e; \
112 $(PYTHON2) $(PYTHON_FLAGS) \
113 $(srcdir)/main/format_pack.py \
114 $(srcdir)/main/formats.csv \
115 | $(INDENT) $(INDENT_FLAGS) > $@;
116
117 main/format_unpack.c: main/format_unpack.py main/formats.csv \
118 main/format_parser.py
119 $(AM_V_GEN)set -e; \
120 $(PYTHON2) $(PYTHON_FLAGS) \
121 $(srcdir)/main/format_unpack.py \
122 $(srcdir)/main/formats.csv \
123 | $(INDENT) $(INDENT_FLAGS) > $@;
124
125 main/formats.c: main/format_info.h
126
127 noinst_LTLIBRARIES = $(ARCH_LIBS)
128 if NEED_LIBMESA
129 noinst_LTLIBRARIES += libmesa.la
130 else
131 check_LTLIBRARIES = libmesa.la
132 endif
133 if HAVE_GALLIUM
134 noinst_LTLIBRARIES += libmesagallium.la
135 endif
136
137 AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS)
138 AM_CFLAGS = \
139 $(LLVM_CFLAGS) \
140 $(VISIBILITY_CFLAGS) \
141 $(MSVC2013_COMPAT_CFLAGS)
142 AM_CXXFLAGS = \
143 $(LLVM_CFLAGS) \
144 $(VISIBILITY_CXXFLAGS) \
145 $(MSVC2013_COMPAT_CXXFLAGS)
146
147 ARCH_LIBS =
148
149 if SSE41_SUPPORTED
150 ARCH_LIBS += libmesa_sse41.la
151 endif
152
153 MESA_ASM_FILES_FOR_ARCH =
154
155 if HAVE_X86_ASM
156 noinst_PROGRAMS = gen_matypes
157
158 gen_matypes_SOURCES = x86/gen_matypes.c
159 BUILT_SOURCES += matypes.h
160
161 if HAVE_X86_64_ASM
162 MESA_ASM_FILES_FOR_ARCH += $(X86_64_FILES)
163 AM_CPPFLAGS += -I$(builddir)/x86-64 -I$(srcdir)/x86-64
164 else
165 MESA_ASM_FILES_FOR_ARCH += $(X86_FILES)
166 AM_CPPFLAGS += -I$(builddir)/x86 -I$(srcdir)/x86
167 endif
168 endif
169 if HAVE_SPARC_ASM
170 MESA_ASM_FILES_FOR_ARCH += $(SPARC_FILES)
171 AM_CPPFLAGS += -I$(builddir)/sparc -I$(srcdir)/sparc
172 endif
173
174 libmesa_la_SOURCES = \
175 $(MESA_FILES) \
176 $(PROGRAM_FILES) \
177 $(PROGRAM_NIR_FILES) \
178 $(MESA_ASM_FILES_FOR_ARCH)
179
180 libmesa_la_LIBADD = \
181 $(top_builddir)/src/glsl/libglsl.la \
182 $(ARCH_LIBS)
183
184 libmesagallium_la_SOURCES = \
185 $(MESA_GALLIUM_FILES) \
186 $(PROGRAM_FILES) \
187 $(PROGRAM_NIR_FILES) \
188 $(MESA_ASM_FILES_FOR_ARCH)
189
190 libmesagallium_la_LIBADD = \
191 $(top_builddir)/src/glsl/libglsl.la \
192 $(ARCH_LIBS)
193
194 libmesa_sse41_la_SOURCES = \
195 main/streaming-load-memcpy.c \
196 main/streaming-load-memcpy.h \
197 main/sse_minmax.c \
198 main/sse_minmax.h
199 libmesa_sse41_la_CFLAGS = $(AM_CFLAGS) $(SSE41_CFLAGS)
200
201 pkgconfigdir = $(libdir)/pkgconfig
202 pkgconfig_DATA = gl.pc
203
204 program/lex.yy.c: program/program_lexer.l
205 $(AM_V_at)$(MKDIR_P) program
206 $(AM_V_GEN) $(LEX) --never-interactive --outfile=$@ $<
207
208 program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y
209 $(AM_V_at)$(MKDIR_P) program
210 $(AM_V_GEN) $(YACC) -p "_mesa_program_" -v -d --output=program/program_parse.tab.c $<
211
212 if GEN_ASM_OFFSETS
213 matypes.h: $(gen_matypes_SOURCES)
214 $(AM_V_GEN)$(COMPILE) $< -DASM_OFFSETS -S -o - | \
215 sed -n '/^->/{s:^->::;/[$$]/{s:^:#define :;s:[$$]::};p}' > $@
216 else
217 matypes.h: gen_matypes
218 $(AM_V_GEN)./gen_matypes > $@
219 endif
220
221 # Emacs tags
222 tags:
223 etags `find . -name \*.[ch]` $(top_srcdir)/include/GL/*.h