-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
119 lines (90 loc) · 2.74 KB
/
Makefile
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
EE_EXT = .elf
EE_BIN = app
EE_BIN_PKD = app_pkd
EE_SRC_DIR = src/
EE_OBJS_DIR = obj/
EE_ASM_DIR = embed/
RESET_IOP ?= 1
DEBUG ?= 0
EE_SIO ?= 0
CLI ?= 0
GRAPHICS ?= 1
AUDIO ?= 1
NETWORK ?= 1
KEYBOARD ?= 1
MOUSE ?= 1
CAMERA ?= 0
EE_LIBS = -L$(PS2SDK)/ports/lib -L$(PS2DEV)/gsKit/lib/ -lmc -lpad -laudsrv -lpatches -ldebug -lmath3d -ljpeg -lfreetype -lgskit_toolkit -lgskit -ldmakit -lpng -lz -lnetman -lps2ip -lcurl -lwolfssl -lkbd -lmouse -lvorbisfile -lvorbis -logg -llzma -lzip -lfileXio -lelf-loader-nocolour -lerl
EE_INCS += -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include -I$(PS2SDK)/ports/include/freetype2 -I$(PS2SDK)/ports/include/zlib
EE_CFLAGS += -Wno-sign-compare -fno-strict-aliasing -fno-exceptions -fpermissive -DCONFIG_VERSION=\"$(shell cat VERSION)\" -D__TM_GMTOFF=tm_gmtoff -DPATH_MAX=256 -DPS2
ifeq ($(RESET_IOP),1)
EE_CFLAGS += -DRESET_IOP
endif
ifeq ($(DEBUG),1)
EE_CFLAGS += -DDEBUG
endif
BIN2S = $(PS2SDK)/bin/bin2c
EE_DVP = dvp-as
EE_VCL = vcl
EE_VCLPP = vclpp
APP_CORE = main.o
IOP_MODULES = iomanx.o filexio.o sio2man.o mcman.o mcserv.o padman.o \
usbd.o bdm.o bdmfs_fatfs.o usbmass_bd.o cdfs.o \
ps2dev9.o mtapman.o poweroff.o ps2atad.o \
ps2hdd.o ps2fs.o
ifneq ($(EE_SIO), 0)
EE_BIN := $(EE_BIN)_eesio
EE_BIN_PKD := $(EE_BIN_PKD)_eesio
EE_CFLAGS += -D__EESIO_PRINTF
EE_LIBS += -lsiocookie
endif
EE_OBJS = $(APP_CORE) $(IOP_MODULES)
EE_OBJS := $(EE_OBJS:%=$(EE_OBJS_DIR)%)
EE_BIN := $(EE_BIN)$(EE_EXT)
EE_BIN_PKD := $(EE_BIN_PKD)$(EE_EXT)
#-------------------------- App Content ---------------------------#
all: $(EE_BIN) $(EE_ASM_DIR) $(EE_OBJS_DIR)
@echo "$$HEADER"
echo "Building $(EE_BIN)..."
$(EE_STRIP) $(EE_BIN)
rm -r build/
mkdir build/
mv $(EE_BIN) build/
debug: $(EE_BIN)
echo "Building $(EE_BIN) with debug symbols..."
mv $(EE_BIN) build/app_debug.elf
tests: all
mv build/$(EE_BIN) tests/test_suite.elf
clean:
echo Cleaning executables...
rm -f build/$(EE_BIN) build/$(EE_BIN_PKD)
rm -rf $(EE_OBJS_DIR)
rm -rf $(EE_ASM_DIR)
rebuild: clean all
include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal
include embed.make
$(EE_ASM_DIR):
@mkdir -p $@
$(EE_OBJS_DIR):
@mkdir -p $@
$(EE_OBJS_DIR)%.o: $(EE_SRC_DIR)%.c | $(EE_OBJS_DIR)
@echo CC - $<
$(DIR_GUARD)
$(EE_CC) $(EE_CFLAGS) $(EE_INCS) -c $< -o $@
$(EE_OBJS_DIR)%.o: $(EE_SRC_DIR)%.vsm | $(EE_OBJS_DIR)
@echo DVP - $<
$(DIR_GUARD)
$(EE_DVP) $< -o $@
$(EE_SRC_DIR)%.vcl: $(EE_SRC_DIR)%.vclpp | $(EE_SRC_DIR)
@echo VCLPP - $<
$(DIR_GUARD)
$(EE_VCLPP) $< $@.vcl
$(EE_SRC_DIR)%.vsm: $(EE_SRC_DIR)%.vcl | $(EE_SRC_DIR)
@echo VCL - $<
$(DIR_GUARD)
$(EE_VCL) -Isrc -g -o$@ $<
$(EE_OBJS_DIR)%.o: $(EE_ASM_DIR)%.c | $(EE_OBJS_DIR)
@echo BIN2C - $<
$(DIR_GUARD)
$(EE_CC) $(EE_CFLAGS) $(EE_INCS) -c $< -o $@