From 45ee3a687d0bbabc03dba53b9a8250952e8abe59 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 29 Jan 2021 18:36:39 -0500 Subject: Add comments for some data in crt0.s --- Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 78a2c2a4f..d97634399 100644 --- a/Makefile +++ b/Makefile @@ -303,6 +303,7 @@ $1: $2 $$(shell $(SCANINC) -I include -I "" $2) $$(PREPROC) $$< charmap.txt | $$(CPP) -I include | $$(AS) $$(ASFLAGS) -o $$@ endef $(foreach src, $(REGULAR_DATA_ASM_SRCS), $(eval $(call DATA_ASM_DEP,$(patsubst $(DATA_ASM_SUBDIR)/%.s,$(DATA_ASM_BUILDDIR)/%.o, $(src)),$(src)))) +$(foreach src, $(C_ASM_SRCS), $(eval $(call DATA_ASM_DEP,$(patsubst $(C_SUBDIR)/%.s,$(C_BUILDDIR)/%.o, $(src)),$(src)))) endif $(SONG_BUILDDIR)/%.o: $(SONG_SUBDIR)/%.s -- cgit v1.2.3 From 0767f4b9ce0ad9dd86e83f5a09674cbc6559df29 Mon Sep 17 00:00:00 2001 From: Michael Panzlaff Date: Sat, 17 Apr 2021 19:00:02 +0200 Subject: Makefile: resolve libgcc and libc in correct order When actually utilizing functions from libc, linking will fail because the functions used from libc have to be defined after libc. This is the case with libgcc, so we swap their order. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d97634399..c76c24a5d 100644 --- a/Makefile +++ b/Makefile @@ -82,7 +82,7 @@ endif LDFLAGS = -Map ../../$(MAP) -LIB := $(LIBPATH) -lgcc -lc -L../../libagbsyscall -lagbsyscall +LIB := $(LIBPATH) -lc -lgcc -L../../libagbsyscall -lagbsyscall SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c GFX := tools/gbagfx/gbagfx$(EXE) -- cgit v1.2.3 From 38d0cca903b4cc886bf0ed2a4d5714f20b14caef Mon Sep 17 00:00:00 2001 From: Michael Panzlaff Date: Sat, 17 Apr 2021 22:48:57 +0200 Subject: modern: link against libnosys Without libnosys undefined references will occur if libc functions are used. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c76c24a5d..33cde3a01 100644 --- a/Makefile +++ b/Makefile @@ -72,7 +72,7 @@ CC1 = $(shell $(CC) --print-prog-name=cc1) -quiet override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -g ROM := pokeemerald_modern.gba OBJ_DIR := build/modern -LIBPATH := -L "$(dir $(shell $(CC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(CC) -mthumb -print-file-name=libc.a))" +LIBPATH := -L "$(dir $(shell $(CC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(CC) -mthumb -print-file-name=libnosys.a))" -L "$(dir $(shell $(CC) -mthumb -print-file-name=libc.a))" endif CPPFLAGS := -iquote include -iquote $(GFLIB_SUBDIR) -Wno-trigraphs -DMODERN=$(MODERN) @@ -82,7 +82,7 @@ endif LDFLAGS = -Map ../../$(MAP) -LIB := $(LIBPATH) -lc -lgcc -L../../libagbsyscall -lagbsyscall +LIB := $(LIBPATH) -lc -lnosys -lgcc -L../../libagbsyscall -lagbsyscall SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c GFX := tools/gbagfx/gbagfx$(EXE) -- cgit v1.2.3 From 2859fa60cb6fd863f9c2bf5b9219ff2045a7d229 Mon Sep 17 00:00:00 2001 From: Michael Panzlaff Date: Sat, 17 Apr 2021 23:19:01 +0200 Subject: Makefile: use different linker library sets for modern --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 33cde3a01..3cbd7f3f8 100644 --- a/Makefile +++ b/Makefile @@ -67,12 +67,14 @@ override CFLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Werror -O2 -fhex- ROM := pokeemerald.gba OBJ_DIR := build/emerald LIBPATH := -L ../../tools/agbcc/lib +LIB := $(LIBPATH) -lgcc -lc -L../../libagbsyscall -lagbsyscall else CC1 = $(shell $(CC) --print-prog-name=cc1) -quiet override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -g ROM := pokeemerald_modern.gba OBJ_DIR := build/modern LIBPATH := -L "$(dir $(shell $(CC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(CC) -mthumb -print-file-name=libnosys.a))" -L "$(dir $(shell $(CC) -mthumb -print-file-name=libc.a))" +LIB := $(LIBPATH) -lc -lnosys -lgcc -L../../libagbsyscall -lagbsyscall endif CPPFLAGS := -iquote include -iquote $(GFLIB_SUBDIR) -Wno-trigraphs -DMODERN=$(MODERN) @@ -82,8 +84,6 @@ endif LDFLAGS = -Map ../../$(MAP) -LIB := $(LIBPATH) -lc -lnosys -lgcc -L../../libagbsyscall -lagbsyscall - SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c GFX := tools/gbagfx/gbagfx$(EXE) AIF := tools/aif2pcm/aif2pcm$(EXE) -- cgit v1.2.3 From c50a21fba07db80ac44c6f09fd202ba4b2e2c7d3 Mon Sep 17 00:00:00 2001 From: luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> Date: Wed, 5 May 2021 16:07:21 -0400 Subject: Tidy just cleans both normal and modern. --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3bb5161e3..20dca6f64 100644 --- a/Makefile +++ b/Makefile @@ -215,9 +215,7 @@ mostlyclean: tidynonmodern tidymodern @$(MAKE) clean -C berry_fix @$(MAKE) clean -C libagbsyscall -tidy: - rm -f $(ROM) $(ELF) $(MAP) - rm -r $(OBJ_DIR) +tidy: tidynonmodern tidymodern tidynonmodern: rm -f $(ROM_NAME) $(ELF_NAME) $(MAP_NAME) -- cgit v1.2.3