Browse Source

auto generated images

SBird1337 7 years ago
parent
commit
0769036604
2 changed files with 17 additions and 7 deletions
  1. 16
    6
      makefile
  2. 1
    1
      sots-private

+ 16
- 6
makefile View File

17
 PAGB_INCLUDE := $(PAGB_MAIN)/build/include/
17
 PAGB_INCLUDE := $(PAGB_MAIN)/build/include/
18
 PAGB_LINK := $(PAGB_MAIN)/build/linker/BPRE.ld
18
 PAGB_LINK := $(PAGB_MAIN)/build/linker/BPRE.ld
19
 
19
 
20
+AUTO_ASSET_ROOT := sots-private/assets/images
21
+
20
 CHARMAP := charmap.txt
22
 CHARMAP := charmap.txt
21
 
23
 
22
 DEFINES   := -DBPRE -DSOFTWARE_VERSION=0
24
 DEFINES   := -DBPRE -DSOFTWARE_VERSION=0
44
 
46
 
45
 rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
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
 ASM_SRC     := $(call rwildcard,src/,*.s)
52
 ASM_SRC     := $(call rwildcard,src/,*.s)
48
 C_SRC       := $(call rwildcard,src/,*.c)
53
 C_SRC       := $(call rwildcard,src/,*.c)
49
 DATA_SRC    := $(call rwildcard,data/,*.s)
54
 DATA_SRC    := $(call rwildcard,data/,*.s)
50
 STRING		:= $(call rwildcard,string/$(LAN)/,*.txt)
55
 STRING		:= $(call rwildcard,string/$(LAN)/,*.txt)
51
-C_STRING	:= $(call rwildcard,string/$(LAN)/,*.c)
52
 STRING_SRC	:= $(STRING:%.txt=%.S)
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
 STRING_OBJ	:= $(STRING_SRC:%.S=$(BLDPATH)/%.o)
59
 STRING_OBJ	:= $(STRING_SRC:%.S=$(BLDPATH)/%.o)
59
 ASM_OBJ     := $(ASM_SRC:%.s=$(BLDPATH)/%.o)
60
 ASM_OBJ     := $(ASM_SRC:%.s=$(BLDPATH)/%.o)
60
 C_OBJ       := $(C_SRC:%.c=$(BLDPATH)/%.o)
61
 C_OBJ       := $(C_SRC:%.c=$(BLDPATH)/%.o)
61
 DATA_OBJ    := $(DATA_SRC:%.s=$(BLDPATH)/%.o)
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
 .PRECIOUS: $(STRING_SRC)
66
 .PRECIOUS: $(STRING_SRC)
78
 	$(CC) $(CFLAGS) -c -x assembler-with-cpp $*.i -o $@
79
 	$(CC) $(CFLAGS) -c -x assembler-with-cpp $*.i -o $@
79
 	@rm -f $*.i
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
 all: rom
91
 all: rom
82
 
92
 
83
 .PHONY: rom
93
 .PHONY: rom

+ 1
- 1
sots-private

1
-Subproject commit e2a1d40d351d65eea372dc9aec10224e1cb02dd1
1
+Subproject commit 4f1b4a1a0a474102f150ef72de752fa79b9eec82