Adding export option
This commit is contained in:
parent
8112a10390
commit
49fb062cdf
2 changed files with 43 additions and 6 deletions
4
Makefile
4
Makefile
|
@ -17,7 +17,7 @@ export TEXTURES := $(wildcard $(TEXTURESET_FOLDER)/*)
|
|||
|
||||
### RECIPE PART ###
|
||||
|
||||
all : previews subformats del_obsolete
|
||||
all : previews del_obsolete export
|
||||
|
||||
previews: $(SBSARFILES)
|
||||
$(MAKE) -f Makefile_previews all
|
||||
|
@ -46,7 +46,7 @@ del_obsolete: $(SBS_DIR)
|
|||
fi ;\
|
||||
done
|
||||
|
||||
export: $(SBSARFILES)
|
||||
export: $(SBSARFILES) | subformats
|
||||
$(MAKE) -f Makefile_export all
|
||||
|
||||
# Recipe to make sbsar, its main PNG files and its preset textureset file
|
||||
|
|
|
@ -1,7 +1,44 @@
|
|||
# Variables définitions
|
||||
SRC := $(wildcard $(PNG1024_DIR)/*.png)
|
||||
TEXTURE_LIST := $(notdir $(wildcard $(TEXTURESET_FOLDER)/*))
|
||||
|
||||
all:
|
||||
echo "MATERIALLIST :"$(MATERIALLIST);\
|
||||
rendertype=$$(cat $(MATERIALLIST) | jq -r --arg folder "$$presetname" '.[] | select(.name==$$folder) | .type');\
|
||||
# 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)))
|
||||
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)))
|
||||
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)))
|
||||
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)))
|
||||
TARGET_256 := $(foreach TEXTURENAME, $(TEXTURE_LIST), $(EACH_REQUIR_256))
|
||||
|
||||
all: $(DEST_1024) $(DEST_512) $(DEST_256)
|
||||
|
||||
$(DEST_1024): */%.png: $(REQUIR_1024)
|
||||
@ [ -d $$(dirname $@) ] || mkdir -p $$(dirname $@)
|
||||
@ echo "EXPORT : Processing $(PNG1024_DIR)/$(@F) -> $@"
|
||||
@ cp $(PNG1024_DIR)/$(@F) $@
|
||||
|
||||
$(DEST_512): */%.png: $(REQUIR_512)
|
||||
@ [ -d $$(dirname $@) ] || mkdir -p $$(dirname $@)
|
||||
@ echo "EXPORT : Processing $(PNG512_DIR)/$(@F) -> $@"
|
||||
@ cp $(PNG512_DIR)/$(@F) $@
|
||||
|
||||
$(DEST_256): */%.png: $(REQUIR_256)
|
||||
@ [ -d $$(dirname $@) ] || mkdir -p $$(dirname $@)
|
||||
@ echo "EXPORT : Processing $(PNG256_DIR)/$(@F) -> $@"
|
||||
@ cp $(PNG256_DIR)/$(@F) $@
|
||||
|
||||
|
|
Loading…
Reference in a new issue