summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2018-10-13 12:12:40 -0500
committerMarcus Huderle <huderlem@gmail.com>2018-10-13 12:12:40 -0500
commit2c0175fc457c247acf346e1b90c0bed6dfbdd201 (patch)
tree4d20c4fa1448e02a8dbb0fb80a58167656a69480 /Makefile
parent21417a00146a7b88afdf8406186580d96e3024b9 (diff)
Use lib code
Diffstat (limited to 'Makefile')
-rwxr-xr-xMakefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 7860c3c..f601590 100755
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,8 @@ CPPFLAGS := -I tools/agbcc/include -I tools/agbcc -iquote include -nostdinc -und
LDFLAGS = -Map ../../$(MAP)
+LIB := -L ../../tools/agbcc/lib -lgcc -lc
+
SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c
SCANINC := tools/scaninc/scaninc$(EXE)
PREPROC := tools/preproc/preproc$(EXE)
@@ -95,6 +97,9 @@ tidy:
%.lz: % ; $(GFX) $< $@
%.rl: % ; $(GFX) $< $@
+$(C_BUILDDIR)/libc.o: CC1 := tools/agbcc/bin/old_agbcc
+$(C_BUILDDIR)/libc.o: CFLAGS := -O2
+
$(C_BUILDDIR)/m4a_2.o: CC1 := tools/agbcc/bin/old_agbcc
$(C_BUILDDIR)/m4a_4.o: CC1 := tools/agbcc/bin/old_agbcc
@@ -132,7 +137,7 @@ $(OBJ_DIR)/ld_script.ld: ld_script.ld
cp $< $@
$(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS)
- cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(OBJS_REL)
+ cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(OBJS_REL) $(LIB)
$(ROM): $(ELF)
$(OBJCOPY) -O binary $< $@