i965: fix autotools/android build
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 20 Mar 2018 14:59:57 +0000 (14:59 +0000)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 20 Mar 2018 16:58:29 +0000 (16:58 +0000)
Autotools/android builds generate the header & code files in 2 steps,
but the code generation requires the name of the header file to
include it.

This change generates both files in one command.

Fixes: 035cc7a12dc ("i965: perf: reduce i965 binary size")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/mesa/drivers/dri/i965/Android.mk
src/mesa/drivers/dri/i965/Makefile.am

index a3d010a5894423c4acac6568d4cefedd9775f9e8..8c4a613bcf3460b12be4624557b078aa8434fb78 100644 (file)
@@ -312,15 +312,12 @@ LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \
 i965_oa_xml_FILES := $(addprefix $(LOCAL_PATH)/, \
        $(i965_oa_xml_FILES))
 
-$(intermediates)/brw_oa_metrics.h: $(LOCAL_PATH)/brw_oa.py $(i965_oa_xml_FILES)
-       @echo "target Generated: $(PRIVATE_MODULE) <= $(notdir $(@))"
-       @mkdir -p $(dir $@)
-       $(hide) $(MESA_PYTHON2) $< --header=$@ $(i965_oa_xml_FILES)
-
 $(intermediates)/brw_oa_metrics.c: $(LOCAL_PATH)/brw_oa.py $(i965_oa_xml_FILES)
        @echo "target Generated: $(PRIVATE_MODULE) <= $(notdir $(@))"
        @mkdir -p $(dir $@)
-       $(hide) $(MESA_PYTHON2) $< --code=$@ $(i965_oa_xml_FILES)
+       $(hide) $(MESA_PYTHON2) $< --code=$@ $(i965_oa_xml_FILES) --header=$@ $(i965_oa_xml_FILES)
+
+$(intermediates)/brw_oa_metrics.h: $(intermediates)/brw_oa_metrics.c
 
 include $(MESA_COMMON_MK)
 include $(BUILD_SHARED_LIBRARY)
index 8c8ecc6d76be950b0c0de42b65060d80e3261e92..fe106b4257ce0bb712b5ddaaf49919e4e78d68d4 100644 (file)
@@ -114,11 +114,7 @@ EXTRA_DIST = \
        $(i965_oa_xml_FILES) \
        meson.build
 
-# Note: we avoid using a multi target rule here and outputting both the
-# .c and .h files in one go so we don't hit problems with parallel
-# make and multiple invocations of the same script trying to write
-# to the same files.
-brw_oa_metrics.h: brw_oa.py $(i965_oa_xml_FILES)
-       $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/brw_oa.py --header=$(builddir)/brw_oa_metrics.h $(i965_oa_xml_FILES)
 brw_oa_metrics.c: brw_oa.py $(i965_oa_xml_FILES)
-       $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/brw_oa.py --code=$(builddir)/brw_oa_metrics.c $(i965_oa_xml_FILES)
+       $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/brw_oa.py --code=$(builddir)/brw_oa_metrics.c --header=$(builddir)/brw_oa_metrics.h $(i965_oa_xml_FILES)
+
+brw_oa_metrics.h: brw_oa_metrics.c