|
@@ -28,12 +28,12 @@ DATA_DIR := data
|
28
|
28
|
SRCS := $(wildcard $(SRC_DIR)/*.c)
|
29
|
29
|
OBJS := $(SRCS:%.c=$(BUILD_DIR)/%.o)
|
30
|
30
|
|
31
|
|
-GIT := $(BUILD_DIR)/$(DATA_DIR)/git.c
|
32
|
|
-OBJS += $(GIT:%.c=%.o)
|
|
31
|
+GIT_GEN := $(DATA_DIR)/git.c
|
|
32
|
+OBJS += $(GIT_GEN:%.c=$(BUILD_DIR)/%.o)
|
33
|
33
|
|
34
|
|
-GEN_SRCS := $(BUILD_DIR)/$(DATA_DIR)/table_speed_shot.c
|
35
|
|
-GEN_SRCS += $(BUILD_DIR)/$(DATA_DIR)/table_speed_move.c
|
36
|
|
-OBJS += $(GEN_SRCS:%.c=%.o)
|
|
34
|
+GEN_SRCS := $(DATA_DIR)/table_speed_shot.c
|
|
35
|
+GEN_SRCS += $(DATA_DIR)/table_speed_move.c
|
|
36
|
+OBJS += $(GEN_SRCS:%.c=$(BUILD_DIR)/%.o)
|
37
|
37
|
|
38
|
38
|
IMAGES := $(wildcard $(DATA_DIR)/*.png)
|
39
|
39
|
SPRITES := $(IMAGES:%.png=$(BUILD_DIR)/%.c)
|
|
@@ -57,7 +57,7 @@ GBE_EMU := ~/bin/gbe/gbe_plus_qt.exe
|
57
|
57
|
FLASHER := flashgbx
|
58
|
58
|
|
59
|
59
|
LCCFLAGS := -Wa-l -Wl-m -Wp-MMD -Wf--opt-code-speed
|
60
|
|
-LCCFLAGS += -I$(SRC_DIR) -I$(BUILD_DIR)/$(DATA_DIR)
|
|
60
|
+LCCFLAGS += -I$(SRC_DIR) -I$(BUILD_DIR)/$(DATA_DIR) -I$(DATA_DIR)
|
61
|
61
|
LCCFLAGS += -Wm"-yn Duality" -Wm-yt0x1B -Wm-yoA -Wm-ya1 -Wm-yc -Wm-ys
|
62
|
62
|
LCCFLAGS += -autobank -Wb-ext=.rel -Wb-v -Wf-bo255
|
63
|
63
|
|
|
@@ -82,7 +82,7 @@ $(info BUILD_TYPE is $(BUILD_TYPE))
|
82
|
82
|
DEPS=$(OBJS:%.o=%.d)
|
83
|
83
|
-include $(DEPS)
|
84
|
84
|
|
85
|
|
-.PHONY: all run cloc sgb_run bgb_run gbe_run flash clean compile_commands.json usage $(GIT)
|
|
85
|
+.PHONY: all run cloc sgb_run bgb_run gbe_run flash clean compile_commands.json usage $(GIT_GEN)
|
86
|
86
|
.PRECIOUS: $(BUILD_DIR)/$(DATA_DIR)/%.c $(BUILD_DIR)/$(DATA_DIR)/%.h
|
87
|
87
|
|
88
|
88
|
all: $(BIN)
|
|
@@ -99,20 +99,20 @@ compile_commands.json:
|
99
|
99
|
@bear --config bear.cfg -- make -j4
|
100
|
100
|
@rm -rf bear.cfg
|
101
|
101
|
|
102
|
|
-$(GIT): $(DATA_DIR)/git.c
|
|
102
|
+$(GIT_GEN): $(DATA_DIR)/git.c_template
|
103
|
103
|
@mkdir -p $(@D)
|
104
|
104
|
@echo Generating $@ from $<
|
105
|
|
- @sed 's|GIT_VERSION|$(shell git describe --abbrev=7 --dirty --always --tags)|g' $< > $@
|
|
105
|
+ @sed 's|GIT_VERSION|"$(shell git describe --abbrev=7 --dirty --always --tags)"|g' $< > $@
|
106
|
106
|
|
107
|
|
-$(BUILD_DIR)/$(DATA_DIR)/table_speed_shot.c $(BUILD_DIR)/$(DATA_DIR)/table_speed_shot.h: util/gen_angles.py Makefile
|
|
107
|
+$(DATA_DIR)/table_speed_shot.c: util/gen_angles.py Makefile
|
108
|
108
|
@mkdir -p $(@D)
|
109
|
109
|
@echo Generating $@
|
110
|
|
- @util/gen_angles.py -n table_speed_shot -d $(BUILD_DIR)/$(DATA_DIR) -s 16 -w 2 -f 0 -m 42 -t int8_t
|
|
110
|
+ @util/gen_angles.py -n table_speed_shot -d $(DATA_DIR) -s 16 -w 2 -f 0 -m 42 -t int8_t
|
111
|
111
|
|
112
|
|
-$(BUILD_DIR)/$(DATA_DIR)/table_speed_move.c $(BUILD_DIR)/$(DATA_DIR)/table_speed_move.h: util/gen_angles.py Makefile
|
|
112
|
+$(DATA_DIR)/table_speed_move.c: util/gen_angles.py Makefile
|
113
|
113
|
@mkdir -p $(@D)
|
114
|
114
|
@echo Generating $@
|
115
|
|
- @util/gen_angles.py -n table_speed_move -d $(BUILD_DIR)/$(DATA_DIR) -s 16 -w 2 -f 0 -m 23 -t int8_t
|
|
115
|
+ @util/gen_angles.py -n table_speed_move -d $(DATA_DIR) -s 16 -w 2 -f 0 -m 23 -t int8_t
|
116
|
116
|
|
117
|
117
|
usage: $(BUILD_DIR)/$(BIN)
|
118
|
118
|
@echo Analyzing $<
|
|
@@ -183,7 +183,7 @@ $(BUILD_DIR)/%.o: %.s $(ASSETS) Makefile
|
183
|
183
|
@echo Assembling $<
|
184
|
184
|
@$(LCC) $(LCCFLAGS) -c -o $@ $<
|
185
|
185
|
|
186
|
|
-$(BUILD_DIR)/$(BIN): $(OBJS) $(GIT) Makefile
|
|
186
|
+$(BUILD_DIR)/$(BIN): $(OBJS) Makefile
|
187
|
187
|
@echo Linking $@
|
188
|
188
|
@$(LCC) $(LCCFLAGS) -o $@ $(OBJS)
|
189
|
189
|
|
|
@@ -191,4 +191,4 @@ $(BIN): $(BUILD_DIR)/$(BIN) usage
|
191
|
191
|
@cp $< $@
|
192
|
192
|
|
193
|
193
|
clean:
|
194
|
|
- rm -rf $(BUILD_DIR) $(BIN)
|
|
194
|
+ rm -rf $(BUILD_DIR) $(BIN) $(DATA_DIR)/*.c $(DATA_DIR)/*.h
|