From 48c250b676e6da7e6ac18a560f93f87bea4f002b Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Sun, 8 Jan 2023 09:47:04 -0800 Subject: [PATCH] Makefile: make it more like pokeemerald --- Makefile | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 4fd4d2d27..2fc71dbca 100755 --- a/Makefile +++ b/Makefile @@ -12,17 +12,27 @@ else HOSTCXX := $(CXX) endif -ifneq (,$(wildcard $(TOOLCHAIN)/base_tools)) -include $(TOOLCHAIN)/base_tools -else +# don't use dkP's base_tools anymore +# because the redefinition of $(CC) conflicts +# with when we want to use $(CC) to preprocess files +# thus, manually create the variables for the bin +# files, or use arm-none-eabi binaries on the system +# if dkP is not installed on this system + +ifneq (,$(TOOLCHAIN)) +ifneq ($(wildcard $(TOOLCHAIN)/bin),) export PATH := $(TOOLCHAIN)/bin:$(PATH) -PREFIX := arm-none-eabi- -OBJCOPY := $(PREFIX)objcopy -export CC := $(PREFIX)gcc -export AS := $(PREFIX)as endif -export CPP := $(CC) -E -export LD := $(PREFIX)ld +endif + +PREFIX := arm-none-eabi- +OBJCOPY := $(PREFIX)objcopy +OBJDUMP := $(PREFIX)objdump +AS := $(PREFIX)as +CC := $(PREFIX)gcc +AS := $(PREFIX)as +LD := $(PREFIX)ld +CPP := $(CC) -E ifeq ($(OS),Windows_NT) EXE := .exe