summaryrefslogtreecommitdiffstats
path: root/src/mesa/Makefile.am
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-06-12 13:10:08 -0700
committerEric Anholt <[email protected]>2012-06-21 10:10:46 -0700
commit4113ac6a0f13338ee5f9c5fa0be13f37b515108d (patch)
tree8fba9e9585a4e2f6ada9eced5c6c25e51d5ea5e4 /src/mesa/Makefile.am
parent2d51ac84fd4c6d0fcf4d5112af2eb2c12e186b63 (diff)
automake: Convert Mesa built sources generation to automake.
Diffstat (limited to 'src/mesa/Makefile.am')
-rw-r--r--src/mesa/Makefile.am65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/mesa/Makefile.am b/src/mesa/Makefile.am
index 5e764cddc9f..e52678d5831 100644
--- a/src/mesa/Makefile.am
+++ b/src/mesa/Makefile.am
@@ -24,6 +24,71 @@ SUBDIRS = x86 x86-64 . libdricore drivers
gldir = $(includedir)/GL
gl_HEADERS = $(top_srcdir)/include/GL/*.h
+.PHONY: main/git_sha1.h.tmp
+main/git_sha1.h.tmp:
+ @touch main/git_sha1.h.tmp
+ @if test -d ../../.git; then \
+ if which git > /dev/null; then \
+ git log -n 1 --oneline | \
+ sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
+ > main/git_sha1.h.tmp ; \
+ fi \
+ fi
+
+main/git_sha1.h: main/git_sha1.h.tmp
+ @echo "updating main/git_sha1.h"
+ @if ! cmp -s main/git_sha1.h.tmp main/git_sha1.h; then \
+ mv main/git_sha1.h.tmp main/git_sha1.h ;\
+ fi
+
+# include glapi_gen.mk for generating glapi headers for GLES
+TOP = $(top_srcdir)
+GLAPI = $(TOP)/src/mapi/glapi/gen
+include $(GLAPI)/glapi_gen.mk
+
+BUILT_SOURCES = \
+ main/git_sha1.h \
+ main/api_exec_es1_dispatch.h \
+ main/api_exec_es1_remap_helper.h \
+ main/api_exec_es2_dispatch.h \
+ main/api_exec_es2_remap_helper.h \
+ main/api_exec_es1.c \
+ main/api_exec_es2.c \
+ program/program_parse.tab.c \
+ program/program_parse.tab.h \
+ program/lex.yy.c
+CLEANFILES = \
+ $(BUILT_SOURCES) \
+ git_sha1.h.tmp
+
+main/api_exec_es1_dispatch.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_dispatch_deps)
+ $(call glapi_gen_dispatch,$<,es1)
+
+main/api_exec_es1_remap_helper.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_remap_deps)
+ $(call glapi_gen_remap,$<,es1)
+
+main/api_exec_es1.o: main/api_exec_es1_dispatch.h main/api_exec_es1_remap_helper.h
+
+main/api_exec_es2_dispatch.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_dispatch_deps)
+ $(call glapi_gen_dispatch,$<,es2)
+
+main/api_exec_es2_remap_helper.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_remap_deps)
+ $(call glapi_gen_remap,$<,es2)
+
+main/api_exec_es2.o: main/api_exec_es2_dispatch.h main/api_exec_es2_remap_helper.h
+
+main/api_exec_es1.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py
+ $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES1.1 > $@
+
+main/api_exec_es2.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py
+ $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES2.0 > $@
+
+program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y
+ $(YACC) -v -d --output=program/program_parse.tab.c $<
+
+program/lex.yy.c: program/program_lexer.l
+ $(LEX) --never-interactive --outfile=$@ $<
+
all-local:
$(MAKE) -f Makefile.old