Skip to content

Commit

Permalink
Implement agbcc's libc and allow a custom cxx compiler to be passed t…
Browse files Browse the repository at this point in the history
…o build_tools.sh
  • Loading branch information
scnorton committed Jan 9, 2018
1 parent 3b09726 commit 09d3da1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 182 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ LDFLAGS = -Map ../../$(MAP)
OBJCOPY := $(DEVKITARM)/bin/arm-none-eabi-objcopy

LIBGCC := tools/agbcc/lib/libgcc.a
LIBC := tools/agbcc/lib/libc.a

SHA1 := sha1sum -c

Expand Down Expand Up @@ -154,7 +155,7 @@ $(OBJ_DIR)/ld_script.ld: ld_script.txt $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_comm
cd $(OBJ_DIR) && sed -f ../../ld_script.sed ../../$< | sed "s#tools/#../../tools/#g" > ld_script.ld

$(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS)
cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(OBJS_REL) ../../$(LIBGCC)
cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(OBJS_REL) ../../$(LIBGCC) ../../$(LIBC)

$(ROM): $(ELF)
$(OBJCOPY) -O binary --gap-fill 0xFF --pad-to 0x9000000 $< $@
14 changes: 7 additions & 7 deletions build_tools.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
make -C tools/gbagfx
make -C tools/scaninc
make -C tools/preproc
make -C tools/bin2c
make -C tools/rsfont
make -C tools/aif2pcm
make -C tools/ramscrgen
make -C tools/gbagfx CXX=${1:=g++}
make -C tools/scaninc CXX=${1:=g++}
make -C tools/preproc CXX=${1:=g++}
make -C tools/bin2c CXX=${1:=g++}
make -C tools/rsfont CXX=${1:=g++}
make -C tools/aif2pcm CXX=${1:=g++}
make -C tools/ramscrgen CXX=${1:=g++}
5 changes: 4 additions & 1 deletion ld_script.txt
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,10 @@ SECTIONS {
tools/agbcc/lib/libgcc.a:fp-bit.o(.text);
tools/agbcc/lib/libgcc.a:_lshrdi3.o(.text);
tools/agbcc/lib/libgcc.a:_negdi2.o(.text);
src/libc.o(.text);
tools/agbcc/lib/libc.a:memcpy.o(.text);
tools/agbcc/lib/libc.a:memset.o(.text);
tools/agbcc/lib/libc.a:strcmp.o(.text);
tools/agbcc/lib/libc.a:strcpy.o(.text);
} =0

.rodata :
Expand Down
173 changes: 0 additions & 173 deletions src/libc.c

This file was deleted.

0 comments on commit 09d3da1

Please sign in to comment.