-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.prefab
66 lines (44 loc) · 1.75 KB
/
Makefile.prefab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.SUFFIXES: # Delete the default suffixes
.SUFFIXES: .c .o .s .elf
include $(LIBITO)/Makefile.global
# Include directories
EE_INCS += -I$(LIBITO)/include -I$(LIBITO)/samples/common -I$(PS2SDK)/ee/include -I$(PS2SDK)/common/include
# C compiler flags
EE_CFLAGS += -D_EE -O2 -c -Wall -fno-builtin -ffreestanding -fsingle-precision-constant -ansi -pedantic -Wno-long-long $(EE_INCS)
# C++ Compiler flats
EE_CXXFLAGS += -D_EE -O2 -c -Wall -fno-rtti -fno-builtin -ffreestanding -fno-exceptions -fsingle-precision-constant -ansi -pedantic -Wno-long-long $(EE_INCS) $(USER_EE_CFLAGS)
# Linker flags
EE_LDFLAGS += -mno-crt0 -T$(PS2SDK)/ee/startup/linkfile
# Assembler flags
EE_ASFLAGS += -mips3 -EL
# Link with libs
EE_LIBS += -L$(LIBITO)/lib -L$(PS2SDK)/ee/lib -lgcc -lito -lc -lkernel -lsyscall -lc -lgcc -lpad -lkernel
# EE_BIN_PACKED = packed_$(EE_BIN)
# packed: $(EE_BIN_PACKED)
# PS2_IP = 192.168.0.10
run: $(EE_BIN)
ps2client -h $(PS2_IP) reset
ps2client -h $(PS2_IP) execee host:$(EE_BIN)
# run-packed: $(EE_BIN_PACKED)
# ps2client -h $(PS2_IP) reset
# ps2client -h $(PS2_IP) -t 3 execee host:packed_$(EE_BIN)
clean:
rm -f -r $(EE_BIN) $(EE_BIN_PACKED) $(CLEAN_FILES) $(EE_OBJS) $(EE_OBJS_DIR)
$(EE_OBJS_DIR)%.o : %.c
$(EE_CC) $(EE_CFLAGS) $< -o $@
$(EE_OBJS_DIR)%.o : %.cpp
$(EE_CPP) $(EE_CXXFLAGS) $< -o $@
$(EE_OBJS_DIR)%.o : %.s
$(EE_AS) $(EE_ASFLAGS) $< -o $@
$(EE_OBJS_DIR)%.o : %.S
$(EE_CC) $(EE_CFLAGS) $< -o $@
$(EE_LIB_DIR):
mkdir $(EE_LIB_DIR)
$(EE_OBJS_DIR):
mkdir $(EE_OBJS_DIR)
$(EE_LIB): $(EE_OBJS)
$(EE_AR) rcs $(EE_LIB) $(EE_OBJS)
# $(EE_BIN_PACKED) : $(EE_BIN)
# $(PS2PACKER) $(EE_BIN) $(EE_BIN_PACKED)
$(EE_BIN) : $(EE_OBJS) $(PS2SDK)/ee/startup/crt0.o
$(EE_CPP) $(EE_LDFLAGS) -o $(EE_BIN) $(EE_OBJS) $(PS2SDK)/ee/startup/crt0.o $(EE_LIBS)