blob: 0527a315955412307145145d62bc5ae58ab2327c [file] [log] [blame]
Matt Turner691c3042013-01-18 23:43:05 -08001# Copyright © 2013 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.
Eric Anholt7edbf4b2012-05-15 10:21:31 -070021
Emil Velikovaf2637a2016-05-31 14:46:19 +010022.PHONY: git_sha1.h.tmp
23git_sha1.h.tmp:
24 @# Don't assume that $(top_srcdir)/.git is a directory. It may be
25 @# a gitlink file if $(top_srcdir) is a submodule checkout or a linked
26 @# worktree.
27 @# If we are building from a release tarball copy the bundled header.
Emil Velikov4cd9cd62016-05-30 12:09:04 +010028 @if test -e $(top_srcdir)/.git; then \
29 if which git > /dev/null; then \
30 git --git-dir=$(top_srcdir)/.git log -n 1 --oneline | \
31 sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
Emil Velikovaf2637a2016-05-31 14:46:19 +010032 > git_sha1.h.tmp ; \
Emil Velikov4cd9cd62016-05-30 12:09:04 +010033 fi \
Emil Velikovaf2637a2016-05-31 14:46:19 +010034 else \
Emil Velikov359d9df2016-06-06 16:50:14 +010035 cp $(srcdir)/git_sha1.h git_sha1.h.tmp ;\
Emil Velikov2c424e02016-06-06 17:31:05 +010036 chmod u+w git_sha1.h.tmp; \
Emil Velikovaf2637a2016-05-31 14:46:19 +010037 fi
38
39git_sha1.h: git_sha1.h.tmp
40 @echo "updating git_sha1.h"
41 @if ! cmp -s git_sha1.h.tmp git_sha1.h; then \
42 mv git_sha1.h.tmp git_sha1.h ;\
43 else \
44 rm git_sha1.h.tmp ;\
Emil Velikov4cd9cd62016-05-30 12:09:04 +010045 fi
46
Emil Velikov4cd9cd62016-05-30 12:09:04 +010047BUILT_SOURCES = git_sha1.h
Emil Velikov4cd9cd62016-05-30 12:09:04 +010048
Emil Velikovb7f7ec72016-06-06 19:39:40 +010049# We want to keep the srcdir file since we need it on rebuild from tarball.
50# At the same time `make distclean' gets angry at us if we don't cleanup the
51# builddir one.
52distclean-local:
53 test $(top_srcdir) != $(top_builddir) && rm $(builddir)/git_sha1.h
54
Matt Turner145919b2014-12-18 13:33:29 -080055SUBDIRS = . gtest util mapi/glapi/gen mapi
Matt Turner691c3042013-01-18 23:43:05 -080056
Emil Velikov2f863832015-11-23 17:03:04 +000057# include only conditionally ?
58SUBDIRS += compiler
59
Jason Ekstrandef5dca22016-04-15 15:32:18 -070060if HAVE_INTEL_DRIVERS
61SUBDIRS += intel
62endif
63
Matt Turner691c3042013-01-18 23:43:05 -080064if NEED_OPENGL_COMMON
Emil Velikoveb636402016-01-18 12:16:48 +020065SUBDIRS += mesa
Matt Turner691c3042013-01-18 23:43:05 -080066endif
67
Axel Davy3ecd9e12014-06-08 19:47:48 -040068SUBDIRS += loader
69
Matt Turnera9676ae2013-01-18 23:59:49 -080070if HAVE_DRI_GLX
71SUBDIRS += glx
72endif
73
Emil Velikov6cb81472016-04-20 19:44:51 +010074## Optionally required by GBM and EGL
Emil Velikov9f3588e2016-04-20 20:18:02 +010075if HAVE_PLATFORM_WAYLAND
Emil Velikov6cb81472016-04-20 19:44:51 +010076SUBDIRS += egl/wayland/wayland-drm
Armin Kf423eba2013-08-11 17:27:23 +020077endif
78
Emil Velikov6cb81472016-04-20 19:44:51 +010079## Optionally required by EGL (aka PLATFORM_GBM)
Matt Turnera9676ae2013-01-18 23:59:49 -080080if HAVE_GBM
81SUBDIRS += gbm
82endif
83
Emil Velikov6cb81472016-04-20 19:44:51 +010084## Optionally required by EGL
85if HAVE_PLATFORM_WAYLAND
86SUBDIRS += egl/wayland/wayland-egl
87endif
88
Matt Turnera9676ae2013-01-18 23:59:49 -080089if HAVE_EGL
Emil Velikove3420392015-07-14 01:58:33 +010090SUBDIRS += egl
Matt Turnera9676ae2013-01-18 23:59:49 -080091endif
92
Emil Velikov3a2d09d2016-04-29 18:41:08 +010093## Requires the i965 compiler (part of mesa) and wayland-drm
94if HAVE_INTEL_VULKAN
95SUBDIRS += intel/vulkan
96endif
97
Matt Turnera9676ae2013-01-18 23:59:49 -080098if HAVE_GALLIUM
Emil Velikovb75e0d72014-07-20 23:20:57 +010099SUBDIRS += gallium
Matt Turnera9676ae2013-01-18 23:59:49 -0800100endif
Matt Turnercdc3a6b2013-11-10 18:06:41 -0800101
Emil Velikov5dc573e2015-03-21 20:45:22 +0000102EXTRA_DIST = \
Emil Velikov3689ef32016-05-30 12:32:05 +0100103 getopt hgl SConscript git_sha1.h
Matt Turner145919b2014-12-18 13:33:29 -0800104
Kristian Høgsberg169b3892015-03-24 09:41:08 -0700105AM_CFLAGS = $(VISIBILITY_CFLAGS)
106AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS)
107
Matt Turner145919b2014-12-18 13:33:29 -0800108AM_CPPFLAGS = \
109 -I$(top_srcdir)/include/ \
110 -I$(top_srcdir)/src/mapi/ \
111 -I$(top_srcdir)/src/mesa/ \
112 $(DEFINES)
113
114noinst_LTLIBRARIES = libglsl_util.la
115
116libglsl_util_la_SOURCES = \
117 mesa/main/imports.c \
118 mesa/program/prog_hash_table.c \
Emil Velikov1df5a6c2015-04-15 13:40:55 +0100119 mesa/program/symbol_table.c \
120 mesa/program/dummy_errors.c