automake: get in-tree `make distclean' working again.
[mesa.git] / src / Makefile.am
1 # 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.
21
22 .PHONY: git_sha1.h.tmp
23 git_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.
28 @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"/' \
32 > git_sha1.h.tmp ; \
33 fi \
34 else \
35 cp $(srcdir)/git_sha1.h git_sha1.h.tmp ;\
36 chmod u+w git_sha1.h.tmp; \
37 fi
38
39 git_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 ;\
45 fi
46
47 BUILT_SOURCES = git_sha1.h
48
49 # 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.
52 distclean-local:
53 ( test $(top_srcdir) != $(top_builddir) && rm $(builddir)/git_sha1.h ) || true
54
55 SUBDIRS = . gtest util mapi/glapi/gen mapi
56
57 # include only conditionally ?
58 SUBDIRS += compiler
59
60 if HAVE_INTEL_DRIVERS
61 SUBDIRS += intel
62 endif
63
64 if NEED_OPENGL_COMMON
65 SUBDIRS += mesa
66 endif
67
68 SUBDIRS += loader
69
70 if HAVE_DRI_GLX
71 SUBDIRS += glx
72 endif
73
74 ## Optionally required by GBM and EGL
75 if HAVE_PLATFORM_WAYLAND
76 SUBDIRS += egl/wayland/wayland-drm
77 endif
78
79 ## Optionally required by EGL (aka PLATFORM_GBM)
80 if HAVE_GBM
81 SUBDIRS += gbm
82 endif
83
84 ## Optionally required by EGL
85 if HAVE_PLATFORM_WAYLAND
86 SUBDIRS += egl/wayland/wayland-egl
87 endif
88
89 if HAVE_EGL
90 SUBDIRS += egl
91 endif
92
93 ## Requires the i965 compiler (part of mesa) and wayland-drm
94 if HAVE_INTEL_VULKAN
95 SUBDIRS += intel/vulkan
96 endif
97
98 if HAVE_GALLIUM
99 SUBDIRS += gallium
100 endif
101
102 EXTRA_DIST = \
103 getopt hgl SConscript git_sha1.h
104
105 AM_CFLAGS = $(VISIBILITY_CFLAGS)
106 AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS)
107
108 AM_CPPFLAGS = \
109 -I$(top_srcdir)/include/ \
110 -I$(top_srcdir)/src/mapi/ \
111 -I$(top_srcdir)/src/mesa/ \
112 $(DEFINES)
113
114 noinst_LTLIBRARIES = libglsl_util.la
115
116 libglsl_util_la_SOURCES = \
117 mesa/main/imports.c \
118 mesa/program/prog_hash_table.c \
119 mesa/program/symbol_table.c \
120 mesa/program/dummy_errors.c