[Mesa-dev] [PATCH 18/19] automake: Convert Mesa built sources generation to automake.

Eric Anholt eric at anholt.net
Wed Jun 13 10:31:11 PDT 2012


---
 src/mesa/Makefile.am  |   65 +++++++++++++++++++++++++++++++++++++++++++++++++
 src/mesa/Makefile.old |   61 ----------------------------------------------
 2 files changed, 65 insertions(+), 61 deletions(-)

diff --git a/src/mesa/Makefile.am b/src/mesa/Makefile.am
index 5e764cd..e52678d 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
 
diff --git a/src/mesa/Makefile.old b/src/mesa/Makefile.old
index b7f905c..4ea70d4 100644
--- a/src/mesa/Makefile.old
+++ b/src/mesa/Makefile.old
@@ -36,66 +36,6 @@ MESA_CXXFLAGS := $(LLVM_CFLAGS) $(CXXFLAGS)
 # then convenience libs (.a) and finally the device drivers:
 default: $(DEPENDS) $(MESA_LIBS)
 
-.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
-GLAPI := $(TOP)/src/mapi/glapi/gen
-include $(GLAPI)/glapi_gen.mk
-
-BUILT_SOURCES = \
-	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
-
-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
-	$(BISON) -v -d --output=program/program_parse.tab.c $<
-
-program/lex.yy.c: program/program_lexer.l
-	$(FLEX) --never-interactive --outfile=$@ $<
-
 ######################################################################
 # Helper libraries used by many drivers:
 
@@ -138,6 +78,5 @@ clean:
 	-rm -f */*.o
 	-rm -f */*/*.o
 	-rm -f depend depend.bak libmesa.a libmesagallium.a
-	-rm -f $(BUILT_SOURCES)
 
 -include $(DEPENDS)
-- 
1.7.10



More information about the mesa-dev mailing list