|
@@ -6,6 +6,8 @@ CC := arm-none-eabi-gcc
|
6
|
6
|
ARS := armips
|
7
|
7
|
MAKE := make
|
8
|
8
|
NM := arm-none-eabi-nm
|
|
9
|
+LAN := de
|
|
10
|
+STRAGB := string2agb
|
9
|
11
|
|
10
|
12
|
export PATH := $(realpath ../tools):$(PATH)
|
11
|
13
|
|
|
@@ -17,6 +19,7 @@ LDFLAGS := -z muldefs
|
17
|
19
|
BLDPATH := object
|
18
|
20
|
OUTPATH := build
|
19
|
21
|
SOURCEDIR := src
|
|
22
|
+STRINGDIR := string
|
20
|
23
|
|
21
|
24
|
MAIN_OBJ := $(BLDPATH)/linked.o
|
22
|
25
|
SPRITES := $(BLDPATH)/pkmn_sprites.o
|
|
@@ -37,7 +40,10 @@ ASM_SRC := $(call rwildcard,src/,*.s)
|
37
|
40
|
C_SRC := $(call rwildcard,src/,*.c)
|
38
|
41
|
DATA_SRC_PP := $(call rwildcard,data/,*.S)
|
39
|
42
|
DATA_SRC := $(call rwildcard,data/,*.s)
|
|
43
|
+STRING := $(call rwildcard,string/$(LAN)/,*.txt)
|
|
44
|
+STRING_SRC := $(STRING:%.txt=%.S)
|
40
|
45
|
|
|
46
|
+STRING_OBJ := $(STRING_SRC:%.S=$(BLDPATH)/%.o)
|
41
|
47
|
ASM_OBJ_PP := $(ASM_SRC_PP:%.S=$(BLDPATH)/%.o)
|
42
|
48
|
ASM_OBJ := $(ASM_SRC:%.s=$(BLDPATH)/%.o)
|
43
|
49
|
C_OBJ := $(C_SRC:%.c=$(BLDPATH)/%.o)
|
|
@@ -46,6 +52,11 @@ DATA_OBJ := $(DATA_SRC:%.s=$(BLDPATH)/%.o)
|
46
|
52
|
ALL_OBJ := $(C_OBJ) $(ASM_OBJ_PP) $(ASM_OBJ) $(DATA_OBJ_PP) $(DATA_OBJ)
|
47
|
53
|
|
48
|
54
|
|
|
55
|
+
|
|
56
|
+$(STRINGDIR)/%.S: $(STRINGDIR)/%.txt
|
|
57
|
+ @echo hello
|
|
58
|
+ $(STRAGB) -o $@ -i $< -t string/table.tbl -e 0xFF
|
|
59
|
+
|
49
|
60
|
$(BLDPATH)/%.o: %.c $(ASSETS)
|
50
|
61
|
$(shell mkdir -p $(dir $@))
|
51
|
62
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
@@ -63,11 +74,11 @@ all: rom
|
63
|
74
|
.PHONY: rom
|
64
|
75
|
rom: main.asm $(MAIN_OBJ)
|
65
|
76
|
$(ARS) $<
|
66
|
|
- $(NM) $(BLDPATH)/linked.o -n -g --defined-only | \
|
67
|
|
- sed -e '{s/^/0x/g};{/.*\sA\s.*/d};{s/\sT\s/ /g}' > $(OUTPATH)/__symbols.sym
|
|
77
|
+ #$(NM) $(BLDPATH)/linked.o -n -g --defined-only | \
|
|
78
|
+ # sed -e '{s/^/0x/g};{/.*\sA\s.*/d};{s/\sT\s/ /g}' > $(OUTPATH)/__symbols.sym
|
68
|
79
|
@echo "*** SUCCESSFULLY BUILT PROJECT ***"
|
69
|
|
-
|
70
|
|
-$(MAIN_OBJ): $(ALL_OBJ) $(ICONS_AR) $(SPRITES) $(DYN_OVER) $(MUSIC_AR) $(SMPL_AR) $(VOICE_AR) $(LIST_AR) $(CRY_AR)
|
|
80
|
+
|
|
81
|
+$(MAIN_OBJ): $(ALL_OBJ) $(ICONS_AR) $(SPRITES) $(DYN_OVER) $(MUSIC_AR) $(SMPL_AR) $(VOICE_AR) $(LIST_AR) $(CRY_AR) $(STRING_OBJ)
|
71
|
82
|
$(LD) $(LDFLAGS) -T linker.ld -T bpre.sym --whole-archive -r -o $@ --start-group $^ --end-group
|
72
|
83
|
|
73
|
84
|
.PHONY: clean
|