Move asm srcs to src

This commit is contained in:
PikalaxALT 2019-08-06 14:08:13 -04:00 committed by huderlem
parent f08615881e
commit a4d5624ad6
8 changed files with 22 additions and 11 deletions

View File

@ -123,6 +123,9 @@ endif
C_SRCS := $(wildcard $(C_SUBDIR)/*.c $(C_SUBDIR)/*/*.c $(C_SUBDIR)/*/*/*.c)
C_OBJS := $(patsubst $(C_SUBDIR)/%.c,$(C_BUILDDIR)/%.o,$(C_SRCS))
C_ASM_SRCS += $(wildcard $(C_SUBDIR)/*.s $(C_SUBDIR)/*/*.s $(C_SUBDIR)/*/*/*.s)
C_ASM_OBJS := $(patsubst $(C_SUBDIR)/%.s,$(C_BUILDDIR)/%.o,$(C_ASM_SRCS))
ASM_SRCS := $(wildcard $(ASM_SUBDIR)/*.s)
ASM_OBJS := $(patsubst $(ASM_SUBDIR)/%.s,$(ASM_BUILDDIR)/%.o,$(ASM_SRCS))
@ -135,7 +138,7 @@ SONG_OBJS := $(patsubst $(SONG_SUBDIR)/%.s,$(SONG_BUILDDIR)/%.o,$(SONG_SRCS))
MID_SRCS := $(wildcard $(MID_SUBDIR)/*.mid)
MID_OBJS := $(patsubst $(MID_SUBDIR)/%.mid,$(MID_BUILDDIR)/%.o,$(MID_SRCS))
OBJS := $(C_OBJS) $(ASM_OBJS) $(DATA_ASM_OBJS) $(SONG_OBJS) $(MID_OBJS)
OBJS := $(C_OBJS) $(C_ASM_OBJS) $(ASM_OBJS) $(DATA_ASM_OBJS) $(SONG_OBJS) $(MID_OBJS)
OBJS_REL := $(patsubst $(OBJ_DIR)/%,%,$(OBJS))
SUBDIRS := $(sort $(dir $(OBJS)))
@ -235,6 +238,15 @@ $(C_BUILDDIR)/%.o : $(C_SUBDIR)/%.c $$(c_dep)
@echo -e ".text\n\t.align\t2, 0\n" >> $(C_BUILDDIR)/$*.s
$(AS) $(ASFLAGS) -o $@ $(C_BUILDDIR)/$*.s
ifeq ($(NODEP),1)
$(C_BUILDDIR)/%.o: c_asm_dep :=
else
$(C_BUILDDIR)/%.o: c_asm_dep = $(shell $(SCANINC) -I "" $(C_SUBDIR)/$*.s)
endif
$(C_BUILDDIR)/%.o: $(C_SUBDIR)/%.s $$(c_asm_dep)
$(AS) $(ASFLAGS) -o $@ $<
ifeq ($(NODEP),1)
$(ASM_BUILDDIR)/%.o: asm_dep :=
else

View File

@ -47,7 +47,7 @@ SECTIONS {
.text :
ALIGN(4)
{
asm/crt0.o(.text);
src/crt0.o(.text);
src/main.o(.text);
src/alloc.o(.text);
src/dma3_manager.o(.text);
@ -348,8 +348,8 @@ SECTIONS {
lib_text :
ALIGN(4)
{
asm/libgcnmultiboot.o(.text);
asm/m4a_1.o(.text);
src/libgcnmultiboot.o(.text);
src/m4a_1.o(.text);
src/m4a.o(.text);
src/agb_flash.o(.text);
src/agb_flash_1m.o(.text);
@ -360,7 +360,7 @@ SECTIONS {
asm/librfu_intr.o(.text);
src/librfu_rfu.o(.text);
asm/librfu.o(.text);
asm/libagbsyscall.o(.text);
src/libagbsyscall.o(.text);
*libgcc.a:_call_via_rX.o(.text);
*libgcc.a:_divdi3.o(.text);
*libgcc.a:_divsi3.o(.text);

View File

@ -25,7 +25,6 @@ SECTIONS {
{
/* .bss starts at 0x3000000 */
src/*.o(.bss);
asm/m4a_1.o(.bss);
/* .bss.code starts at 0x3001AA8 */
src/m4a.o(.bss.code);
@ -42,7 +41,7 @@ SECTIONS {
.text :
ALIGN(4)
{
asm/crt0.o(.text);
src/crt0.o(.text);
src/*.o(.text);
asm/*.o(.text);
} =0
@ -56,8 +55,8 @@ SECTIONS {
lib_text :
ALIGN(4)
{
asm/libgcnmultiboot.o(.text);
asm/m4a_1.o(.text);
src/libgcnmultiboot.o(.text);
src/m4a_1.o(.text);
src/m4a.o(.text);
src/agb_flash.o(.text);
src/agb_flash_1m.o(.text);
@ -68,7 +67,7 @@ SECTIONS {
asm/librfu_intr.o(.text);
src/librfu_rfu.o(.text);
asm/librfu.o(.text);
asm/libagbsyscall.o(.text);
src/libagbsyscall.o(.text);
*libgcc.a:*.o(.text*);
*libc.a:*.o(.text*);
src/libisagbprn.o(.text);

View File

@ -51,7 +51,7 @@
.include "src/pokenav_unk_10.o"
.include "src/ereader_helpers.o"
.include "src/faraway_island.o"
.include "asm/m4a_1.o"
.include "src/m4a_1.o"
.include "src/agb_flash.o"
.include "src/siirtc.o"
.include "*libgcc.a:dp-bit.o"