2016-08-14 18:04:41 +00:00
|
|
|
arch = 3ds
|
2016-08-05 13:15:47 +00:00
|
|
|
subvar = 9
|
2016-08-01 16:04:09 +00:00
|
|
|
MODE = debug
|
|
|
|
export PATH := $(HOME)/opt/bin:$(PATH)
|
2016-08-10 13:43:54 +00:00
|
|
|
LDFLAGS = -fPIC
|
2016-08-01 16:04:09 +00:00
|
|
|
ifeq ($(arch),x86)
|
|
|
|
PREFIX = i686-mtgos-
|
|
|
|
libpath = i686-mtgos
|
|
|
|
ARCHFLAGS = -m32
|
|
|
|
else
|
|
|
|
ifeq ($(arch),x86_64)
|
2016-08-14 16:13:51 +00:00
|
|
|
PREFIX = x86_64-elf-
|
|
|
|
libpath = x86_64-elf
|
2016-08-03 20:02:04 +00:00
|
|
|
ARCHFLAGS = -m64 -mno-red-zone
|
|
|
|
LDFLAGS += -z max-page-size=0x1000
|
2016-08-01 16:04:09 +00:00
|
|
|
else
|
|
|
|
ifeq ($(arch),3ds)
|
|
|
|
PREFIX = arm-none-eabi-
|
|
|
|
libpath = arm-none-eabi
|
2016-08-05 13:15:47 +00:00
|
|
|
ifeq ($(subvar),9)
|
2016-08-09 14:18:58 +00:00
|
|
|
ARCHFLAGS = -mcpu=arm946e-s -march=armv5te -mlittle-endian -DARM9
|
|
|
|
MOD_SUFF=neun
|
2016-08-05 13:15:47 +00:00
|
|
|
else
|
2016-08-09 14:18:58 +00:00
|
|
|
ARCHFLAGS = -mcpu=mpcore -mlittle-endian -DARM11
|
|
|
|
MOD_SUFF=elf
|
2016-08-05 13:15:47 +00:00
|
|
|
endif
|
2016-08-01 16:04:09 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(MODE),debug)
|
|
|
|
CFLAGS := -g3 -DDEBUG
|
2016-08-05 13:15:47 +00:00
|
|
|
ASFLAGS := -g3 -DDEBUG
|
2016-08-01 16:04:09 +00:00
|
|
|
CPPFLAGS := -g3 -DDEBUG
|
|
|
|
else
|
|
|
|
CFLAGS := -O2
|
|
|
|
CPPFLAGS := -O2
|
|
|
|
endif
|
2016-08-05 13:15:47 +00:00
|
|
|
ASFLAGS += $(ARCHFLAGS)
|
2016-08-10 13:43:54 +00:00
|
|
|
CFLAGS += -fPIC $(ARCHFLAGS)
|
|
|
|
CPPFLAGS += -fPIC $(ARCHFLAGS)
|