1 # Copyright © 2012 Intel Corporation
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:
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
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
22 SUBDIRS = x86 x86-64 . main/tests
25 SUBDIRS += drivers/x11
29 SUBDIRS += drivers/dri
33 SUBDIRS += drivers/osmesa
36 gldir = $(includedir)/GL
37 gl_HEADERS = $(top_srcdir)/include/GL/*.h
39 .PHONY: main/git_sha1.h.tmp
41 @touch main/git_sha1.h.tmp
42 @if test -d ../../.git; then \
43 if which git > /dev/null; then \
44 git log -n 1 --oneline | \
45 sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
46 > main/git_sha1.h.tmp ; \
50 main/git_sha1.h: 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 ;\
55 rm main/git_sha1.h.tmp ;\
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
62 BUILDDIR = $(builddir)/
63 include Makefile.sources
68 $(BUILDDIR)program/program_parse.tab.c \
69 $(BUILDDIR)program/lex.yy.c
72 $(BUILDDIR)program/program_parse.tab.h \
75 GET_HASH_GEN = main/get_hash_generator.py
77 main/get_hash.h: $(GLAPI)/gl_and_es_API.xml main/get_hash_params.py \
78 $(GET_HASH_GEN) Makefile
80 $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/$(GET_HASH_GEN) \
86 noinst_LTLIBRARIES += libmesa.la
88 check_LTLIBRARIES = libmesa.la
91 noinst_LTLIBRARIES += libmesagallium.la
94 AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS)
95 AM_CFLAGS = $(LLVM_CFLAGS) $(VISIBILITY_CFLAGS)
96 AM_CXXFLAGS = $(LLVM_CFLAGS) $(VISIBILITY_CXXFLAGS)
98 MESA_ASM_FILES_FOR_ARCH =
102 MESA_ASM_FILES_FOR_ARCH += $(X86_64_FILES)
103 AM_CPPFLAGS += -I$(builddir)/x86-64 -I$(srcdir)/x86-64
105 MESA_ASM_FILES_FOR_ARCH += $(X86_FILES)
106 AM_CPPFLAGS += -I$(builddir)/x86 -I$(srcdir)/x86
110 MESA_ASM_FILES_FOR_ARCH += $(SPARC_FILES)
111 AM_CPPFLAGS += -I$(builddir)/sparc -I$(srcdir)/sparc
114 libmesa_la_SOURCES = \
117 $(MESA_ASM_FILES_FOR_ARCH)
119 libmesa_la_LIBADD = \
120 $(top_builddir)/src/glsl/libglsl.la \
123 libmesagallium_la_SOURCES = \
124 $(MESA_GALLIUM_FILES) \
126 $(MESA_ASM_FILES_FOR_ARCH)
128 libmesagallium_la_LIBADD = \
129 $(top_builddir)/src/glsl/libglsl.la \
132 pkgconfigdir = $(libdir)/pkgconfig
133 pkgconfig_DATA = gl.pc
135 $(BUILDDIR)program/lex.yy.c: program/program_lexer.l
136 $(MKDIR_P) $(builddir)/program
137 $(AM_V_GEN) $(LEX) --never-interactive --outfile=$@ $<
139 $(BUILDDIR)program/program_parse.tab.c $(BUILDDIR)program/program_parse.tab.h: program/program_parse.y
140 $(MKDIR_P) $(builddir)/program
141 $(AM_V_GEN) $(YACC) -p "_mesa_program_" -v -d --output=$(BUILDDIR)program/program_parse.tab.c $<
145 etags `find . -name \*.[ch]` $(top_srcdir)/include/GL/*.h