summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <PikalaxALT@users.noreply.github.com>2019-08-06 20:16:36 -0400
committerGitHub <noreply@github.com>2019-08-06 20:16:36 -0400
commitca8048c300f7df74e46ade85b1a7f3adbf34522a (patch)
treea76d164bd08fb82a9001e08ecc4d2c18890102c1
parent2a0517f0fdfe0ce8f2395f6572bf43190ecbe611 (diff)
parente28cf5406b25707338458a3f49125b38750c8627 (diff)
Merge pull request #771 from aaaaaa123456789/master
Fix Makefiles to account for the $CC and $CXX environment variables
-rw-r--r--Makefile15
-rw-r--r--tools/aif2pcm/Makefile2
-rw-r--r--tools/bin2c/Makefile2
-rw-r--r--tools/gbafix/Makefile2
-rw-r--r--tools/gbagfx/Makefile2
-rwxr-xr-xtools/jsonproc/Makefile2
-rw-r--r--tools/mapjson/Makefile2
-rw-r--r--tools/mid2agb/Makefile2
-rw-r--r--tools/preproc/Makefile2
-rw-r--r--tools/ramscrgen/Makefile2
-rw-r--r--tools/rsfont/Makefile2
-rw-r--r--tools/scaninc/Makefile2
12 files changed, 25 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 65a4aa7bd..5a8af32a9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,17 @@
TOOLCHAIN := $(DEVKITARM)
+
+ifeq ($(CC),)
+HOSTCC := gcc
+else
+HOSTCC := $(CC)
+endif
+
+ifeq ($(CXX),)
+HOSTCXX := g++
+else
+HOSTCXX := $(CXX)
+endif
+
ifneq (,$(wildcard $(TOOLCHAIN)/base_tools))
include $(TOOLCHAIN)/base_tools
else
@@ -136,7 +149,7 @@ all: rom
tools: $(TOOLDIRS)
$(TOOLDIRS):
- @$(MAKE) -C $@
+ @$(MAKE) -C $@ CC=$(HOSTCC) CXX=$(HOSTCXX)
rom: $(ROM)
diff --git a/tools/aif2pcm/Makefile b/tools/aif2pcm/Makefile
index af7d19fe9..77df29152 100644
--- a/tools/aif2pcm/Makefile
+++ b/tools/aif2pcm/Makefile
@@ -1,4 +1,4 @@
-CC = gcc
+CC ?= gcc
CFLAGS = -Wall -Wextra -Wno-switch -Werror -std=c11 -O2
diff --git a/tools/bin2c/Makefile b/tools/bin2c/Makefile
index ab11e1b61..52806e39c 100644
--- a/tools/bin2c/Makefile
+++ b/tools/bin2c/Makefile
@@ -1,4 +1,4 @@
-CC = gcc
+CC ?= gcc
CFLAGS = -Wall -Wextra -Werror -std=c11 -O2
diff --git a/tools/gbafix/Makefile b/tools/gbafix/Makefile
index 5b410da08..91a60a9e4 100644
--- a/tools/gbafix/Makefile
+++ b/tools/gbafix/Makefile
@@ -1,4 +1,4 @@
-CC = gcc
+CC ?= gcc
.PHONY: all clean
SRCS = gbafix.c
diff --git a/tools/gbagfx/Makefile b/tools/gbagfx/Makefile
index 339585b92..d9c219587 100644
--- a/tools/gbagfx/Makefile
+++ b/tools/gbagfx/Makefile
@@ -1,4 +1,4 @@
-CC = gcc
+CC ?= gcc
CFLAGS = -Wall -Wextra -Werror -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK
diff --git a/tools/jsonproc/Makefile b/tools/jsonproc/Makefile
index 721da1025..47198b171 100755
--- a/tools/jsonproc/Makefile
+++ b/tools/jsonproc/Makefile
@@ -1,4 +1,4 @@
-CXX := g++
+CXX ?= g++
CXXFLAGS := -Wall -std=c++11 -O2
diff --git a/tools/mapjson/Makefile b/tools/mapjson/Makefile
index 9a49be506..c1f703f9f 100644
--- a/tools/mapjson/Makefile
+++ b/tools/mapjson/Makefile
@@ -1,4 +1,4 @@
-CXX := g++
+CXX ?= g++
CXXFLAGS := -Wall -std=c++11 -O2
diff --git a/tools/mid2agb/Makefile b/tools/mid2agb/Makefile
index 77f96db5a..451d4b39f 100644
--- a/tools/mid2agb/Makefile
+++ b/tools/mid2agb/Makefile
@@ -1,4 +1,4 @@
-CXX := g++
+CXX ?= g++
CXXFLAGS := -std=c++11 -O2 -Wall -Wno-switch -Werror
diff --git a/tools/preproc/Makefile b/tools/preproc/Makefile
index 63dedda1f..8c48afea2 100644
--- a/tools/preproc/Makefile
+++ b/tools/preproc/Makefile
@@ -1,4 +1,4 @@
-CXX := g++
+CXX ?= g++
CXXFLAGS := -std=c++11 -O2 -Wall -Wno-switch -Werror
diff --git a/tools/ramscrgen/Makefile b/tools/ramscrgen/Makefile
index 858db1a77..4e901a29c 100644
--- a/tools/ramscrgen/Makefile
+++ b/tools/ramscrgen/Makefile
@@ -1,4 +1,4 @@
-CXX := g++
+CXX ?= g++
CXXFLAGS := -std=c++11 -O2 -Wall -Wno-switch -Werror
diff --git a/tools/rsfont/Makefile b/tools/rsfont/Makefile
index abe1cab51..930a92b36 100644
--- a/tools/rsfont/Makefile
+++ b/tools/rsfont/Makefile
@@ -1,4 +1,4 @@
-CC = gcc
+CC ?= gcc
CFLAGS = -Wall -Wextra -Werror -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK
diff --git a/tools/scaninc/Makefile b/tools/scaninc/Makefile
index 1516f159c..52e663d8d 100644
--- a/tools/scaninc/Makefile
+++ b/tools/scaninc/Makefile
@@ -1,4 +1,4 @@
-CXX = g++
+CXX ?= g++
CXXFLAGS = -Wall -Werror -std=c++11 -O2