Makefile.am 5.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# Copyright © 2012 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

22 23 24 25 26 27
SUBDIRS = . main/tests

# state tracker tests depend on libmesagallium.la
if HAVE_GALLIUM
SUBDIRS += state_tracker/tests
endif
Matt Turner's avatar
Matt Turner committed
28

29
if HAVE_XLIB_GLX
Matt Turner's avatar
Matt Turner committed
30 31 32
SUBDIRS += drivers/x11
endif

33
if HAVE_DRICOMMON
Matt Turner's avatar
Matt Turner committed
34 35 36 37 38 39
SUBDIRS += drivers/dri
endif

if HAVE_OSMESA
SUBDIRS += drivers/osmesa
endif
40

41 42
include Makefile.sources

43
EXTRA_DIST = \
44
	drivers/SConscript \
45 46 47
	main/meson.build \
	program/meson.build \
	meson.build \
48
	main/format_fallback.py \
49
	main/format_info.py \
50
	main/format_pack.py \
51
	main/format_parser.py \
52
	main/format_unpack.py \
53 54
	main/formats.csv \
	main/get_hash_generator.py \
55
	main/get_hash_params.py \
56 57
	program/program_lexer.l \
	program/program_parse.y \
58
	SConscript \
59 60 61
	swrast/NOTES \
	swrast_setup/NOTES \
	tnl/NOTES \
62
	tnl_dd
63

64
BUILT_SOURCES = \
65
	main/get_hash.h \
66
	main/format_fallback.c \
67
	main/format_info.h \
68
	main/format_pack.c \
69
	main/format_unpack.c \
70 71
	program/program_parse.tab.c \
	program/lex.yy.c
72 73
CLEANFILES = \
	$(BUILT_SOURCES) \
74
	program/program_parse.tab.h
75

76
PYTHON_GEN = $(AM_V_GEN)$(PYTHON) $(PYTHON_FLAGS)
77

78 79 80 81
main/get_hash.h: ../mapi/glapi/gen/gl_and_es_API.xml main/get_hash_params.py \
                 main/get_hash_generator.py
	$(PYTHON_GEN) $(srcdir)/main/get_hash_generator.py \
		-f $(srcdir)/../mapi/glapi/gen/gl_and_es_API.xml > $@
82

83 84 85 86 87
main/format_fallback.c: main/format_fallback.py \
                        main/format_parser.py \
	                main/formats.csv
	$(PYTHON_GEN) $(srcdir)/main/format_fallback.py $(srcdir)/main/formats.csv $@

88
main/format_info.h: main/formats.csv \
89
                    main/format_parser.py main/format_info.py
90
	$(PYTHON_GEN) $(srcdir)/main/format_info.py $(srcdir)/main/formats.csv > $@
91

92
main/format_pack.c: main/format_pack.py main/formats.csv \
93
                    main/format_parser.py
94
	$(PYTHON_GEN) $(srcdir)/main/format_pack.py $(srcdir)/main/formats.csv > $@
95

96 97
main/format_unpack.c: main/format_unpack.py main/formats.csv	\
                      main/format_parser.py
98
	$(PYTHON_GEN) $(srcdir)/main/format_unpack.py $(srcdir)/main/formats.csv > $@
99

100
main/formats.c: main/format_info.h
101

102
noinst_LTLIBRARIES = $(ARCH_LIBS)
103 104 105 106 107
if NEED_LIBMESA
noinst_LTLIBRARIES += libmesa.la
else
check_LTLIBRARIES = libmesa.la
endif
108 109 110
if HAVE_GALLIUM
noinst_LTLIBRARIES += libmesagallium.la
endif
111

112
AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS)
113
AM_CFLAGS = \
114
	$(VDPAU_CFLAGS) \
115 116 117 118 119 120 121
	$(LLVM_CFLAGS) \
	$(VISIBILITY_CFLAGS) \
	$(MSVC2013_COMPAT_CFLAGS)
AM_CXXFLAGS = \
	$(LLVM_CFLAGS) \
	$(VISIBILITY_CXXFLAGS) \
	$(MSVC2013_COMPAT_CXXFLAGS)
122

123 124 125 126 127 128
ARCH_LIBS =

if SSE41_SUPPORTED
ARCH_LIBS += libmesa_sse41.la
endif

129 130 131
MESA_ASM_FILES_FOR_ARCH =

if HAVE_X86_ASM
132 133 134 135 136
noinst_PROGRAMS = gen_matypes

gen_matypes_SOURCES = x86/gen_matypes.c
BUILT_SOURCES += matypes.h

137 138
if HAVE_X86_64_ASM
MESA_ASM_FILES_FOR_ARCH += $(X86_64_FILES)
139
AM_CPPFLAGS += -I$(builddir)/x86-64 -I$(srcdir)/x86-64
140 141 142 143
else
MESA_ASM_FILES_FOR_ARCH += $(X86_FILES)
AM_CPPFLAGS += -I$(builddir)/x86 -I$(srcdir)/x86
endif
144 145 146
endif
if HAVE_SPARC_ASM
MESA_ASM_FILES_FOR_ARCH += $(SPARC_FILES)
147
AM_CPPFLAGS += -I$(builddir)/sparc -I$(srcdir)/sparc
148 149 150 151
endif

libmesa_la_SOURCES = \
	$(MESA_FILES) \
152
	$(PROGRAM_FILES) \
153
	$(PROGRAM_NIR_FILES) \
154
	$(MESA_ASM_FILES_FOR_ARCH)
155

156
libmesa_la_LIBADD = \
Emil Velikov's avatar
Emil Velikov committed
157
	$(top_builddir)/src/compiler/glsl/libglsl.la \
158
	$(ARCH_LIBS)
159 160 161

libmesagallium_la_SOURCES = \
	$(MESA_GALLIUM_FILES) \
162
	$(PROGRAM_FILES) \
163
	$(PROGRAM_NIR_FILES) \
164
	$(MESA_ASM_FILES_FOR_ARCH)
165

166
libmesagallium_la_LIBADD = \
Emil Velikov's avatar
Emil Velikov committed
167
	$(top_builddir)/src/compiler/glsl/libglsl.la \
168
	$(ARCH_LIBS)
169

170
libmesa_sse41_la_SOURCES = \
171 172
	$(X86_SSE41_FILES)

173
libmesa_sse41_la_CFLAGS = $(AM_CFLAGS) $(SSE41_CFLAGS)
174

175 176 177 178
MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
YACC_GEN = $(AM_V_GEN)$(YACC) $(YFLAGS)
LEX_GEN = $(AM_V_GEN)$(LEX) $(LFLAGS)

179
program/lex.yy.c: program/program_lexer.l
180 181
	$(MKDIR_GEN)
	$(LEX_GEN) -o $@ $(srcdir)/program/program_lexer.l
182

183
program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y
184 185
	$(MKDIR_GEN)
	$(YACC_GEN) -o $@ -p "_mesa_program_" --defines=$(builddir)/program/program_parse.tab.h $(srcdir)/program/program_parse.y
186

187 188 189 190 191 192 193 194 195
if GEN_ASM_OFFSETS
matypes.h: $(gen_matypes_SOURCES)
	$(AM_V_GEN)$(COMPILE) $< -DASM_OFFSETS -S -o - | \
		sed -n '/^->/{s:^->::;/[$$]/{s:^:#define :;s:[$$]::};p}' > $@
else
matypes.h: gen_matypes
	$(AM_V_GEN)./gen_matypes > $@
endif

196 197
# Emacs tags
tags:
198
	etags `find . -name \*.[ch]` $(top_srcdir)/include/GL/*.h