2015-01-18 18:35:23 +00:00
|
|
|
CC=ee-gcc
|
|
|
|
CXX=ee-g++
|
|
|
|
AS=ee-g++
|
2015-01-26 19:23:45 +00:00
|
|
|
LD=ee-g++
|
2015-01-18 18:35:23 +00:00
|
|
|
DVPAS=ee-dvp-as
|
|
|
|
|
2015-01-26 09:15:26 +00:00
|
|
|
LINK=-T$(PS2SDK)/ee/startup/linkfile
|
2015-01-18 18:35:23 +00:00
|
|
|
LIBPATH=-L$(PS2SDK)/ee/lib
|
2015-01-26 19:23:45 +00:00
|
|
|
INCPATH=-I$(PS2SDK)/ee/include -I$(PS2SDK)/common/include -I../..
|
|
|
|
LIBS=../../librw-ps2.a -lc -lc -lkernel -lmf # g++ throws one -lc away, why? (unless -nostdlib)
|
2015-01-18 18:35:23 +00:00
|
|
|
|
|
|
|
CFLAGS = -c -Wall -nostdlib -fno-common -DPS2_EE $(INCPATH)
|
|
|
|
ASFLAGS = -c -xassembler-with-cpp
|
|
|
|
LDFLAGS = -mno-crt0 $(LIBPATH)
|
|
|
|
OUT=test
|
|
|
|
|
2015-01-28 20:15:49 +00:00
|
|
|
C_SRC=main.cpp gs.cpp dma.cpp math.cpp
|
2015-01-18 18:35:23 +00:00
|
|
|
#S_SRC=crt0.s low.s
|
|
|
|
HEADER=dma.h ee_regs.h gif.h gs.h mips_regs.h ps2.h math.h mesh.h
|
|
|
|
OBJ=$(C_SRC:.cpp=.o) $(S_SRC:.s=.o) vu.o defaultpipe.o skinpipe.o
|
|
|
|
|
|
|
|
$(OUT).elf: $(OBJ) $(HEADER)
|
2015-01-26 09:15:26 +00:00
|
|
|
$(LD) $(LDFLAGS) $(LINK) $(PS2SDK)/ee/startup/crt0.o \
|
|
|
|
$(OBJ) $(LIBS) -o $(OUT).elf
|
2015-01-18 18:35:23 +00:00
|
|
|
|
|
|
|
.cpp.o: $(HEADER)
|
|
|
|
$(CXX) $(CFLAGS) $< -o $@
|
|
|
|
|
|
|
|
.s.o: $(HEADER)
|
|
|
|
$(AS) $(ASFLAGS) $< -o $@
|
|
|
|
|
|
|
|
%.o: %.dsm
|
|
|
|
$(DVPAS) $< -o $@
|
|
|
|
|
|
|
|
$(C_SRC) $(S_SRC): $(HEADER)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJ)
|
|
|
|
|