37 lines
751 B
Makefile
37 lines
751 B
Makefile
# common EE toolchain stuff
|
|
|
|
# EE toolchain root.
|
|
EE_TRIPLET=mips64r5900el-ps2-elf
|
|
|
|
CC=$(EE_TRIPLET)-gcc
|
|
AS=$(CC) -mabi=32 -march=r3000 #HACK
|
|
CXX=$(EE_TRIPLET)-g++
|
|
#LD=$(CC)
|
|
LD=mipsel-ps2-irx-gcc # HACK
|
|
AR=$(EE_TRIPLET)-ar
|
|
OBJCOPY=$(EE_TRIPLET)-objcopy
|
|
|
|
ifeq ($(CONFIG),release)
|
|
CFLAGS := $(CFLAGS) -G0 -O3 -Wall -Wextra -Werror -fno-common -fno-strict-aliasing
|
|
ASFLAGS := -xassembler-with-cpp
|
|
endif
|
|
|
|
ifeq ($(CONFIG),debug)
|
|
CFLAGS := $(CFLAGS) -G0 -O0 -g3 -Wall -Wextra -fno-common -fno-strict-aliasing
|
|
ASFLAGS := -xassembler-with-cpp -g3
|
|
endif
|
|
|
|
CXXFLAGS := $(CXXFLAGS) $(CFLAGS)
|
|
|
|
# compile rules
|
|
$(OBJDIR)/%.o: %.c
|
|
$(CC) -c $(CFLAGS) $< -o $@
|
|
|
|
$(OBJDIR)/%.o: %.cpp
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
$(OBJDIR)/%.o: %.s
|
|
$(AS) -c $(ASFLAGS) $< -o $@
|
|
|
|
|