mesa: automake: ensure that git_sha1.h.tmp has the right attributes
[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 SUBDIRS = . gtest util mapi/glapi/gen mapi
50
51 # include only conditionally ?
52 SUBDIRS += compiler
53
54 if HAVE_INTEL_DRIVERS
55 SUBDIRS += intel
56 endif
57
58 if NEED_OPENGL_COMMON
59 SUBDIRS += mesa
60 endif
61
62 SUBDIRS += loader
63
64 if HAVE_DRI_GLX
65 SUBDIRS += glx
66 endif
67
68 ## Optionally required by GBM and EGL
69 if HAVE_PLATFORM_WAYLAND
70 SUBDIRS += egl/wayland/wayland-drm
71 endif
72
73 ## Optionally required by EGL (aka PLATFORM_GBM)
74 if HAVE_GBM
75 SUBDIRS += gbm
76 endif
77
78 ## Optionally required by EGL
79 if HAVE_PLATFORM_WAYLAND
80 SUBDIRS += egl/wayland/wayland-egl
81 endif
82
83 if HAVE_EGL
84 SUBDIRS += egl
85 endif
86
87 ## Requires the i965 compiler (part of mesa) and wayland-drm
88 if HAVE_INTEL_VULKAN
89 SUBDIRS += intel/vulkan
90 endif
91
92 if HAVE_GALLIUM
93 SUBDIRS += gallium
94 endif
95
96 EXTRA_DIST = \
97 getopt hgl SConscript git_sha1.h
98
99 AM_CFLAGS = $(VISIBILITY_CFLAGS)
100 AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS)
101
102 AM_CPPFLAGS = \
103 -I$(top_srcdir)/include/ \
104 -I$(top_srcdir)/src/mapi/ \
105 -I$(top_srcdir)/src/mesa/ \
106 $(DEFINES)
107
108 noinst_LTLIBRARIES = libglsl_util.la
109
110 libglsl_util_la_SOURCES = \
111 mesa/main/imports.c \
112 mesa/program/prog_hash_table.c \
113 mesa/program/symbol_table.c \
114 mesa/program/dummy_errors.c