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