Disabling auto-refresh of game list by default, as it is causing bugs sometimes
[open-ps2-loader.git] / Makefile
blob6d4ea20afc5c2e558f427907424a6b4bd4680de7
1 .SILENT:
3 DEBUG = 0
4 EESIO_DEBUG = 0
5 #comment following line to build without vmc
6 VMC = 1
7 CHILDPROOF = 0
8 RTL = 0
10 FT_DIR = thirdparty/freetype-2.3.12
11 FT_LIBDIR = $(FT_DIR)/objs
13 FRONTEND_OBJS = obj/pad.o obj/fntsys.o obj/renderman.o obj/menusys.o obj/system.o obj/debug.o obj/lang.o obj/config.o obj/hdd.o obj/dialogs.o \
14 obj/dia.o obj/ioman.o obj/texcache.o obj/themes.o obj/supportbase.o obj/usbsupport.o obj/ethsupport.o obj/hddsupport.o \
15 obj/appsupport.o obj/gui.o obj/textures.o obj/opl.o obj/atlas.o
17 GFX_OBJS = obj/usb_icon.o obj/hdd_icon.o obj/eth_icon.o obj/app_icon.o \
18 obj/cross_icon.o obj/triangle_icon.o obj/circle_icon.o obj/square_icon.o obj/select_icon.o obj/start_icon.o \
19 obj/left_icon.o obj/right_icon.o obj/up_icon.o obj/down_icon.o obj/L1_icon.o obj/L2_icon.o obj/R1_icon.o obj/R2_icon.o \
20 obj/load0.o obj/load1.o obj/load2.o obj/load3.o obj/load4.o obj/load5.o obj/load6.o obj/load7.o obj/logo.o obj/freesans.o \
21 obj/icon_sys.o obj/icon_icn.o
23 EECORE_OBJS = obj/ee_core.o \
24 obj/alt_ee_core.o obj/elfldr.o obj/kpatch_10K.o obj/imgdrv.o obj/eesync.o \
25 obj/usb_cdvdman.o obj/usb_4Ksectors_cdvdman.o obj/smb_cdvdman.o obj/smb_pcmcia_cdvdman.o \
26 obj/hdd_cdvdman.o obj/hdd_pcmcia_cdvdman.o obj/hdd_hdpro_cdvdman.o \
27 obj/cdvdfsv.o obj/usbd_ps2.o obj/usbd_ps3.o obj/usbhdfsd.o obj/cddev.o \
28 obj/ps2dev9.o obj/smsutils.o obj/smstcpip.o obj/ingame_smstcpip.o obj/smsmap.o obj/smbman.o obj/discid.o \
29 obj/ps2atad.o obj/hdpro_atad.o obj/poweroff.o obj/ps2hdd.o obj/genvmc.o obj/hdldsvr.o \
30 obj/udptty.o obj/iomanx.o obj/filexio.o obj/ps2fs.o obj/util.o obj/ioptrap.o obj/ps2link.o
32 ifeq ($(VMC),1)
33 EECORE_OBJS += obj/usb_mcemu.o obj/hdd_mcemu.o obj/smb_mcemu.o
34 endif
36 EE_BIN = opl.elf
37 EE_SRC_DIR = src/
38 EE_OBJS_DIR = obj/
39 EE_ASM_DIR = asm/
40 EE_OBJS = $(FRONTEND_OBJS) $(GFX_OBJS) $(EECORE_OBJS)
42 EE_LIBS = -L$(FT_LIBDIR) -L$(PS2SDK)/ports/lib -L$(GSKIT)/lib -lgskit -ldmakit -lgskit_toolkit -lpoweroff -lfileXio -lpatches -lpad -ljpeg -lpng -lz -ldebug -lm -lmc -lfreetype -lvux -lcdvd
43 #EE_LIBS = -L$(FT_LIBDIR) -L$(PS2SDK)/ports/lib -L$(GSKIT)/lib -lgskit -ldmakit -lgskit_toolkit -ldebug -lpoweroff -lfileXio -lpatches -lpad -lm -lmc -lfreetype
44 EE_INCS += -I$(PS2SDK)/ports/include -I$(GSKIT)/include -I$(GSKIT)/ee/dma/include -I$(GSKIT)/ee/gs/include -I$(GSKIT)/ee/toolkit/include -I$(FT_DIR)/include
46 ifeq ($(DEBUG),1)
47 EE_CFLAGS := -D__DEBUG -g
48 ifeq ($(EESIO_DEBUG),1)
49 EE_CFLAGS += -D__EESIO_DEBUG
50 endif
51 else
52 EE_CFLAGS := -O2
53 endif
55 ifeq ($(RTL),1)
56 EE_CFLAGS += -D__RTL
57 endif
59 ifeq ($(CHILDPROOF),1)
60 EE_CFLAGS += -D__CHILDPROOF
61 endif
63 ifeq ($(VMC),1)
64 EE_CFLAGS += -DVMC
65 VMC_FLAGS = VMC=1
66 else
67 VMC_FLAGS = VMC=0
68 endif
70 SMSTCPIP_INGAME_CFLAGS = INGAME_DRIVER=1
71 ifeq ($(DEBUG),1)
72 MOD_DEBUG_FLAGS = DEBUG=1
73 endif
74 ifeq ($(EESIO_DEBUG),1)
75 EECORE_DEBUG_FLAGS = EESIO_DEBUG=1
76 endif
77 ifeq ($(INGAME_DEBUG),1)
78 EECORE_DEBUG_FLAGS = LOAD_DEBUG_MODULES=1
79 CDVDMAN_DEBUG_FLAGS = USE_DEV9=1
80 SMSTCPIP_INGAME_CFLAGS =
81 else
82 ifeq ($(IOPCORE_DEBUG),1)
83 EECORE_DEBUG_FLAGS = LOAD_DEBUG_MODULES=1
84 CDVDMAN_DEBUG_FLAGS = IOPCORE_DEBUG=1
85 MCEMU_DEBUG_FLAGS = IOPCORE_DEBUG=1
86 SMSTCPIP_INGAME_CFLAGS =
87 endif
88 endif
91 all:
92 @mkdir -p obj
93 @mkdir -p asm
95 echo "Building Freetype..."
96 $(MAKE) -C $(FT_DIR) setup ps2 > /dev/null
97 $(MAKE) -C $(FT_DIR)
99 echo "Building Open PS2 Loader..."
100 echo " * Interface"
101 $(MAKE) $(EE_BIN)
103 ifeq ($(DEBUG),0)
104 echo "Stripping..."
105 ee-strip opl.elf
107 echo "Compressing..."
108 ps2-packer opl.elf OPNPS2LD.ELF > /dev/null
109 endif
111 childproof:
112 $(MAKE) CHILDPROOF=1 all
114 debug:
115 $(MAKE) DEBUG=1 all
117 ingame_debug:
118 $(MAKE) INGAME_DEBUG=1 DEBUG=1 all
120 eesio_debug:
121 $(MAKE) EESIO_DEBUG=1 DEBUG=1 all
123 iopcore_debug:
124 $(MAKE) IOPCORE_DEBUG=1 DEBUG=1 all
126 clean: sclean
127 echo " * Freetype..."
128 $(MAKE) -C $(FT_DIR) distclean
130 sclean:
131 echo "Cleaning..."
132 echo " * Interface"
133 rm -f $(EE_BIN) OPNPS2LD.ELF asm/*.* obj/*.*
134 echo " * EE core"
135 $(MAKE) -C ee_core clean
136 $(MAKE) -C ee_core -f Makefile.alt clean
137 echo " * Elf Loader"
138 $(MAKE) -C elfldr clean
139 echo " * 10K kernel patches"
140 $(MAKE) -C kpatch_10K clean
141 echo " * imgdrv.irx"
142 $(MAKE) -C modules/iopcore/imgdrv clean
143 echo " * eesync.irx"
144 $(MAKE) -C modules/iopcore/eesync clean
145 echo " * cdvdman.irx"
146 $(MAKE) -C modules/iopcore/cdvdman -f Makefile.usb clean
147 $(MAKE) -C modules/iopcore/cdvdman -f Makefile.usb.4Ksectors clean
148 $(MAKE) -C modules/iopcore/cdvdman -f Makefile.smb clean
149 $(MAKE) -C modules/iopcore/cdvdman -f Makefile.smb.pcmcia clean
150 $(MAKE) -C modules/iopcore/cdvdman -f Makefile.hdd clean
151 $(MAKE) -C modules/iopcore/cdvdman -f Makefile.hdd.pcmcia clean
152 $(MAKE) -C modules/iopcore/cdvdman -f Makefile.hdd.hdpro clean
153 echo " * cdvdfsv.irx"
154 $(MAKE) -C modules/iopcore/cdvdfsv clean
155 echo " * cddev.irx"
156 $(MAKE) -C modules/iopcore/cddev clean
157 echo " * usbhdfsd.irx"
158 $(MAKE) -C modules/usb/usbhdfsd clean
159 echo " * ps2dev9.irx"
160 $(MAKE) -C modules/dev9 clean
161 echo " * SMSUTILS.irx"
162 $(MAKE) -C modules/network/SMSUTILS clean
163 echo " * SMSTCPIP.irx"
164 $(MAKE) -C modules/network/SMSTCPIP clean
165 echo " * SMSMAP.irx"
166 $(MAKE) -C modules/network/SMSMAP clean
167 echo " * discID.irx"
168 $(MAKE) -C modules/cdvd/discID clean
169 echo " * ps2atad.irx"
170 $(MAKE) -C modules/hdd/atad clean
171 echo " * hdpro_atad.irx"
172 $(MAKE) -C modules/hdd/hdpro_atad clean
173 echo " * ps2hdd.irx"
174 $(MAKE) -C modules/hdd/ps2hdd clean
175 ifeq ($(VMC),1)
176 echo " * ps2fs.irx"
177 $(MAKE) -C modules/ps2fs clean
178 echo " * mcemu.irx"
179 $(MAKE) -C modules/mcemu -f Makefile.usb clean
180 $(MAKE) -C modules/mcemu -f Makefile.hdd clean
181 $(MAKE) -C modules/mcemu -f Makefile.smb clean
182 endif
183 echo " * genvmc.irx"
184 $(MAKE) -C modules/vmc/genvmc clean
185 echo " * hdldsvr.irx"
186 $(MAKE) -C modules/hdd/hdldsvr clean
187 echo " * udptty.irx"
188 $(MAKE) -C modules/debug/udptty clean
189 echo " * ioptrap.irx"
190 $(MAKE) -C modules/debug/ioptrap clean
191 echo " * ps2link.irx"
192 $(MAKE) -C modules/debug/ps2link clean
193 echo " * pc tools"
194 $(MAKE) -C pc clean
196 rebuild: clean all
198 pc_tools:
199 echo "Building iso2opl, opl2iso and genvmc..."
200 $(MAKE) _WIN32=0 -C pc
202 pc_tools_win32:
203 echo "Building WIN32 iso2opl, opl2iso and genvmc..."
204 $(MAKE) _WIN32=1 -C pc
206 ee_core.s:
207 echo " * EE core"
208 $(MAKE) -C ee_core clean
209 $(MAKE) $(VMC_FLAGS) $(EECORE_DEBUG_FLAGS) -C ee_core
210 bin2s ee_core/ee_core.elf asm/ee_core.s eecore_elf
212 alt_ee_core.s:
213 echo " * alternative EE core"
214 $(MAKE) -C ee_core -f Makefile.alt clean
215 $(MAKE) $(VMC_FLAGS) $(EECORE_DEBUG_FLAGS) -C ee_core -f Makefile.alt
216 bin2s ee_core/ee_core.elf asm/alt_ee_core.s alt_eecore_elf
218 elfldr.s:
219 echo " * Elf Loader"
220 $(MAKE) -C elfldr clean
221 $(MAKE) -C elfldr
222 bin2s elfldr/elfldr.elf asm/elfldr.s elfldr_elf
224 kpatch_10K.s:
225 echo " * 10K kernel patches"
226 $(MAKE) -C kpatch_10K
227 bin2s kpatch_10K/kpatch.elf asm/kpatch_10K.s kpatch_10K_elf
229 imgdrv.s:
230 echo " * imgdrv.irx"
231 $(MAKE) -C modules/iopcore/imgdrv
232 bin2s modules/iopcore/imgdrv/imgdrv.irx asm/imgdrv.s imgdrv_irx
234 eesync.s:
235 echo " * eesync.irx"
236 $(MAKE) -C modules/iopcore/eesync
237 bin2s modules/iopcore/eesync/eesync.irx asm/eesync.s eesync_irx
239 usb_cdvdman.s:
240 echo " * usb_cdvdman.irx"
241 $(MAKE) $(VMC_FLAGS) $(CDVDMAN_DEBUG_FLAGS) -C modules/iopcore/cdvdman -f Makefile.usb rebuild
242 bin2s modules/iopcore/cdvdman/cdvdman.irx asm/usb_cdvdman.s usb_cdvdman_irx
244 usb_4Ksectors_cdvdman.s:
245 echo " * usb_4Ksectors_cdvdman.irx"
246 $(MAKE) $(VMC_FLAGS) $(CDVDMAN_DEBUG_FLAGS) -C modules/iopcore/cdvdman -f Makefile.usb.4Ksectors rebuild
247 bin2s modules/iopcore/cdvdman/cdvdman.irx asm/usb_4Ksectors_cdvdman.s usb_4Ksectors_cdvdman_irx
249 smb_cdvdman.s:
250 echo " * smb_cdvdman.irx"
251 $(MAKE) $(VMC_FLAGS) $(CDVDMAN_DEBUG_FLAGS) -C modules/iopcore/cdvdman -f Makefile.smb rebuild
252 bin2s modules/iopcore/cdvdman/cdvdman.irx asm/smb_cdvdman.s smb_cdvdman_irx
254 smb_pcmcia_cdvdman.s:
255 echo " * smb_pcmcia_cdvdman.irx"
256 $(MAKE) $(VMC_FLAGS) $(CDVDMAN_DEBUG_FLAGS) -C modules/iopcore/cdvdman -f Makefile.smb.pcmcia rebuild
257 bin2s modules/iopcore/cdvdman/cdvdman.irx asm/smb_pcmcia_cdvdman.s smb_pcmcia_cdvdman_irx
259 hdd_cdvdman.s:
260 echo " * hdd_cdvdman.irx"
261 $(MAKE) $(VMC_FLAGS) $(CDVDMAN_DEBUG_FLAGS) -C modules/iopcore/cdvdman -f Makefile.hdd rebuild
262 bin2s modules/iopcore/cdvdman/cdvdman.irx asm/hdd_cdvdman.s hdd_cdvdman_irx
264 hdd_pcmcia_cdvdman.s:
265 echo " * hdd_pcmcia_cdvdman.irx"
266 $(MAKE) $(VMC_FLAGS) $(CDVDMAN_DEBUG_FLAGS) -C modules/iopcore/cdvdman -f Makefile.hdd.pcmcia rebuild
267 bin2s modules/iopcore/cdvdman/cdvdman.irx asm/hdd_pcmcia_cdvdman.s hdd_pcmcia_cdvdman_irx
269 hdd_hdpro_cdvdman.s:
270 echo " * hdd_hdpro_cdvdman.irx"
271 $(MAKE) $(VMC_FLAGS) $(CDVDMAN_DEBUG_FLAGS) -C modules/iopcore/cdvdman -f Makefile.hdd.hdpro rebuild
272 bin2s modules/iopcore/cdvdman/cdvdman.irx asm/hdd_hdpro_cdvdman.s hdd_hdpro_cdvdman_irx
274 cdvdfsv.s:
275 echo " * cdvdfsv.irx"
276 $(MAKE) -C modules/iopcore/cdvdfsv
277 bin2s modules/iopcore/cdvdfsv/cdvdfsv.irx asm/cdvdfsv.s cdvdfsv_irx
279 cddev.s:
280 echo " * cddev.irx"
281 $(MAKE) -C modules/iopcore/cddev
282 bin2s modules/iopcore/cddev/cddev.irx asm/cddev.s cddev_irx
284 usb_mcemu.s:
285 echo " * usb_mcemu.irx"
286 $(MAKE) $(MCEMU_DEBUG_FLAGS) -C modules/mcemu -f Makefile.usb rebuild
287 bin2s modules/mcemu/mcemu.irx asm/usb_mcemu.s usb_mcemu_irx
289 hdd_mcemu.s:
290 echo " * hdd_mcemu.irx"
291 $(MAKE) $(MCEMU_DEBUG_FLAGS) -C modules/mcemu -f Makefile.hdd rebuild
292 bin2s modules/mcemu/mcemu.irx asm/hdd_mcemu.s hdd_mcemu_irx
294 smb_mcemu.s:
295 echo " * smb_mcemu.irx"
296 $(MAKE) $(MCEMU_DEBUG_FLAGS) -C modules/mcemu -f Makefile.smb rebuild
297 bin2s modules/mcemu/mcemu.irx asm/smb_mcemu.s smb_mcemu_irx
299 usbd_ps2.s:
300 bin2s $(PS2SDK)/iop/irx/usbd.irx asm/usbd_ps2.s usbd_ps2_irx
302 usbd_ps3.s:
303 bin2s modules/usb/usbd/usbd.irx asm/usbd_ps3.s usbd_ps3_irx
305 usbhdfsd.s:
306 echo " * usbhdfsd.irx"
307 $(MAKE) -C modules/usb/usbhdfsd
308 bin2s modules/usb/usbhdfsd/usbhdfsd.irx asm/usbhdfsd.s usbhdfsd_irx
310 ps2dev9.s:
311 echo " * ps2dev9.irx"
312 $(MAKE) -C modules/dev9
313 bin2s modules/dev9/ps2dev9.irx asm/ps2dev9.s ps2dev9_irx
315 smsutils.s:
316 echo " * SMSUTILS.irx"
317 $(MAKE) -C modules/network/SMSUTILS
318 bin2s modules/network/SMSUTILS/SMSUTILS.irx asm/smsutils.s smsutils_irx
320 smstcpip.s:
321 echo " * SMSTCPIP.irx"
322 $(MAKE) -C modules/network/SMSTCPIP -f Makefile rebuild
323 bin2s modules/network/SMSTCPIP/SMSTCPIP.irx asm/smstcpip.s smstcpip_irx
325 ingame_smstcpip.s:
326 echo " * in-game SMSTCPIP.irx"
327 $(MAKE) $(SMSTCPIP_INGAME_CFLAGS) -C modules/network/SMSTCPIP rebuild
328 bin2s modules/network/SMSTCPIP/SMSTCPIP.irx asm/ingame_smstcpip.s ingame_smstcpip_irx
330 smsmap.s:
331 echo " * SMSMAP.irx"
332 $(MAKE) -C modules/network/SMSMAP
333 bin2s modules/network/SMSMAP/SMSMAP.irx asm/smsmap.s smsmap_irx
335 smbman.s:
336 bin2s $(PS2SDK)/iop/irx/smbman.irx asm/smbman.s smbman_irx
338 discid.s:
339 echo " * discID.irx"
340 $(MAKE) -C modules/cdvd/discID
341 bin2s modules/cdvd/discID/discID.irx asm/discid.s discid_irx
343 ps2atad.s:
344 echo " * ps2atad.irx"
345 $(MAKE) -C modules/hdd/atad
346 bin2s modules/hdd/atad/ps2atad.irx asm/ps2atad.s ps2atad_irx
348 hdpro_atad.s:
349 echo " * hdpro_atad.irx"
350 $(MAKE) -C modules/hdd/hdpro_atad
351 bin2s modules/hdd/hdpro_atad/hdpro_atad.irx asm/hdpro_atad.s hdpro_atad_irx
353 poweroff.s:
354 bin2s $(PS2SDK)/iop/irx/poweroff.irx asm/poweroff.s poweroff_irx
356 ps2hdd.s:
357 echo " * ps2hdd.irx"
358 $(MAKE) -C modules/hdd/ps2hdd
359 bin2s modules/hdd/ps2hdd/ps2hdd.irx asm/ps2hdd.s ps2hdd_irx
361 genvmc.s:
362 echo " * genvmc.irx"
363 $(MAKE) $(MOD_DEBUG_FLAGS) -C modules/vmc/genvmc
364 bin2s modules/vmc/genvmc/genvmc.irx asm/genvmc.s genvmc_irx
366 hdldsvr.s:
367 echo " * hdldsvr.irx"
368 $(MAKE) -C modules/hdd/hdldsvr
369 bin2s modules/hdd/hdldsvr/hdldsvr.irx asm/hdldsvr.s hdldsvr_irx
371 udptty.s:
372 echo " * udptty.irx"
373 $(MAKE) -C modules/debug/udptty
374 bin2s modules/debug/udptty/udptty.irx asm/udptty.s udptty_irx
376 ioptrap.s:
377 echo " * ioptrap.irx"
378 $(MAKE) -C modules/debug/ioptrap
379 bin2s modules/debug/ioptrap/ioptrap.irx asm/ioptrap.s ioptrap_irx
381 ps2link.s:
382 echo " * ps2link.irx"
383 $(MAKE) -C modules/debug/ps2link
384 bin2s modules/debug/ps2link/ps2link.irx asm/ps2link.s ps2link_irx
386 ps2fs.s:
387 echo " * ps2fs.irx"
388 $(MAKE) -C modules/ps2fs
389 bin2s modules/ps2fs/ps2fs.irx asm/ps2fs.s ps2fs_irx
391 iomanx.s:
392 bin2s $(PS2SDK)/iop/irx/iomanX.irx asm/iomanx.s iomanx_irx
394 filexio.s:
395 bin2s $(PS2SDK)/iop/irx/fileXio.irx asm/filexio.s filexio_irx
397 load0.s:
398 bin2s gfx/load0.png asm/load0.s load0_png
400 load1.s:
401 bin2s gfx/load1.png asm/load1.s load1_png
403 load2.s:
404 bin2s gfx/load2.png asm/load2.s load2_png
406 load3.s:
407 bin2s gfx/load3.png asm/load3.s load3_png
409 load4.s:
410 bin2s gfx/load4.png asm/load4.s load4_png
412 load5.s:
413 bin2s gfx/load5.png asm/load5.s load5_png
415 load6.s:
416 bin2s gfx/load6.png asm/load6.s load6_png
418 load7.s:
419 bin2s gfx/load7.png asm/load7.s load7_png
421 logo.s:
422 bin2s gfx/logo.png asm/logo.s logo_png
424 usb_icon.s:
425 bin2s gfx/usb.png asm/usb_icon.s usb_png
427 hdd_icon.s:
428 bin2s gfx/hdd.png asm/hdd_icon.s hdd_png
430 eth_icon.s:
431 bin2s gfx/eth.png asm/eth_icon.s eth_png
433 app_icon.s:
434 bin2s gfx/app.png asm/app_icon.s app_png
436 cross_icon.s:
437 bin2s gfx/cross.png asm/cross_icon.s cross_png
439 triangle_icon.s:
440 bin2s gfx/triangle.png asm/triangle_icon.s triangle_png
442 circle_icon.s:
443 bin2s gfx/circle.png asm/circle_icon.s circle_png
445 square_icon.s:
446 bin2s gfx/square.png asm/square_icon.s square_png
448 select_icon.s:
449 bin2s gfx/select.png asm/select_icon.s select_png
451 start_icon.s:
452 bin2s gfx/start.png asm/start_icon.s start_png
454 left_icon.s:
455 bin2s gfx/left.png asm/left_icon.s left_png
457 right_icon.s:
458 bin2s gfx/right.png asm/right_icon.s right_png
460 up_icon.s:
461 bin2s gfx/up.png asm/up_icon.s up_png
463 down_icon.s:
464 bin2s gfx/down.png asm/down_icon.s down_png
466 L1_icon.s:
467 bin2s gfx/L1.png asm/L1_icon.s L1_png
469 L2_icon.s:
470 bin2s gfx/L2.png asm/L2_icon.s L2_png
472 R1_icon.s:
473 bin2s gfx/R1.png asm/R1_icon.s R1_png
475 R2_icon.s:
476 bin2s gfx/R2.png asm/R2_icon.s R2_png
478 freesans.s:
479 bin2s thirdparty/FreeSans_basic_latin.ttf asm/freesans.s freesansfont_raw
481 icon_sys.s:
482 bin2s gfx/icon.sys asm/icon_sys.s icon_sys
484 icon_icn.s:
485 bin2s gfx/opl.icn asm/icon_icn.s icon_icn
487 $(EE_OBJS_DIR)%.o : $(EE_SRC_DIR)%.c
488 $(EE_CC) $(EE_CFLAGS) $(EE_INCS) -c $< -o $@
490 $(EE_OBJS_DIR)%.o : %.s
491 $(EE_AS) $(EE_ASFLAGS) $(EE_ASM_DIR)$< -o $@
494 include $(PS2SDK)/samples/Makefile.pref
495 include $(PS2SDK)/samples/Makefile.eeglobal