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
23 DRICORE_SUBDIR = libdricore
26 SUBDIRS = program x86 x86-64 . $(DRICORE_SUBDIR) drivers
28 gldir = $(includedir)/GL
29 gl_HEADERS = $(top_srcdir)/include/GL/*.h
31 .PHONY: main/git_sha1.h.tmp
33 @touch main/git_sha1.h.tmp
34 @if test -d ../../.git; then \
35 if which git > /dev/null; then \
36 git log -n 1 --oneline | \
37 sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
38 > main/git_sha1.h.tmp ; \
42 main/git_sha1.h: main/git_sha1.h.tmp
43 @echo "updating main/git_sha1.h"
44 @if ! cmp -s main/git_sha1.h.tmp main/git_sha1.h; then \
45 mv main/git_sha1.h.tmp main/git_sha1.h ;\
47 rm main/git_sha1.h.tmp ;\
50 # include glapi_gen.mk for generating glapi headers for GLES
51 GLAPI = $(top_srcdir)/src/mapi/glapi/gen
52 include $(GLAPI)/glapi_gen.mk
61 GET_HASH_GEN = main/get_hash_generator.py
62 GET_HASH_GEN_FLAGS := $(patsubst -DFEATURE_%=1,-a %, \
63 $(patsubst -DFEATURE_%=0,,$(API_DEFINES)))
65 main/get_hash.h: $(GLAPI)/gl_and_es_API.xml main/get_hash_params.py \
66 $(GET_HASH_GEN) Makefile
68 $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/$(GET_HASH_GEN) \
69 $(GET_HASH_GEN_FLAGS) -f $< > $@.tmp; \
74 noinst_LTLIBRARIES += libmesa.la
76 check_LTLIBRARIES = libmesa.la
79 noinst_LTLIBRARIES += libmesagallium.la
82 SRCDIR = $(top_srcdir)/src/mesa/
83 BUILDDIR = $(top_builddir)/src/mesa/
86 AM_CPPFLAGS = $(API_DEFINES) $(DEFINES) $(INCLUDE_DIRS)
87 AM_CFLAGS = $(LLVM_CFLAGS) $(VISIBILITY_CFLAGS)
88 AM_CXXFLAGS = $(LLVM_CFLAGS) $(VISIBILITY_CXXFLAGS)
90 # cannot just add $(MESA_ASM_FILES) to libmesa_la_SOURCES as it contains a configure substitution
91 MESA_ASM_FILES_FOR_ARCH =
94 MESA_ASM_FILES_FOR_ARCH += $(X86_FILES)
96 -I$(top_builddir)/src/mesa/x86 \
97 -I$(top_srcdir)/src/mesa/x86
100 MESA_ASM_FILES_FOR_ARCH += $(X86_64_FILES)
102 -I$(top_builddir)/src/mesa/x86-64 \
103 -I$(top_srcdir)/src/mesa/x86-64
106 MESA_ASM_FILES_FOR_ARCH += $(SPARC_FILES)
108 -I$(top_builddir)/src/mesa/sparc \
109 -I$(top_srcdir)/src/mesa/sparc
112 libmesa_la_SOURCES = \
114 $(MESA_ASM_FILES_FOR_ARCH)
116 libmesa_la_LIBADD = \
117 $(top_builddir)/src/glsl/libglsl.la \
118 $(top_builddir)/src/mesa/program/libprogram.la \
122 libmesagallium_la_SOURCES = \
123 $(MESA_GALLIUM_FILES) \
124 $(MESA_ASM_FILES_FOR_ARCH)
126 libmesagallium_la_LIBADD = \
127 $(top_builddir)/src/glsl/libglsl.la \
128 $(top_builddir)/src/mesa/program/libprogram.la \
131 libmesagallium_la_LDFLAGS =
134 # Provide compatibility with scripts for the old Mesa build system for
135 # a while by putting a link to the library in the current directory.
136 all-local: $(noinst_LTLIBRARIES)
137 ln -f .libs/libmesagallium.a .
140 CLEANFILES += libmesagallium.a
142 pkgconfigdir = $(libdir)/pkgconfig
143 pkgconfig_DATA = gl.pc
147 etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h