#
# Generated By: dol2asm
#

M3_TARGET := $(BUILD_DIR)/rel/d/a/d_a_bg.plf
M3_LDSCRIPT := $(BUILD_DIR)/rel/d/a/d_a_bg.lcf
M3_MAP := $(BUILD_DIR)/rel/d/a/d_a_bg.map

M3_CPP_FILES := \
	rel/executor.cpp \
	rel/d/a/d_a_bg/d_a_bg.cpp \

M3_O_FILES := \
	$(BUILD_DIR)/rel/executor.o \
	$(BUILD_DIR)/rel/d/a/d_a_bg/d_a_bg.o \

M3_LIBS := \

M3_CFLAGS := \
	-pool off \
	-sdata 0 \
	-sdata2 0 \

M3_LDFLAGS := \
	-nodefaults \
	-fp hard \
	-proc gekko \
	-linkmode moreram \
	-sdata 0 \
	-sdata2 0 \
	-m _prolog \
	-lcf $(M3_LDSCRIPT) \
	-unused -map $(M3_MAP) \
	-w off \

$(M3_TARGET): $(M3_O_FILES) $(M3_LIBS)
	@echo [  3] creating $(M3_TARGET)
	@echo $(M3_LIBS) $(M3_O_FILES) > build/M3_ofiles
	@python3 tools/lcf.py rel 3 --output $(M3_LDSCRIPT)
	@$(LD) -opt_partial -strip_partial $(M3_LDFLAGS) -o $(M3_TARGET) @build/M3_ofiles

$(BUILD_DIR)/rel/d/a/d_a_bg/%.o: rel/d/a/d_a_bg/%.cpp $(BUILD_DIR)/rel/d/a/d_a_bg/%.d
	@echo [  3] building $@
	@mkdir -p $(@D)
	@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
	@$(CC) $(CFLAGS) $(M3_CFLAGS) $(DEPFLAGS) -c -o $(dir $@) $(basename $@).cpp
	@if [ -z '$(DISABLE_DEPS)' ]; then tools/transform-dep.py '$(basename $@).d' '$(basename $@).d'; touch -c $@; fi

ifndef DISABLE_DEPS
M3_D_FILES := $(M3_O_FILES:.o=.d)
$(M3_D_FILES):
include $(wildcard $(M3_D_FILES))
endif


