android: add inital NIR build
authorMauro Rossi <issor.oruam@gmail.com>
Fri, 27 Mar 2015 22:25:45 +0000 (22:25 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 22 Apr 2015 13:49:39 +0000 (14:49 +0100)
Required by the i965 driver.

v2:
 - Split out the nir_builder_opcodes.h rules.
 - Do not unconditionally hide the python command - use $(hide)
 - Use LOCAL_EXPORT_C_INCLUDE_DIRS to manage includes for the generated
sources.

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
[Emil Velikov: Split from a larger commit, v2]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chih-Wei Huang <cwhuang@linux.org.tw>
src/glsl/Android.gen.mk
src/glsl/Android.mk

index 7ec56d4f203fa7a05ba1d2d9b049e8af5d931e04..e161bd8e885566b989b2aef8d1fdd398eae6114f 100644 (file)
@@ -33,11 +33,23 @@ sources := \
        glsl_lexer.cpp \
        glsl_parser.cpp \
        glcpp/glcpp-lex.c \
-       glcpp/glcpp-parse.c
+       glcpp/glcpp-parse.c \
+       nir/nir_constant_expressions.c \
+       nir/nir_opcodes.c \
+       nir/nir_opcodes.h \
+       nir/nir_opt_algebraic.c
 
 LOCAL_SRC_FILES := $(filter-out $(sources), $(LOCAL_SRC_FILES))
 
-LOCAL_C_INCLUDES += $(intermediates) $(intermediates)/glcpp $(MESA_TOP)/src/glsl/glcpp
+LOCAL_C_INCLUDES += \
+       $(intermediates) \
+       $(intermediates)/glcpp \
+       $(intermediates)/nir \
+       $(MESA_TOP)/src/glsl/glcpp \
+       $(MESA_TOP)/src/glsl/nir
+
+LOCAL_EXPORT_C_INCLUDE_DIRS += \
+       $(intermediates)/nir
 
 sources := $(addprefix $(intermediates)/, $(sources))
 LOCAL_GENERATED_SOURCES += $(sources)
@@ -77,3 +89,42 @@ $(intermediates)/glcpp/glcpp-lex.c: $(LOCAL_PATH)/glcpp/glcpp-lex.l
 
 $(intermediates)/glcpp/glcpp-parse.c: $(LOCAL_PATH)/glcpp/glcpp-parse.y
        $(call glsl_local-y-to-c-and-h)
+
+nir_constant_expressions_gen := $(LOCAL_PATH)/nir/nir_constant_expressions.py
+nir_constant_expressions_deps := \
+       $(LOCAL_PATH)/nir/nir_opcodes.py \
+       $(LOCAL_PATH)/nir/nir_constant_expressions.py \
+       $(LOCAL_PATH)/nir/nir_constant_expressions.h
+
+$(intermediates)/nir/nir_constant_expressions.c: $(nir_constant_expressions_deps)
+       @mkdir -p $(dir $@)
+       $(hide) $(MESA_PYTHON2) $(nir_constant_expressions_gen) $< > $@
+
+nir_opcodes_h_gen := $(LOCAL_PATH)/nir/nir_opcodes_h.py
+nir_opcodes_h_deps := \
+       $(LOCAL_PATH)/nir/nir_opcodes.py \
+       $(LOCAL_PATH)/nir/nir_opcodes_h.py
+
+$(intermediates)/nir/nir_opcodes.h: $(nir_opcodes_h_deps)
+       @mkdir -p $(dir $@)
+       $(hide) $(MESA_PYTHON2) $(nir_opcodes_h_gen) $< > $@
+
+$(LOCAL_PATH)/nir/nir.h: $(intermediates)/nir/nir_opcodes.h
+
+nir_opcodes_c_gen := $(LOCAL_PATH)/nir/nir_opcodes_c.py
+nir_opcodes_c_deps := \
+       $(LOCAL_PATH)/nir/nir_opcodes.py \
+       $(LOCAL_PATH)/nir/nir_opcodes_c.py
+
+$(intermediates)/nir/nir_opcodes.c: $(nir_opcodes_c_deps)
+       @mkdir -p $(dir $@)
+       $(hide) $(MESA_PYTHON2) $(nir_opcodes_c_gen) $< > $@
+
+nir_opt_algebraic_gen := $(LOCAL_PATH)/nir/nir_opt_algebraic.py
+nir_opt_algebraic_deps := \
+       $(LOCAL_PATH)/nir/nir_opt_algebraic.py \
+       $(LOCAL_PATH)/nir/nir_algebraic.py
+
+$(intermediates)/nir/nir_opt_algebraic.c: $(nir_opt_algebraic_deps)
+       @mkdir -p $(dir $@)
+       $(hide) $(MESA_PYTHON2) $(nir_opt_algebraic_gen) $< > $@
index 356f44e403345270905acffb2a78dc0ae925484f..f20741e0d0fc1259eb45191e368b43af7a3fd9d9 100644 (file)
@@ -35,7 +35,8 @@ include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := \
        $(LIBGLCPP_FILES) \
-       $(LIBGLSL_FILES)
+       $(LIBGLSL_FILES) \
+       $(NIR_FILES)
 
 LOCAL_C_INCLUDES := \
        $(MESA_TOP)/src/mapi \