Ver código fonte

auto generated images

SBird1337 7 anos atrás
pai
commit
0769036604
2 arquivos alterados com 17 adições e 7 exclusões
  1. 16
    6
      makefile
  2. 1
    1
      sots-private

+ 16
- 6
makefile Ver arquivo

@@ -17,6 +17,8 @@ PAGB_MAIN := g3headers
17 17
 PAGB_INCLUDE := $(PAGB_MAIN)/build/include/
18 18
 PAGB_LINK := $(PAGB_MAIN)/build/linker/BPRE.ld
19 19
 
20
+AUTO_ASSET_ROOT := sots-private/assets/images
21
+
20 22
 CHARMAP := charmap.txt
21 23
 
22 24
 DEFINES   := -DBPRE -DSOFTWARE_VERSION=0
@@ -44,22 +46,21 @@ CRY_AR   := $(SND_ROOT)/Crys/cry.a
44 46
 
45 47
 rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
46 48
 
49
+IMAGES=$(call rwildcard,$(AUTO_ASSET_ROOT),*.png)
50
+
51
+GEN_SRC		:= $(IMAGES:$(AUTO_ASSET_ROOT)/%.png=generated_image/%.c)
47 52
 ASM_SRC     := $(call rwildcard,src/,*.s)
48 53
 C_SRC       := $(call rwildcard,src/,*.c)
49 54
 DATA_SRC    := $(call rwildcard,data/,*.s)
50 55
 STRING		:= $(call rwildcard,string/$(LAN)/,*.txt)
51
-C_STRING	:= $(call rwildcard,string/$(LAN)/,*.c)
52 56
 STRING_SRC	:= $(STRING:%.txt=%.S)
53 57
 
54
-I_STRING	:= $(C_STRING:$.c=%.i)
55
-
56
-
57
-C_STR_OBJ	:= $(I_STRING:%.i=$(BLDPATH)/%.o)
58
+GEN_OBJ		:= $(GEN_SRC:%.c=$(BLDPATH)/%.o)
58 59
 STRING_OBJ	:= $(STRING_SRC:%.S=$(BLDPATH)/%.o)
59 60
 ASM_OBJ     := $(ASM_SRC:%.s=$(BLDPATH)/%.o)
60 61
 C_OBJ       := $(C_SRC:%.c=$(BLDPATH)/%.o)
61 62
 DATA_OBJ    := $(DATA_SRC:%.s=$(BLDPATH)/%.o)
62
-ALL_OBJ     := $(C_OBJ) $(ASM_OBJ) $(DATA_OBJ)
63
+ALL_OBJ     := $(C_OBJ) $(ASM_OBJ) $(DATA_OBJ) $(GEN_OBJ)
63 64
 
64 65
 
65 66
 .PRECIOUS: $(STRING_SRC)
@@ -78,6 +79,15 @@ $(BLDPATH)/%.o: %.s
78 79
 	$(CC) $(CFLAGS) -c -x assembler-with-cpp $*.i -o $@
79 80
 	@rm -f $*.i
80 81
 
82
+generated_image/%.c: $(AUTO_ASSET_ROOT)/%.png $(AUTO_ASSET_ROOT)/%.grit
83
+	@echo -e "\e[34mProcessing image $<\e[0m"
84
+	$(shell mkdir -p $(dir $@))
85
+	$(GRIT) $< -o $@ -ftc -ff $(<:%.png=%.grit)
86
+
87
+generated_image/%.c: $(AUTO_ASSET_ROOT)/%.png
88
+	@echo -e "\e[34mProcessing image $< (using directory grit file)\e[0m"
89
+	$(shell mkdir -p $(dir $@))
90
+	$(GRIT) $< -o $@ -ftc -ff $(<D)/$(notdir $(<D)).grit
81 91
 all: rom
82 92
 
83 93
 .PHONY: rom

+ 1
- 1
sots-private

@@ -1 +1 @@
1
-Subproject commit e2a1d40d351d65eea372dc9aec10224e1cb02dd1
1
+Subproject commit 4f1b4a1a0a474102f150ef72de752fa79b9eec82