From: Mauro Rossi Date: Sat, 20 Jun 2020 17:07:44 +0000 (+0200) Subject: android: freedreno/ir3: add missing generated sources and rules X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=41683157e778722ccd94c7d224f4961475537dc6;p=mesa.git android: freedreno/ir3: add missing generated sources and rules Changelog: - Makefile.sources: add ir3_lexer.c and ir3_parser.{c,h} generated sources - Android.ir3.mk: add the necessary generated sources rules - Android.ir3.mk: add the necessary include paths - src/gallium/drivers/freedreno/Android.gen.mk: generate only ir3_nir_{imul,trig}.c for the moment Fixes the following building error: target C: libfreedreno_ir3 <= external/mesa/src/freedreno/ir3/ir3_assembler.c FAILED: out/target/product/x86_64/obj/STATIC_LIBRARIES/libfreedreno_ir3_intermediates/ir3/ir3_assembler.o ... external/mesa/src/freedreno/ir3/ir3_assembler.c:28:10: fatal error: 'ir3_parser.h' file not found ^~~~~~~~~~~~~~ 1 error generated. Fixes: 1e8808a4a0f ("freedreno/ir3: refactor out helper to compile shader from asm") Signed-off-by: Mauro Rossi Acked-by: Rob Clark Acked-by: Eric Engestrom Part-of: --- diff --git a/src/freedreno/Android.ir3.mk b/src/freedreno/Android.ir3.mk index c6a9d3288d7..ad3625a85bb 100644 --- a/src/freedreno/Android.ir3.mk +++ b/src/freedreno/Android.ir3.mk @@ -31,21 +31,51 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ $(ir3_SOURCES) +LOCAL_MODULE := libfreedreno_ir3 + +LOCAL_MODULE_CLASS := STATIC_LIBRARIES + +intermediates := $(call local-generated-sources-dir) + LOCAL_C_INCLUDES := \ $(MESA_TOP)/src/compiler/nir \ $(MESA_TOP)/src/gallium/include \ $(MESA_TOP)/src/gallium/auxiliary \ $(MESA_TOP)/prebuilt-intermediates/nir \ + $(MESA_TOP)/src/freedreno/ir3 \ + $(intermediates)/ir3 # We need libmesa_nir to get NIR's generated include directories. LOCAL_STATIC_LIBRARIES := \ libmesa_nir -LOCAL_MODULE := libfreedreno_ir3 - LOCAL_GENERATED_SOURCES := \ $(MESA_GEN_GLSL_H) \ $(MESA_GEN_NIR_H) +LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \ + ir3/ir3_lexer.c ir3/ir3_parser.c ir3/ir3_parser.h) + +ir3_lexer_deps := \ + $(MESA_TOP)/src/freedreno/ir3/ir3_lexer.l + +ir3_parser_deps := \ + $(MESA_TOP)/src/freedreno/ir3/ir3_parser.y + +$(intermediates)/ir3/ir3_lexer.c: $(ir3_lexer_deps) + @mkdir -p $(dir $@) + @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))" + $(hide) flex -o $@ $< + +$(intermediates)/ir3/ir3_parser.c: $(ir3_parser_deps) + @mkdir -p $(dir $@) + @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))" + $(hide) bison $< --name-prefix=ir3_yy --output=$@ + +$(intermediates)/ir3/ir3_parser.h: $(ir3_parser_deps) + @mkdir -p $(dir $@) + @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))" + $(hide) bison $< --name-prefix=ir3_yy --defines=$@ + include $(MESA_COMMON_MK) include $(BUILD_STATIC_LIBRARY) diff --git a/src/freedreno/Makefile.sources b/src/freedreno/Makefile.sources index 1e6d114a969..908c7bdcb84 100644 --- a/src/freedreno/Makefile.sources +++ b/src/freedreno/Makefile.sources @@ -61,8 +61,11 @@ ir3_SOURCES := \ ir3/ir3_validate.c ir3_GENERATED_FILES := \ + ir3/ir3_lexer.c \ ir3/ir3_nir_trig.c \ - ir3/ir3_nir_imul.c + ir3/ir3_nir_imul.c \ + ir3/ir3_parser.c \ + ir3/ir3_parser.h perfcntrs_SOURCES := \ perfcntrs/fd2_perfcntr.c \ diff --git a/src/gallium/drivers/freedreno/Android.gen.mk b/src/gallium/drivers/freedreno/Android.gen.mk index 21ee52b7e33..b55e8d28a73 100644 --- a/src/gallium/drivers/freedreno/Android.gen.mk +++ b/src/gallium/drivers/freedreno/Android.gen.mk @@ -43,4 +43,4 @@ $(intermediates)/ir3/ir3_nir_imul.c: $(ir3_nir_imul_deps) $(hide) $(MESA_PYTHON2) $< -p $(MESA_TOP)/src/compiler/nir > $@ LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \ - $(ir3_GENERATED_FILES)) + ir3/ir3_nir_trig.c ir3/ir3_nir_imul.c)