librw/tools/ps2/Makefile

40 lines
934 B
Makefile
Raw Normal View History

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
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
2015-06-18 22:05:37 +01:00
CFLAGS = -c -Wall -nostdlib -fno-common -DRW_PS2 -DPS2_EE $(INCPATH)
2015-01-18 18:35:23 +00:00
ASFLAGS = -c -xassembler-with-cpp
LDFLAGS = -mno-crt0 $(LIBPATH)
OUT=test
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
2015-06-18 22:05:37 +01:00
$(OUT).elf: $(OBJ) ../../librw-ps2.a $(HEADER)
$(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)