df912c442af14a239e1f7a13b6517d6985f3c1b8
[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 @touch git_sha1.h.tmp
29 @if test -e $(top_srcdir)/.git; then \
30 if which git > /dev/null; then \
31 printf '#define MESA_GIT_SHA1 "git-%s"\n' \
32 `git --git-dir=$(top_srcdir)/.git rev-parse --short=10 HEAD` \
33 > git_sha1.h.tmp ; \
34 fi \
35 fi
36
37 git_sha1.h: git_sha1.h.tmp
38 @echo "updating git_sha1.h"
39 @if ! cmp -s git_sha1.h.tmp git_sha1.h; then \
40 mv git_sha1.h.tmp git_sha1.h ;\
41 else \
42 rm git_sha1.h.tmp ;\
43 fi
44
45 BUILT_SOURCES = git_sha1.h
46 CLEANFILES = $(BUILT_SOURCES)
47 EXTRA_DIST =
48
49 SUBDIRS = . gtest util mapi/glapi/gen mapi
50
51 if HAVE_OPENGL
52 gldir = $(includedir)/GL
53 gl_HEADERS = \
54 $(top_srcdir)/include/GL/gl.h \
55 $(top_srcdir)/include/GL/glext.h \
56 $(top_srcdir)/include/GL/glcorearb.h \
57 $(top_srcdir)/include/GL/gl_mangle.h
58 endif
59
60 if HAVE_GLX
61 glxdir = $(includedir)/GL
62 glx_HEADERS = \
63 $(top_srcdir)/include/GL/glx.h \
64 $(top_srcdir)/include/GL/glxext.h \
65 $(top_srcdir)/include/GL/glx_mangle.h
66 pkgconfigdir = $(libdir)/pkgconfig
67 pkgconfig_DATA = mesa/gl.pc
68 endif
69
70 if HAVE_COMMON_OSMESA
71 osmesadir = $(includedir)/GL
72 osmesa_HEADERS = $(top_srcdir)/include/GL/osmesa.h
73 endif
74
75 # include only conditionally ?
76 SUBDIRS += compiler
77
78 ## Optionally required by GBM, EGL and Vulkan
79 if HAVE_PLATFORM_WAYLAND
80 SUBDIRS += egl/wayland/wayland-drm
81 endif
82
83 if HAVE_VULKAN_COMMON
84 SUBDIRS += vulkan
85 endif
86 EXTRA_DIST += vulkan/registry/vk.xml
87
88 if HAVE_AMD_DRIVERS
89 SUBDIRS += amd
90 endif
91
92 if HAVE_INTEL_DRIVERS
93 SUBDIRS += intel
94 endif
95
96 if NEED_OPENGL_COMMON
97 SUBDIRS += mesa
98 endif
99
100 SUBDIRS += loader
101
102 if HAVE_DRI_GLX
103 SUBDIRS += glx
104 endif
105
106 ## Optionally required by EGL (aka PLATFORM_GBM)
107 if HAVE_GBM
108 SUBDIRS += gbm
109 endif
110
111 ## Optionally required by EGL
112 if HAVE_PLATFORM_WAYLAND
113 SUBDIRS += egl/wayland/wayland-egl
114 endif
115
116 if HAVE_EGL
117 SUBDIRS += egl
118 endif
119
120 # Requires wayland-drm
121 if HAVE_RADEON_VULKAN
122 SUBDIRS += amd/vulkan
123 endif
124
125 if HAVE_GALLIUM
126 SUBDIRS += gallium
127 endif
128
129 EXTRA_DIST += \
130 getopt hgl SConscript \
131 $(top_srcdir)/include/GL/mesa_glinterop.h
132
133 AM_CFLAGS = $(VISIBILITY_CFLAGS)
134 AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS)
135
136 AM_CPPFLAGS = \
137 -I$(top_srcdir)/include/ \
138 -I$(top_srcdir)/src/mapi/ \
139 -I$(top_srcdir)/src/mesa/ \
140 -I$(top_srcdir)/src/gallium/include \
141 -I$(top_srcdir)/src/gallium/auxiliary \
142 $(DEFINES)
143
144 noinst_LTLIBRARIES = libglsl_util.la
145
146 libglsl_util_la_SOURCES = \
147 mesa/main/extensions_table.c \
148 mesa/main/imports.c \
149 mesa/program/prog_parameter.c \
150 mesa/program/symbol_table.c \
151 mesa/program/dummy_errors.c