mesa: Add MESA_SHADER_CAPTURE_PATH for writing .shader_test files.
[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 SUBDIRS = . main/tests
23
24 if HAVE_XLIB_GLX
25 SUBDIRS += drivers/x11
26 endif
27
28 if HAVE_DRICOMMON
29 SUBDIRS += drivers/dri
30 endif
31
32 if HAVE_OSMESA
33 SUBDIRS += drivers/osmesa
34 endif
35
36 gldir = $(includedir)/GL
37 gl_HEADERS = $(top_srcdir)/include/GL/*.h
38
39 include Makefile.sources
40
41 EXTRA_DIST = \
42 drivers/SConscript \
43 main/format_info.py \
44 main/format_pack.py \
45 main/format_parser.py \
46 main/format_unpack.py \
47 main/formats.csv \
48 main/get_hash_generator.py \
49 main/get_hash_params.py \
50 program/program_lexer.l \
51 program/program_parse.y \
52 SConscript \
53 swrast/NOTES \
54 swrast_setup/NOTES \
55 tnl/NOTES \
56 tnl_dd
57
58 BUILT_SOURCES = \
59 main/get_hash.h \
60 main/format_info.h \
61 main/format_pack.c \
62 main/format_unpack.c \
63 program/program_parse.tab.c \
64 program/lex.yy.c
65 CLEANFILES = \
66 $(BUILT_SOURCES) \
67 program/program_parse.tab.h
68
69 PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
70
71 main/get_hash.h: ../mapi/glapi/gen/gl_and_es_API.xml main/get_hash_params.py \
72 main/get_hash_generator.py
73 $(PYTHON_GEN) $(srcdir)/main/get_hash_generator.py \
74 -f $(srcdir)/../mapi/glapi/gen/gl_and_es_API.xml > $@
75
76 main/format_info.h: main/formats.csv \
77 main/format_parser.py main/format_info.py
78 $(PYTHON_GEN) $(srcdir)/main/format_info.py $(srcdir)/main/formats.csv > $@
79
80 main/format_pack.c: main/format_pack.py main/formats.csv \
81 main/format_parser.py
82 $(PYTHON_GEN) $(srcdir)/main/format_pack.py $(srcdir)/main/formats.csv > $@
83
84 main/format_unpack.c: main/format_unpack.py main/formats.csv \
85 main/format_parser.py
86 $(PYTHON_GEN) $(srcdir)/main/format_unpack.py $(srcdir)/main/formats.csv > $@
87
88 main/formats.c: main/format_info.h
89
90 noinst_LTLIBRARIES = $(ARCH_LIBS)
91 if NEED_LIBMESA
92 noinst_LTLIBRARIES += libmesa.la
93 else
94 check_LTLIBRARIES = libmesa.la
95 endif
96 if HAVE_GALLIUM
97 noinst_LTLIBRARIES += libmesagallium.la
98 endif
99
100 AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS)
101 AM_CFLAGS = \
102 $(LLVM_CFLAGS) \
103 $(VISIBILITY_CFLAGS) \
104 $(MSVC2013_COMPAT_CFLAGS)
105 AM_CXXFLAGS = \
106 $(LLVM_CFLAGS) \
107 $(VISIBILITY_CXXFLAGS) \
108 $(MSVC2013_COMPAT_CXXFLAGS)
109
110 ARCH_LIBS =
111
112 if SSE41_SUPPORTED
113 ARCH_LIBS += libmesa_sse41.la
114 endif
115
116 MESA_ASM_FILES_FOR_ARCH =
117
118 if HAVE_X86_ASM
119 noinst_PROGRAMS = gen_matypes
120
121 gen_matypes_SOURCES = x86/gen_matypes.c
122 BUILT_SOURCES += matypes.h
123
124 if HAVE_X86_64_ASM
125 MESA_ASM_FILES_FOR_ARCH += $(X86_64_FILES)
126 AM_CPPFLAGS += -I$(builddir)/x86-64 -I$(srcdir)/x86-64
127 else
128 MESA_ASM_FILES_FOR_ARCH += $(X86_FILES)
129 AM_CPPFLAGS += -I$(builddir)/x86 -I$(srcdir)/x86
130 endif
131 endif
132 if HAVE_SPARC_ASM
133 MESA_ASM_FILES_FOR_ARCH += $(SPARC_FILES)
134 AM_CPPFLAGS += -I$(builddir)/sparc -I$(srcdir)/sparc
135 endif
136
137 libmesa_la_SOURCES = \
138 $(MESA_FILES) \
139 $(PROGRAM_FILES) \
140 $(PROGRAM_NIR_FILES) \
141 $(MESA_ASM_FILES_FOR_ARCH)
142
143 libmesa_la_LIBADD = \
144 $(top_builddir)/src/compiler/glsl/libglsl.la \
145 $(ARCH_LIBS)
146
147 libmesagallium_la_SOURCES = \
148 $(MESA_GALLIUM_FILES) \
149 $(PROGRAM_FILES) \
150 $(PROGRAM_NIR_FILES) \
151 $(MESA_ASM_FILES_FOR_ARCH)
152
153 libmesagallium_la_LIBADD = \
154 $(top_builddir)/src/compiler/glsl/libglsl.la \
155 $(ARCH_LIBS)
156
157 libmesa_sse41_la_SOURCES = \
158 $(X86_SSE41_FILES)
159
160 libmesa_sse41_la_CFLAGS = $(AM_CFLAGS) $(SSE41_CFLAGS)
161
162 pkgconfigdir = $(libdir)/pkgconfig
163 pkgconfig_DATA = gl.pc
164
165 MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
166 YACC_GEN = $(AM_V_GEN)$(YACC) $(YFLAGS)
167 LEX_GEN = $(AM_V_GEN)$(LEX) $(LFLAGS)
168
169 program/lex.yy.c: program/program_lexer.l
170 $(MKDIR_GEN)
171 $(LEX_GEN) -o $@ $(srcdir)/program/program_lexer.l
172
173 program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y
174 $(MKDIR_GEN)
175 $(YACC_GEN) -o $@ -p "_mesa_program_" --defines=$(builddir)/program/program_parse.tab.h $(srcdir)/program/program_parse.y
176
177 if GEN_ASM_OFFSETS
178 matypes.h: $(gen_matypes_SOURCES)
179 $(AM_V_GEN)$(COMPILE) $< -DASM_OFFSETS -S -o - | \
180 sed -n '/^->/{s:^->::;/[$$]/{s:^:#define :;s:[$$]::};p}' > $@
181 else
182 matypes.h: gen_matypes
183 $(AM_V_GEN)./gen_matypes > $@
184 endif
185
186 # Emacs tags
187 tags:
188 etags `find . -name \*.[ch]` $(top_srcdir)/include/GL/*.h