36 lines
726 B
Makefile
36 lines
726 B
Makefile
|
# common IOP toolchain stuff
|
||
|
|
||
|
# EE toolchain root.
|
||
|
IOP_TRIPLET=mipsel-ps2-irx
|
||
|
|
||
|
CC=$(IOP_TRIPLET)-gcc
|
||
|
AS=$(CC)
|
||
|
CXX=$(IOP_TRIPLET)-g++
|
||
|
LD=$(CC)
|
||
|
AR=$(IOP_TRIPLET)-ar
|
||
|
OBJCOPY=$(IOP_TRIPLET)-objcopy
|
||
|
|
||
|
ifeq ($(CONFIG),release)
|
||
|
CFLAGS := $(CFLAGS) -msoft-float -G0 -O3 -Wall -Wextra -Werror -fno-common -fno-strict-aliasing
|
||
|
ASFLAGS := -EL -xassembler-with-cpp
|
||
|
endif
|
||
|
|
||
|
ifeq ($(CONFIG),debug)
|
||
|
CFLAGS := $(CFLAGS) -msoft-float -G0 -O0 -g3 -Wall -Wextra -fno-common -fno-strict-aliasing
|
||
|
ASFLAGS := -EL -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 $@
|
||
|
|
||
|
|