summaryrefslogtreecommitdiff
path: root/libagbsyscall/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'libagbsyscall/Makefile')
-rw-r--r--libagbsyscall/Makefile33
1 files changed, 18 insertions, 15 deletions
diff --git a/libagbsyscall/Makefile b/libagbsyscall/Makefile
index e1f502b2f..911cdb237 100644
--- a/libagbsyscall/Makefile
+++ b/libagbsyscall/Makefile
@@ -1,26 +1,29 @@
TOOLCHAIN := $(DEVKITARM)
COMPARE ?= 0
-# 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 tihs system
+ifeq ($(CC),)
+HOSTCC := gcc
+else
+HOSTCC := $(CC)
+endif
-ifneq ($(wildcard $(TOOLCHAIN)/bin),)
-export PATH := $(TOOLCHAIN)/bin:$(PATH)
+ifeq ($(CXX),)
+HOSTCXX := g++
+else
+HOSTCXX := $(CXX)
endif
+ifneq (,$(wildcard $(TOOLCHAIN)/base_tools))
+include $(TOOLCHAIN)/base_tools
+else
+export PATH := $(TOOLCHAIN)/bin:$(PATH)
PREFIX := arm-none-eabi-
OBJCOPY := $(PREFIX)objcopy
-AS := $(PREFIX)as
-CPP := $(CC) -E
-LD := $(PREFIX)ld
-
-# note: the makefile must be set up so MODERNCC is never called
-# if MODERN=0
-MODERNCC := $(PREFIX)gcc
+export CC := $(PREFIX)gcc
+export AS := $(PREFIX)as
+endif
+export CPP := $(PREFIX)cpp
+export LD := $(PREFIX)ld
ifeq ($(OS),Windows_NT)
EXE := .exe