@@ -5,35 +5,60 @@ EE_INCS += -I../include
55# This is for the sbv patch
66EE_LIBS += -lpatches -ldebug
77
8- # This is to builtin the IRXs into ps2link
9- EE_OBJS += ps2link_irx.o ps2ip_nm_irx.o netman_irx.o smap_irx.o ioptrap_irx.o ps2dev9_irx.o poweroff_irx.o udptty_irx.o
8+ # IRX libs
9+ IRX_FILES += ioptrap.irx ps2dev9.irx poweroff.irx
10+ IRX_FILES += ps2ip.irx netman.irx smap.irx udptty.irx
11+ IRX_FILES += ps2link.irx
12+ EE_OBJS += $(IRX_FILES:.irx=_irx.o ) ps2ip_nm_irx.o
13+
14+ # Compile with -Werror
15+ EE_CFLAGS += -Werror
1016
1117# This is to enable the debug mode into ps2link
1218ifeq ($(DEBUG ) ,1)
1319EE_CFLAGS += -DDEBUG -g
20+ else
21+ EE_CFLAGS += -Os
22+ EE_CFLAGS += -fdata-sections -ffunction-sections
1423endif
1524
25+ ifeq ($(DEBUG ) ,1)
26+ EE_LDFLAGS += -g
27+ else
28+ EE_LDFLAGS += -s
29+ EE_LDFLAGS += -Wl,--gc-sections
30+ endif
31+ EE_LDFLAGS += -Wl,-Map,ps2link.map
32+
1633# This is to read the closest tag version
1734APP_VERSION := $(shell git describe --tags --abbrev=0)
1835EE_CFLAGS += -DAPP_VERSION=\"$(APP_VERSION ) \"
1936
37+ # Use NEWLIB NANO for making smaller binaries
38+ NEWLIB_NANO = 1
39+
2040# Use custom linkfile
2141ifeq ($(LOADHIGH ) ,1)
2242EE_LINKFILE = linkfile.loadhigh
2343else
2444EE_LINKFILE = linkfile
2545endif
2646
27- ifeq ($(DEBUG ) ,1)
28- EE_LDFLAGS += -g
29- else
30- EE_LDFLAGS += -s
31- endif
32-
3347all : $(EE_BIN )
3448
3549clean :
3650 -rm -f $(EE_OBJS ) $(EE_BIN )
3751
52+ # IRX files
53+ # Special rule for ps2ip-nm.irx becasue - aren't valid
54+ ps2ip_nm_irx.c :
55+ $(PS2SDK ) /bin/bin2c $(PS2SDK ) /iop/irx/ps2ip-nm.irx $@ ps2ip_nm_irx
56+ # Special rule for local ps2link.irx
57+ ps2link_irx.c :
58+ $(PS2SDK ) /bin/bin2c ../iop/ps2link.irx $@ ps2link_irx
59+ % _irx.c :
60+ $(PS2SDK ) /bin/bin2c $(PS2SDK ) /iop/irx/$* .irx $@ $* _irx
61+
62+
3863include $(PS2SDK ) /Defs.make
3964include $(PS2SDK ) /samples/Makefile.eeglobal_cpp
0 commit comments