Fix Makefiles to account for the $CC and $CXX environment variables

This commit is contained in:
aaaaaa123456789 2019-08-06 20:30:57 -03:00
parent 2a0517f0fd
commit e28cf5406b
12 changed files with 25 additions and 12 deletions

View File

@ -1,4 +1,17 @@
TOOLCHAIN := $(DEVKITARM) TOOLCHAIN := $(DEVKITARM)
ifeq ($(CC),)
HOSTCC := gcc
else
HOSTCC := $(CC)
endif
ifeq ($(CXX),)
HOSTCXX := g++
else
HOSTCXX := $(CXX)
endif
ifneq (,$(wildcard $(TOOLCHAIN)/base_tools)) ifneq (,$(wildcard $(TOOLCHAIN)/base_tools))
include $(TOOLCHAIN)/base_tools include $(TOOLCHAIN)/base_tools
else else
@ -136,7 +149,7 @@ all: rom
tools: $(TOOLDIRS) tools: $(TOOLDIRS)
$(TOOLDIRS): $(TOOLDIRS):
@$(MAKE) -C $@ @$(MAKE) -C $@ CC=$(HOSTCC) CXX=$(HOSTCXX)
rom: $(ROM) rom: $(ROM)

View File

@ -1,4 +1,4 @@
CC = gcc CC ?= gcc
CFLAGS = -Wall -Wextra -Wno-switch -Werror -std=c11 -O2 CFLAGS = -Wall -Wextra -Wno-switch -Werror -std=c11 -O2

View File

@ -1,4 +1,4 @@
CC = gcc CC ?= gcc
CFLAGS = -Wall -Wextra -Werror -std=c11 -O2 CFLAGS = -Wall -Wextra -Werror -std=c11 -O2

View File

@ -1,4 +1,4 @@
CC = gcc CC ?= gcc
.PHONY: all clean .PHONY: all clean
SRCS = gbafix.c SRCS = gbafix.c

View File

@ -1,4 +1,4 @@
CC = gcc CC ?= gcc
CFLAGS = -Wall -Wextra -Werror -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK CFLAGS = -Wall -Wextra -Werror -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK

View File

@ -1,4 +1,4 @@
CXX := g++ CXX ?= g++
CXXFLAGS := -Wall -std=c++11 -O2 CXXFLAGS := -Wall -std=c++11 -O2

View File

@ -1,4 +1,4 @@
CXX := g++ CXX ?= g++
CXXFLAGS := -Wall -std=c++11 -O2 CXXFLAGS := -Wall -std=c++11 -O2

View File

@ -1,4 +1,4 @@
CXX := g++ CXX ?= g++
CXXFLAGS := -std=c++11 -O2 -Wall -Wno-switch -Werror CXXFLAGS := -std=c++11 -O2 -Wall -Wno-switch -Werror

View File

@ -1,4 +1,4 @@
CXX := g++ CXX ?= g++
CXXFLAGS := -std=c++11 -O2 -Wall -Wno-switch -Werror CXXFLAGS := -std=c++11 -O2 -Wall -Wno-switch -Werror

View File

@ -1,4 +1,4 @@
CXX := g++ CXX ?= g++
CXXFLAGS := -std=c++11 -O2 -Wall -Wno-switch -Werror CXXFLAGS := -std=c++11 -O2 -Wall -Wno-switch -Werror

View File

@ -1,4 +1,4 @@
CC = gcc CC ?= gcc
CFLAGS = -Wall -Wextra -Werror -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK CFLAGS = -Wall -Wextra -Werror -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK

View File

@ -1,4 +1,4 @@
CXX = g++ CXX ?= g++
CXXFLAGS = -Wall -Werror -std=c++11 -O2 CXXFLAGS = -Wall -Werror -std=c++11 -O2