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