$(LIBGLCPP_GENERATED_FILES) \
$(LIBGLSL_GENERATED_FILES))
+LOCAL_EXPORT_C_INCLUDE_DIRS += \
+ $(intermediates)/glsl \
+
+# Modules using libmesa_nir must set LOCAL_GENERATED_SOURCES to this
+MESA_GEN_GLSL_H := $(addprefix $(call local-generated-sources-dir)/, \
+ glsl/ir_expression_operation.h \
+ glsl/ir_expression_operation_constant.h \
+ glsl/ir_expression_operation_strings.h)
+
define local-l-or-ll-to-c-or-cpp
@mkdir -p $(dir $@)
@echo "Mesa Lex: $(PRIVATE_MODULE) <= $<"
$(intermediates)/glsl/glsl_parser.cpp: $(LOCAL_PATH)/glsl/glsl_parser.yy
$(call local-yy-to-cpp-and-h,.cpp)
+$(intermediates)/glsl/glsl_parser.h: $(intermediates)/glsl/glsl_parser.cpp
+
$(intermediates)/glsl/glcpp/glcpp-lex.c: $(LOCAL_PATH)/glsl/glcpp/glcpp-lex.l
$(call local-l-or-ll-to-c-or-cpp)
$(intermediates)/glsl/glcpp/glcpp-parse.c: $(LOCAL_PATH)/glsl/glcpp/glcpp-parse.y
$(call glsl_local-y-to-c-and-h)
+
+$(LOCAL_PATH)/glsl/ir.h: $(intermediates)/glsl/ir_expression_operation.h
+
+$(intermediates)/glsl/ir_expression_operation.h: $(LOCAL_PATH)/glsl/ir_expression_operation.py
+ @mkdir -p $(dir $@)
+ $(hide) $(MESA_PYTHON2) $< enum > $@
+
+$(intermediates)/glsl/ir_expression_operation_constant.h: $(LOCAL_PATH)/glsl/ir_expression_operation.py
+ @mkdir -p $(dir $@)
+ $(hide) $(MESA_PYTHON2) $< constant > $@
+
+$(intermediates)/glsl/ir_expression_operation_strings.h: $(LOCAL_PATH)/glsl/ir_expression_operation.py
+ @mkdir -p $(dir $@)
+ $(hide) $(MESA_PYTHON2) $< strings > $@
$(MESA_TOP)/src/gallium/auxiliary
LOCAL_STATIC_LIBRARIES := \
- libmesa_compiler \
libmesa_nir
LOCAL_MODULE := libmesa_glsl
LOCAL_PATH := $(call my-dir)
-include $(LOCAL_PATH)/Makefile.sources
+include $(LOCAL_PATH)/Android.glsl.mk
+include $(LOCAL_PATH)/Android.nir.mk
# ---------------------------------------
# Build libmesa_compiler
include $(CLEAR_VARS)
+include $(LOCAL_PATH)/Makefile.sources
LOCAL_SRC_FILES := $(LIBCOMPILER_FILES)
LOCAL_C_INCLUDES := \
$(MESA_TOP)/src/mapi \
$(MESA_TOP)/src/mesa \
$(MESA_TOP)/src/gallium/include \
- $(MESA_TOP)/src/gallium/auxiliary
+ $(MESA_TOP)/src/gallium/auxiliary \
+ $(dir $(MESA_GEN_GLSL_H))
+
+LOCAL_GENERATED_SOURCES += \
+ $(MESA_GEN_GLSL_H)
LOCAL_MODULE := libmesa_compiler
include $(MESA_COMMON_MK)
include $(BUILD_STATIC_LIBRARY)
-include $(LOCAL_PATH)/Android.glsl.mk
-include $(LOCAL_PATH)/Android.nir.mk
$(MESA_TOP)/src/mesa/main \
$(MESA_TOP)/src/compiler/nir \
$(MESA_TOP)/src/gallium/include \
- $(MESA_TOP)/src/gallium/auxiliary
+ $(MESA_TOP)/src/gallium/auxiliary \
+ $(dir $(MESA_GEN_GLSL_H))
+
+LOCAL_GENERATED_SOURCES += \
+ $(MESA_GEN_GLSL_H)
LOCAL_WHOLE_STATIC_LIBRARIES += \
libmesa_program
LOCAL_SRC_FILES := \
$(MESA_GALLIUM_FILES)
+LOCAL_GENERATED_SOURCES := $(MESA_GEN_GLSL_H)
+
ifeq ($(strip $(MESA_ENABLE_ASM)),true)
ifeq ($(TARGET_ARCH),x86)
LOCAL_SRC_FILES += $(X86_FILES)
LOCAL_WHOLE_STATIC_LIBRARIES += \
libmesa_program
-LOCAL_STATIC_LIBRARIES += libmesa_nir
+LOCAL_STATIC_LIBRARIES += libmesa_nir libmesa_glsl
include $(LOCAL_PATH)/Android.gen.mk
include $(MESA_COMMON_MK)
LOCAL_MODULE := libmesa_program
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_STATIC_LIBRARIES := libmesa_nir
+LOCAL_STATIC_LIBRARIES := libmesa_nir \
+ libmesa_glsl
intermediates := $(call local-generated-sources-dir)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates)
-LOCAL_GENERATED_SOURCES += $(MESA_GEN_NIR_H)
+LOCAL_GENERATED_SOURCES += $(MESA_GEN_NIR_H) \
+ $(MESA_GEN_GLSL_H)
include $(MESA_COMMON_MK)
include $(BUILD_STATIC_LIBRARY)