Android: fix spirv_info.c generation
authorChih-Wei Huang <cwhuang@android-x86.org>
Thu, 20 Jul 2017 10:30:57 +0000 (18:30 +0800)
committerTapani Pälli <tapani.palli@intel.com>
Fri, 21 Jul 2017 05:48:45 +0000 (08:48 +0300)
It's incorrect to use $(LOCAL_PATH) in makefile recipes since it's
changing. The typical way to handle it is to use private variable.
Fortunately in this case we can just simplify them to $^.

See further:
https://patchwork.freedesktop.org/patch/167718/

Also simplify LOCAL_GENERATED_SOURCES.

Fixes: 2dd4e2ec (spirv: Generate spirv_info.c)
Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/compiler/Android.nir.gen.mk

index 4507ac4ba8c5bd995683ceb487b8a12d897522a6..e2187d081df8eb1a8f2efafbb7738711120aef48 100644 (file)
@@ -41,7 +41,7 @@ LOCAL_EXPORT_C_INCLUDE_DIRS += \
        $(MESA_TOP)/src/compiler/nir
 
 LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \
-       $(NIR_GENERATED_FILES))
+       $(NIR_GENERATED_FILES) $(SPIRV_GENERATED_FILES))
 
 # Modules using libmesa_nir must set LOCAL_GENERATED_SOURCES to this
 MESA_GEN_NIR_H := $(addprefix $(call local-generated-sources-dir)/, \
@@ -95,9 +95,6 @@ $(intermediates)/nir/nir_opt_algebraic.c: $(nir_opt_algebraic_deps)
        @mkdir -p $(dir $@)
        $(hide) $(MESA_PYTHON2) $(nir_opt_algebraic_gen) $< > $@
 
-LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \
-       $(SPIRV_GENERATED_FILES))
-
 $(intermediates)/spirv/spirv_info.c: $(LOCAL_PATH)/spirv/spirv_info_c.py $(LOCAL_PATH)/spirv/spirv.core.grammar.json
        @mkdir -p $(dir $@)
-       $(hide) $(MESA_PYTHON2) $(LOCAL_PATH)/spirv/spirv_info_c.py $(LOCAL_PATH)/spirv/spirv.core.grammar.json $@ || ($(RM) $@; false)
+       $(hide) $(MESA_PYTHON2) $^ $@ || ($(RM) $@; false)