aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/Android.gen.mk
diff options
context:
space:
mode:
authorDaniel Charles <[email protected]>2012-07-26 14:18:15 -0700
committerChad Versace <[email protected]>2012-07-26 14:51:20 -0700
commit948c8f502a3b3144588a6e707b0ea60afa766ebb (patch)
tree4c8e60552c7b1f27b6a55cf8fa372284c485583f /src/mesa/Android.gen.mk
parent0e893b42610a2e8f2797bd7da68669dac38d9538 (diff)
android-build: fix dricore build for autogenerated files (v3)
Recently more files were removed from control to be auto-generated in the dricore library. Android build was not able to locate the new files if they were not created beforehand. LOCAL_SRC_FILES includes some of those files and Android.gen.mk re-defines this variable by filtering out the auto-generated files. Unfortunately for this variable it is not the same to have the SRCDIR variable defined as the current directory. By re-defining SRCDIR for the autotools build the Android build system is happy again and the new files were actually removed from the sources to use the auto generated versions. Also patch d5c1801a018efda8ac2b was partially reverted as the files can not be compiled to the LOCAL_PATH, instead they should live on the intermediates folder so that a clean can wipe them out. v3: [chad] Fix the definition of SRCDIR in libdricore/Makefile.am. Signed-off-by: Chad Versace <[email protected]> Signed-off-by: Daniel Charles <[email protected]>
Diffstat (limited to 'src/mesa/Android.gen.mk')
-rw-r--r--src/mesa/Android.gen.mk68
1 files changed, 52 insertions, 16 deletions
diff --git a/src/mesa/Android.gen.mk b/src/mesa/Android.gen.mk
index 2ea8cc433de..5443bb99fdb 100644
--- a/src/mesa/Android.gen.mk
+++ b/src/mesa/Android.gen.mk
@@ -28,12 +28,19 @@ LOCAL_MODULE_CLASS := STATIC_LIBRARIES
endif
intermediates := $(call local-intermediates-dir)
-mydir := $(call my-dir)
+# This is the list of auto-generated files: sources and headers
sources := \
+ main/enums.c \
+ main/api_exec_es1.c \
main/api_exec_es1_dispatch.h \
main/api_exec_es1_remap_helper.h \
+ main/api_exec_es2.c \
main/api_exec_es2_dispatch.h \
+ program/program_parse.tab.c \
+ program/lex.yy.c \
+ main/dispatch.h \
+ main/remap_helper.h \
main/api_exec_es2_remap_helper.h
LOCAL_SRC_FILES := $(filter-out $(sources), $(LOCAL_SRC_FILES))
@@ -65,37 +72,49 @@ es_hdr_deps := \
$(wildcard $(glapi)/*.py) \
$(wildcard $(glapi)/*.xml)
+define local-l-to-c
+ @mkdir -p $(dir $@)
+ @echo "Mesa Lex: $(PRIVATE_MODULE) <= $<"
+ $(hide) $(LEX) -o$@ $<
+endef
+
+define local-y-to-c-and-h
+ @mkdir -p $(dir $@)
+ @echo "Mesa Yacc: $(PRIVATE_MODULE) <= $<"
+ $(hide) $(YACC) -o $@ $<
+endef
+
define es-gen
@mkdir -p $(dir $@)
@echo "Gen ES: $(PRIVATE_MODULE) <= $(notdir $(@))"
$(hide) $(PRIVATE_SCRIPT) $(1) $(PRIVATE_XML) > $@
endef
-define generate-local
- @echo "generate local sources"
- $(hide) $(MESA_PYTHON2) $(glapi)/gl_enums.py -f $(glapi)/gl_and_es_API.xml > $(mydir)/main/enums.c
- $(hide) $(MESA_PYTHON2) $(glapi)/gl_table.py -m remap_table -f $(glapi)/gl_and_es_API.xml > $(mydir)/main/dispatch.h
- $(hide) $(MESA_PYTHON2) $(glapi)/remap_helper.py -f $(glapi)/gl_API.xml > $(mydir)/main/remap_helper.h
- $(hide) $(MESA_PYTHON2) $(mydir)/main/es_generator.py -V GLES1.1 -S $(mydir)/main/APIspec.xml > $(mydir)/main/api_exec_es1.c
- $(hide) $(MESA_PYTHON2) $(mydir)/main/es_generator.py -V GLES2.0 -S $(mydir)/main/APIspec.xml > $(mydir)/main/api_exec_es2.c
-
- @echo "Mesa Lex : $(PRIVATE_MODULE)"
- $(hide) $(LEX) -o $(mydir)/program/lex.yy.c $(mydir)/program/program_lexer.l
- @echo "Mesa Yacc: $(PRIVATE_MODULE)"
- $(hide) $(YACC) -d -o $(mydir)/program/program_parse.tab.c $(mydir)/program/program_parse.y
-endef
-
+$(intermediates)/main/api_exec_%.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/main/es_generator.py
+$(intermediates)/main/api_exec_%.c: PRIVATE_XML := -S $(LOCAL_PATH)/main/APIspec.xml
$(intermediates)/main/api_exec_%_dispatch.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_table.py
$(intermediates)/main/api_exec_%_dispatch.h: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
$(intermediates)/main/api_exec_%_remap_helper.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/remap_helper.py
$(intermediates)/main/api_exec_%_remap_helper.h: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
+$(intermediates)/main/api_exec_es1.c: $(es_src_deps)
+ $(call es-gen, -V GLES1.1)
+
+$(intermediates)/main/api_exec_es2.c: $(es_src_deps)
+ $(call es-gen, -V GLES2.0)
+
$(intermediates)/main/api_exec_%_dispatch.h: $(es_hdr_deps)
$(call es-gen, -c $* -m remap_table)
$(intermediates)/main/api_exec_%_remap_helper.h: $(es_hdr_deps)
$(call es-gen, -c $*)
+$(intermediates)/program/program_parse.tab.c: $(LOCAL_PATH)/program/program_parse.y
+ $(local-y-to-c-and-h)
+
+$(intermediates)/program/lex.yy.c: $(LOCAL_PATH)/program/program_lexer.l
+ $(local-l-to-c)
+
$(intermediates)/main/git_sha1.h:
@mkdir -p $(dir $@)
@echo "GIT-SHA1: $(PRIVATE_MODULE) <= git"
@@ -115,4 +134,21 @@ $(intermediates)/x86/matypes.h: $(matypes_deps)
@mkdir -p $(dir $@)
@echo "MATYPES: $(PRIVATE_MODULE) <= $(notdir $@)"
$(hide) $< > $@
- $(call generate-local)
+
+$(intermediates)/main/dispatch.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_table.py
+$(intermediates)/main/dispatch.h: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
+
+$(intermediates)/main/dispatch.h: $(es_hdr_deps)
+ $(call es-gen, $* -m remap_table)
+
+$(intermediates)/main/remap_helper.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/remap_helper.py
+$(intermediates)/main/remap_helper.h: PRIVATE_XML := -f $(glapi)/gl_API.xml
+
+$(intermediates)/main/remap_helper.h: $(es_hdr_deps)
+ $(call es-gen, $*)
+
+$(intermediates)/main/enums.c: PRIVATE_SCRIPT :=$(MESA_PYTHON2) $(glapi)/gl_enums.py
+$(intermediates)/main/enums.c: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
+
+$(intermediates)/main/enums.c: $(es_src_deps)
+ $(call es-gen)