From 61cd3a9533fa9c521bba9bc0f67429352e5ff24a Mon Sep 17 00:00:00 2001 From: yannk Date: Thu, 30 Dec 2021 09:33:51 +0100 Subject: [PATCH] Modify the DEST_* variavle definition by changing the end of EACH_DEST assignation based on *.png construction to take in account only the corresponding ones to the actual material being processed --- Makefile_export | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile_export b/Makefile_export index ca71a17..5d6bbf3 100644 --- a/Makefile_export +++ b/Makefile_export @@ -2,24 +2,21 @@ TEXTURE_LIST := $(notdir $(wildcard $(TEXTURESET_FOLDER)/*)) # Build list of destination filenames for 1024 files -SRC_1024 := $(wildcard $(PNG1024_DIR)/*.png) -EACH_DEST_1024 = $(foreach DEST, $(shell cat $(MATERIALLIST) | jq -r --arg folder "$(TEXTURENAME)" '.[] | select(.name==$$folder) | .destination_1024 | join(" ")'), $(subst $(PNG1024_DIR)/, $(DEST)/, $(SRC_1024))) +EACH_DEST_1024 = $(foreach DEST, $(shell cat $(MATERIALLIST) | jq -r --arg folder "$(TEXTURENAME)" '.[] | select(.name==$$folder) | .destination_1024 | join(" ")'), $(subst $(PNG1024_DIR)/, $(DEST)/, $(wildcard $(PNG1024_DIR)/$(TEXTURENAME)*.png))) DEST_1024 := $(foreach TEXTURENAME, $(TEXTURE_LIST), $(EACH_DEST_1024)) REQUIR_1024 := $(PNG1024_DIR)/%.png EACH_REQUIR_1024 = $(foreach DEST, $(shell cat $(MATERIALLIST) | jq -r --arg folder "$(TEXTURENAME)" '.[] | select(.name==$$folder) | .destination_1024 | join(" ")'), $(subst $(PNG1024_DIR)/, $(DEST)/, $(REQUIR_1024))) TARGET_1024 := $(foreach TEXTURENAME, $(TEXTURE_LIST), $(EACH_REQUIR_1024)) # Build list of destination filenames for 512 files -SRC_512 := $(wildcard $(PNG512_DIR)/*.png) -EACH_DEST_512 = $(foreach DEST, $(shell cat $(MATERIALLIST) | jq -r --arg folder "$(TEXTURENAME)" '.[] | select(.name==$$folder) | .destination_512 | join(" ")'), $(subst $(PNG512_DIR)/, $(DEST)/, $(SRC_512))) +EACH_DEST_512 = $(foreach DEST, $(shell cat $(MATERIALLIST) | jq -r --arg folder "$(TEXTURENAME)" '.[] | select(.name==$$folder) | .destination_512 | join(" ")'), $(subst $(PNG512_DIR)/, $(DEST)/, $(wildcard $(PNG512_DIR)/$(TEXTURENAME)*.png))) DEST_512 := $(foreach TEXTURENAME, $(TEXTURE_LIST), $(EACH_DEST_512)) REQUIR_512 := $(PNG512_DIR)/%.png EACH_REQUIR_512 = $(foreach DEST, $(shell cat $(MATERIALLIST) | jq -r --arg folder "$(TEXTURENAME)" '.[] | select(.name==$$folder) | .destination_512 | join(" ")'), $(subst $(PNG512_DIR)/, $(DEST)/, $(REQUIR_512))) TARGET_512 := $(foreach TEXTURENAME, $(TEXTURE_LIST), $(EACH_REQUIR_512)) # Build list of destination filenames for 256 files -SRC_256 := $(wildcard $(PNG256_DIR)/*.png) -EACH_DEST_256 = $(foreach DEST, $(shell cat $(MATERIALLIST) | jq -r --arg folder "$(TEXTURENAME)" '.[] | select(.name==$$folder) | .destination_256 | join(" ")'), $(subst $(PNG256_DIR)/, $(DEST)/, $(SRC_256))) +EACH_DEST_256 = $(foreach DEST, $(shell cat $(MATERIALLIST) | jq -r --arg folder "$(TEXTURENAME)" '.[] | select(.name==$$folder) | .destination_256 | join(" ")'), $(subst $(PNG256_DIR)/, $(DEST)/, $(wildcard $(PNG256_DIR)/$(TEXTURENAME)*.png))) DEST_256 := $(foreach TEXTURENAME, $(TEXTURE_LIST), $(EACH_DEST_256)) REQUIR_256 := $(PNG256_DIR)/%.png EACH_REQUIR_256 = $(foreach DEST, $(shell cat $(MATERIALLIST) | jq -r --arg folder "$(TEXTURENAME)" '.[] | select(.name==$$folder) | .destination_256 | join(" ")'), $(subst $(PNG256_DIR)/, $(DEST)/, $(REQUIR_256))) @@ -28,6 +25,8 @@ TARGET_256 := $(foreach TEXTURENAME, $(TEXTURE_LIST), $(EACH_REQUIR_256)) all: $(DEST_1024) $(DEST_512) $(DEST_256) $(DEST_1024): */%.png: $(REQUIR_1024) + @ echo "DEST_1024 : $(DEST_1024)" + @ echo "TARGET_1024 : $(TARGET_1024)" @ [ -d $$(dirname $@) ] || mkdir -p $$(dirname $@) @ echo "EXPORT : Processing $(PNG1024_DIR)/$(@F) -> $@" @ cp $(PNG1024_DIR)/$(@F) $@