automake: Convert Mesa built sources generation to automake.

This commit is contained in:
Eric Anholt 2012-06-12 13:10:08 -07:00
parent 2d51ac84fd
commit 4113ac6a0f
2 changed files with 65 additions and 61 deletions

View file

@ -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

View file

@ -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)