mesa: remove conditional render and rgtc from ES3 requirements
[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_X11_DRIVER
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 .PHONY: $(BUILDDIR)main/git_sha1.h.tmp
40 $(BUILDDIR)main/git_sha1.h.tmp:
41 @touch main/git_sha1.h.tmp
42 @if test -d $(top_srcdir)/.git; then \
43 if which git > /dev/null; then \
44 git --git-dir=$(top_srcdir)/.git log -n 1 --oneline | \
45 sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
46 > main/git_sha1.h.tmp ; \
47 fi \
48 fi
49
50 $(BUILDDIR)main/git_sha1.h: $(BUILDDIR)main/git_sha1.h.tmp
51 @echo "updating main/git_sha1.h"
52 @if ! cmp -s main/git_sha1.h.tmp main/git_sha1.h; then \
53 mv main/git_sha1.h.tmp main/git_sha1.h ;\
54 else \
55 rm main/git_sha1.h.tmp ;\
56 fi
57
58 # include glapi_gen.mk for generating glapi headers for GLES
59 GLAPI = $(top_srcdir)/src/mapi/glapi/gen
60 include $(GLAPI)/glapi_gen.mk
61
62 BUILDDIR = $(builddir)/
63 include Makefile.sources
64
65 BUILT_SOURCES = \
66 main/get_hash.h \
67 main/format_info.c \
68 $(BUILDDIR)main/git_sha1.h \
69 $(BUILDDIR)program/program_parse.tab.c \
70 $(BUILDDIR)program/lex.yy.c
71 CLEANFILES = \
72 $(BUILT_SOURCES) \
73 $(BUILDDIR)program/program_parse.tab.h \
74 $(BUILDDIR)main/git_sha1.h.tmp
75
76 GET_HASH_GEN = main/get_hash_generator.py
77
78 main/get_hash.h: $(GLAPI)/gl_and_es_API.xml main/get_hash_params.py \
79 $(GET_HASH_GEN) Makefile
80 $(AM_V_GEN)set -e; \
81 $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/$(GET_HASH_GEN) \
82 -f $< > $@.tmp; \
83 mv $@.tmp $@;
84
85 main/format_info.c: main/formats.csv \
86 main/format_parser.py main/format_info.py
87 $(AM_V_GEN)set -e; \
88 $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/main/format_info.py \
89 $< > $@.tmp; \
90 mv $@.tmp $@;
91
92 main/formats.c: main/format_info.c
93
94 noinst_LTLIBRARIES = $(ARCH_LIBS)
95 if NEED_LIBMESA
96 noinst_LTLIBRARIES += libmesa.la
97 else
98 check_LTLIBRARIES = libmesa.la
99 endif
100 if HAVE_GALLIUM
101 noinst_LTLIBRARIES += libmesagallium.la
102 endif
103
104 AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS)
105 AM_CFLAGS = $(LLVM_CFLAGS) $(VISIBILITY_CFLAGS)
106 AM_CXXFLAGS = $(LLVM_CFLAGS) $(VISIBILITY_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 $(MESA_ASM_FILES_FOR_ARCH)
139
140 libmesa_la_LIBADD = \
141 $(top_builddir)/src/glsl/libglsl.la \
142 $(ARCH_LIBS)
143
144 libmesagallium_la_SOURCES = \
145 $(MESA_GALLIUM_FILES) \
146 $(PROGRAM_FILES) \
147 $(MESA_ASM_FILES_FOR_ARCH)
148
149 libmesagallium_la_LIBADD = \
150 $(top_builddir)/src/glsl/libglsl.la \
151 $(ARCH_LIBS)
152
153 libmesa_sse41_la_SOURCES = \
154 main/streaming-load-memcpy.c
155 libmesa_sse41_la_CFLAGS = $(AM_CFLAGS) -msse4.1
156
157 pkgconfigdir = $(libdir)/pkgconfig
158 pkgconfig_DATA = gl.pc
159
160 $(BUILDDIR)program/lex.yy.c: program/program_lexer.l
161 $(AM_V_at)$(MKDIR_P) program
162 $(AM_V_GEN) $(LEX) --never-interactive --outfile=$@ $<
163
164 $(BUILDDIR)program/program_parse.tab.c $(BUILDDIR)program/program_parse.tab.h: program/program_parse.y
165 $(AM_V_at)$(MKDIR_P) program
166 $(AM_V_GEN) $(YACC) -p "_mesa_program_" -v -d --output=$(BUILDDIR)program/program_parse.tab.c $<
167
168 if GEN_ASM_OFFSETS
169 matypes.h: $(gen_matypes_SOURCES)
170 $(AM_V_GEN)$(COMPILE) $< -DASM_OFFSETS -S -o - | \
171 sed -n '/^->/{s:^->::;/[$$]/{s:^:#define :;s:[$$]::};p}' > $@
172 else
173 matypes.h: gen_matypes
174 $(AM_V_GEN)./gen_matypes > $@
175 endif
176
177 # Emacs tags
178 tags:
179 etags `find . -name \*.[ch]` $(top_srcdir)/include/GL/*.h