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 22SUBDIRS = . main/tests 23 24if HAVE_XLIB_GLX 25SUBDIRS += drivers/x11 26endif 27 28if HAVE_DRICOMMON 29SUBDIRS += drivers/dri 30endif 31 32if HAVE_OSMESA 33SUBDIRS += drivers/osmesa 34endif 35 36include Makefile.sources 37 38EXTRA_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 55BUILT_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 62CLEANFILES = \ 63 $(BUILT_SOURCES) \ 64 program/program_parse.tab.h 65 66PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS) 67 68main/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 73main/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 77main/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 81main/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 85main/formats.c: main/format_info.h 86 87noinst_LTLIBRARIES = $(ARCH_LIBS) 88if NEED_LIBMESA 89noinst_LTLIBRARIES += libmesa.la 90else 91check_LTLIBRARIES = libmesa.la 92endif 93if HAVE_GALLIUM 94noinst_LTLIBRARIES += libmesagallium.la 95endif 96 97AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS) 98AM_CFLAGS = \ 99 $(LLVM_CFLAGS) \ 100 $(VISIBILITY_CFLAGS) \ 101 $(MSVC2013_COMPAT_CFLAGS) 102AM_CXXFLAGS = \ 103 $(LLVM_CFLAGS) \ 104 $(VISIBILITY_CXXFLAGS) \ 105 $(MSVC2013_COMPAT_CXXFLAGS) 106 107ARCH_LIBS = 108 109if SSE41_SUPPORTED 110ARCH_LIBS += libmesa_sse41.la 111endif 112 113MESA_ASM_FILES_FOR_ARCH = 114 115if HAVE_X86_ASM 116noinst_PROGRAMS = gen_matypes 117 118gen_matypes_SOURCES = x86/gen_matypes.c 119BUILT_SOURCES += matypes.h 120 121if HAVE_X86_64_ASM 122MESA_ASM_FILES_FOR_ARCH += $(X86_64_FILES) 123AM_CPPFLAGS += -I$(builddir)/x86-64 -I$(srcdir)/x86-64 124else 125MESA_ASM_FILES_FOR_ARCH += $(X86_FILES) 126AM_CPPFLAGS += -I$(builddir)/x86 -I$(srcdir)/x86 127endif 128endif 129if HAVE_SPARC_ASM 130MESA_ASM_FILES_FOR_ARCH += $(SPARC_FILES) 131AM_CPPFLAGS += -I$(builddir)/sparc -I$(srcdir)/sparc 132endif 133 134libmesa_la_SOURCES = \ 135 $(MESA_FILES) \ 136 $(PROGRAM_FILES) \ 137 $(PROGRAM_NIR_FILES) \ 138 $(MESA_ASM_FILES_FOR_ARCH) 139 140libmesa_la_LIBADD = \ 141 $(top_builddir)/src/compiler/glsl/libglsl.la \ 142 $(ARCH_LIBS) 143 144libmesagallium_la_SOURCES = \ 145 $(MESA_GALLIUM_FILES) \ 146 $(PROGRAM_FILES) \ 147 $(PROGRAM_NIR_FILES) \ 148 $(MESA_ASM_FILES_FOR_ARCH) 149 150libmesagallium_la_LIBADD = \ 151 $(top_builddir)/src/compiler/glsl/libglsl.la \ 152 $(ARCH_LIBS) 153 154libmesa_sse41_la_SOURCES = \ 155 $(X86_SSE41_FILES) 156 157libmesa_sse41_la_CFLAGS = $(AM_CFLAGS) $(SSE41_CFLAGS) 158 159MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D) 160YACC_GEN = $(AM_V_GEN)$(YACC) $(YFLAGS) 161LEX_GEN = $(AM_V_GEN)$(LEX) $(LFLAGS) 162 163program/lex.yy.c: program/program_lexer.l 164 $(MKDIR_GEN) 165 $(LEX_GEN) -o $@ $(srcdir)/program/program_lexer.l 166 167program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y 168 $(MKDIR_GEN) 169 $(YACC_GEN) -o $@ -p "_mesa_program_" --defines=$(builddir)/program/program_parse.tab.h $(srcdir)/program/program_parse.y 170 171if GEN_ASM_OFFSETS 172matypes.h: $(gen_matypes_SOURCES) 173 $(AM_V_GEN)$(COMPILE) $< -DASM_OFFSETS -S -o - | \ 174 sed -n '/^->/{s:^->::;/[$$]/{s:^:#define :;s:[$$]::};p}' > $@ 175else 176matypes.h: gen_matypes 177 $(AM_V_GEN)./gen_matypes > $@ 178endif 179 180# Emacs tags 181tags: 182 etags `find . -name \*.[ch]` $(top_srcdir)/include/GL/*.h 183