#
# Generated By: dol2asm
#

M51_TARGET := $(BUILD_DIR)/rel/d/a/d_a_midna.plf
M51_LDSCRIPT := $(BUILD_DIR)/rel/d/a/d_a_midna.lcf
M51_MAP := $(BUILD_DIR)/rel/d/a/d_a_midna.map

M51_CPP_FILES := \
	rel/executor.cpp \
	rel/d/a/d_a_midna/unknown_translation_unit_bss.cpp \
	rel/d/a/d_a_midna/d_a_midna.cpp \

M51_O_FILES := \
	$(BUILD_DIR)/rel/executor.o \
	$(BUILD_DIR)/rel/d/a/d_a_midna/unknown_translation_unit_bss.o \
	$(BUILD_DIR)/rel/d/a/d_a_midna/d_a_midna.o \

M51_LIBS := \

M51_CFLAGS := \
	-sdata 0 \
	-sdata2 0 \

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

$(M51_TARGET): $(M51_O_FILES) $(M51_LIBS)
	@echo [ 51] creating $(M51_TARGET)
	@echo $(M51_LIBS) $(M51_O_FILES) > build/M51_ofiles
	@python3 tools/lcf.py rel 51 --output $(M51_LDSCRIPT)
	@$(LD) -opt_partial -strip_partial $(M51_LDFLAGS) -o $(M51_TARGET) @build/M51_ofiles

$(BUILD_DIR)/rel/d/a/d_a_midna/%.o: rel/d/a/d_a_midna/%.cpp $(BUILD_DIR)/rel/d/a/d_a_midna/%.d
	@echo [ 51] building $@
	@mkdir -p $(@D)
	@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
	@$(CC) $(CFLAGS) $(M51_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
M51_D_FILES := $(M51_O_FILES:.o=.d)
$(M51_D_FILES):
include $(wildcard $(M51_D_FILES))
endif


