diff --git a/modules/Rules.bin.make b/modules/Rules.bin.make index 03cb27f2d..f5429465c 100644 --- a/modules/Rules.bin.make +++ b/modules/Rules.bin.make @@ -1,7 +1,12 @@ +BIN2C = $(PS2SDK)/bin/bin2c +BIN2S = $(PS2SDK)/bin/bin2s +BIN2O = $(PS2SDK)/bin/bin2o +IOP_SRC_DIR = ./ + all: $(IOP_BIN) clean: - rm -f $(IOP_BIN) $(IOP_OBJS) + rm -r -f $(IOP_BIN) $(IOP_OBJS) $(IOP_OBJS_DIR) $(IOP_BIN_DIR) $(IOP_LIB_DIR) rebuild: clean all diff --git a/modules/Rules.make b/modules/Rules.make deleted file mode 100644 index b6eee95f1..000000000 --- a/modules/Rules.make +++ /dev/null @@ -1,83 +0,0 @@ -# _____ ___ ____ ___ ____ -# ____| | ____| | | |____| -# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. -#----------------------------------------------------------------------- -# Copyright 2001-2004, ps2dev - http://www.ps2dev.org -# Licenced under Academic Free License version 2.0 -# Review ps2sdk README & LICENSE files for further details. - -IOP_CC_VERSION := $(shell $(IOP_CC) -dumpversion) - -ifeq ($(IOP_CC_VERSION),3.2.2) -ASFLAGS_TARGET = -march=r3000 -endif - -ifeq ($(IOP_CC_VERSION),3.2.3) -ASFLAGS_TARGET = -march=r3000 -endif - -# include dir -IOP_INCS := $(IOP_INCS) -I$(PS2SDK)/iop/include -I$(PS2SDK)/common/include -Iinclude - -# C compiler flags -# -fno-builtin is required to prevent the GCC built-in functions from being included, -# for finer-grained control over what goes into each IRX. -IOP_CFLAGS := -D_IOP -fno-builtin -Os -G0 -Wall -Werror $(IOP_INCS) $(IOP_CFLAGS) -# linker flags -IOP_LDFLAGS := -nostdlib -s $(IOP_LDFLAGS) - -# Additional C compiler flags for GCC >=v5.3.0 -# -msoft-float is to "remind" GCC/Binutils that the soft-float ABI is to be used. This is due to a bug, which -# results in the ABI not being passed correctly to binutils and iop-as defaults to the hard-float ABI instead. -# -mno-explicit-relocs is required to work around the fact that GCC is now known to -# output multiple LO relocs after one HI reloc (which the IOP kernel cannot deal with). -# -fno-toplevel-reorder (for IOP import and export tables only) disables toplevel reordering by GCC v4.2 and later. -# Without it, the import and export tables can be broken apart by GCC's optimizations. -ifneq ($(IOP_CC_VERSION),3.2.2) -ifneq ($(IOP_CC_VERSION),3.2.3) -IOP_CFLAGS += -msoft-float -mno-explicit-relocs -IOP_IETABLE_CFLAGS := -fno-toplevel-reorder -endif -endif - -# Assembler flags -IOP_ASFLAGS := $(ASFLAGS_TARGET) -EL -G0 $(IOP_ASFLAGS) - -BIN2C = $(PS2SDK)/bin/bin2c -BIN2S = $(PS2SDK)/bin/bin2s -BIN2O = $(PS2SDK)/bin/bin2o - -# Externally defined variables: IOP_BIN, IOP_OBJS, IOP_LIB -$(IOP_OBJS_DIR): - mkdir -p $(IOP_OBJS_DIR) - -$(IOP_OBJS_DIR)%.o : %.c - $(IOP_CC) $(IOP_CFLAGS) -c $< -o $@ - -$(IOP_OBJS_DIR)%.o : %.S - $(IOP_CC) $(IOP_CFLAGS) -c $< -o $@ - -$(IOP_OBJS_DIR)%.o : %.s - $(IOP_AS) $(IOP_ASFLAGS) $< -o $@ - -# A rule to build imports.lst. -$(IOP_OBJS_DIR)%.o : %.lst - $(ECHO) "#include \"irx_imports.h\"" > $(IOP_OBJS_DIR)build-imports.c - cat $< >> $(IOP_OBJS_DIR)build-imports.c - $(IOP_CC) $(IOP_CFLAGS) -I. -c $(IOP_OBJS_DIR)build-imports.c -o $@ - -rm -f $(IOP_OBJS_DIR)build-imports.c - -# A rule to build exports.tab. -$(IOP_OBJS_DIR)%.o : %.tab - $(ECHO) "#include \"irx.h\"" > $(IOP_OBJS_DIR)build-exports.c - cat $< >> $(IOP_OBJS_DIR)build-exports.c - $(IOP_CC) $(IOP_CFLAGS) -I. -c $(IOP_OBJS_DIR)build-exports.c -o $@ - -rm -f $(IOP_OBJS_DIR)build-exports.c - -$(IOP_BIN) : $(IOP_OBJS_DIR) $(IOP_OBJS) - echo " -$@" - $(IOP_CC) $(IOP_CFLAGS) -o $(IOP_BIN) $(IOP_OBJS) $(IOP_LDFLAGS) $(IOP_LIBS) - -$(IOP_LIB) : $(IOP_OBJS_DIR) $(IOP_OBJS) - echo " -$@" - $(IOP_AR) cru $(IOP_LIB) $(IOP_OBJS) diff --git a/modules/bdmevent/Makefile b/modules/bdmevent/Makefile index 5334f6aed..b6375dd42 100644 --- a/modules/bdmevent/Makefile +++ b/modules/bdmevent/Makefile @@ -5,4 +5,4 @@ IOP_INCS += -I../../include/ include $(PS2SDK)/Defs.make include ../Rules.bin.make -include ../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/debug/ioptrap/Makefile b/modules/debug/ioptrap/Makefile index 600a4779b..320200653 100644 --- a/modules/debug/ioptrap/Makefile +++ b/modules/debug/ioptrap/Makefile @@ -3,4 +3,4 @@ IOP_OBJS = ioptrap.o handler.o breakpoint.o imports.o exports.o include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/debug/ps2link/Makefile b/modules/debug/ps2link/Makefile index 4d1d9ed70..566aa5a7a 100644 --- a/modules/debug/ps2link/Makefile +++ b/modules/debug/ps2link/Makefile @@ -17,4 +17,4 @@ endif include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/debug/ps2link/imports.lst b/modules/debug/ps2link/imports.lst index 0522f5008..a921f087f 100644 --- a/modules/debug/ps2link/imports.lst +++ b/modules/debug/ps2link/imports.lst @@ -33,6 +33,16 @@ ioman_IMPORTS_end ps2ip_IMPORTS_start I_lwip_send +#ifdef DEBUG +I_lwip_sendto +I_lwip_socket +I_lwip_listen +I_lwip_recv +I_lwip_recvfrom +I_lwip_close +I_lwip_bind +I_lwip_accept +#endif ps2ip_IMPORTS_end sifcmd_IMPORTS_start diff --git a/modules/debug/udptty-ingame/Makefile b/modules/debug/udptty-ingame/Makefile index a9bbb9df5..46e04caa1 100644 --- a/modules/debug/udptty-ingame/Makefile +++ b/modules/debug/udptty-ingame/Makefile @@ -6,4 +6,4 @@ IOP_CFLAGS += -DKPRTTY include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/ds34bt/iop/Makefile b/modules/ds34bt/iop/Makefile index 791137e49..cb0d5889c 100644 --- a/modules/ds34bt/iop/Makefile +++ b/modules/ds34bt/iop/Makefile @@ -3,4 +3,4 @@ IOP_OBJS = ds34bt.o smsutils.o imports.o include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/ds34usb/iop/Makefile b/modules/ds34usb/iop/Makefile index af12e1396..8c0488564 100644 --- a/modules/ds34usb/iop/Makefile +++ b/modules/ds34usb/iop/Makefile @@ -3,4 +3,4 @@ IOP_OBJS = ds34usb.o smsutils.o imports.o include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/hdd/xhdd/Makefile b/modules/hdd/xhdd/Makefile index 0ab5e5e49..55c40700a 100644 --- a/modules/hdd/xhdd/Makefile +++ b/modules/hdd/xhdd/Makefile @@ -5,4 +5,4 @@ IOP_INCS += -I../common include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/iopcore/cdvdfsv/Makefile b/modules/iopcore/cdvdfsv/Makefile index c7f5729b8..f3b3dfec1 100644 --- a/modules/iopcore/cdvdfsv/Makefile +++ b/modules/iopcore/cdvdfsv/Makefile @@ -9,4 +9,4 @@ endif include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/iopcore/cdvdman/Makefile b/modules/iopcore/cdvdman/Makefile index f31098f77..7dd04403f 100644 --- a/modules/iopcore/cdvdman/Makefile +++ b/modules/iopcore/cdvdman/Makefile @@ -49,8 +49,6 @@ IOP_OBJS += dev9.o IOP_CFLAGS += -D__USE_DEV9 endif -IOP_OBJS := $(IOP_OBJS:%=$(IOP_OBJS_DIR)%) - include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/iopcore/eesync/Makefile b/modules/iopcore/eesync/Makefile index e37587909..88458013f 100644 --- a/modules/iopcore/eesync/Makefile +++ b/modules/iopcore/eesync/Makefile @@ -3,4 +3,4 @@ IOP_OBJS = eesync.o imports.o include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/iopcore/imgdrv/Makefile b/modules/iopcore/imgdrv/Makefile index ab1557f6f..e89b3c5df 100644 --- a/modules/iopcore/imgdrv/Makefile +++ b/modules/iopcore/imgdrv/Makefile @@ -3,4 +3,4 @@ IOP_OBJS = imgdrv.o imports.o include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/iopcore/patches/apemodpatch/Makefile b/modules/iopcore/patches/apemodpatch/Makefile index 1acd6d0cb..47d717861 100644 --- a/modules/iopcore/patches/apemodpatch/Makefile +++ b/modules/iopcore/patches/apemodpatch/Makefile @@ -3,4 +3,4 @@ IOP_OBJS = main.o imports.o include $(PS2SDK)/Defs.make include ../../../Rules.bin.make -include ../../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/iopcore/patches/cleareffects/Makefile b/modules/iopcore/patches/cleareffects/Makefile index ffdc019cf..b2cf6ee53 100644 --- a/modules/iopcore/patches/cleareffects/Makefile +++ b/modules/iopcore/patches/cleareffects/Makefile @@ -3,4 +3,4 @@ IOP_OBJS = main.o imports.o include $(PS2SDK)/Defs.make include ../../../Rules.bin.make -include ../../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/iopcore/patches/f2techioppatch/Makefile b/modules/iopcore/patches/f2techioppatch/Makefile index 9706aa505..78b94b71c 100644 --- a/modules/iopcore/patches/f2techioppatch/Makefile +++ b/modules/iopcore/patches/f2techioppatch/Makefile @@ -3,4 +3,4 @@ IOP_OBJS = main.o imports.o include $(PS2SDK)/Defs.make include ../../../Rules.bin.make -include ../../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/iopcore/patches/iremsndpatch/Makefile b/modules/iopcore/patches/iremsndpatch/Makefile index 911f52f85..13584d0cf 100644 --- a/modules/iopcore/patches/iremsndpatch/Makefile +++ b/modules/iopcore/patches/iremsndpatch/Makefile @@ -3,4 +3,4 @@ IOP_OBJS = main.o asm.o imports.o include $(PS2SDK)/Defs.make include ../../../Rules.bin.make -include ../../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/iopcore/resetspu/Makefile b/modules/iopcore/resetspu/Makefile index 24be6f545..bb1566aed 100644 --- a/modules/iopcore/resetspu/Makefile +++ b/modules/iopcore/resetspu/Makefile @@ -3,4 +3,4 @@ IOP_OBJS = resetspu.o imports.o include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/iopcore/udnl-t300/Makefile b/modules/iopcore/udnl-t300/Makefile index af950388d..a25d0f4b5 100644 --- a/modules/iopcore/udnl-t300/Makefile +++ b/modules/iopcore/udnl-t300/Makefile @@ -1,6 +1,11 @@ IOP_BIN = udnl.irx IOP_OBJS = udnl.o udnl_asm.o imports.o IOPRP_img.o +BIN2C = $(PS2SDK)/bin/bin2c +BIN2S = $(PS2SDK)/bin/bin2s +BIN2O = $(PS2SDK)/bin/bin2o +IOP_SRC_DIR = ./ + IOP_INCS += -I./include all: $(IOP_BIN) @@ -12,4 +17,4 @@ IOPRP_img.c: $(BIN2C) IOPRP.img IOPRP_img.c IOPRP_img include $(PS2SDK)/Defs.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/iopcore/udnl/Makefile b/modules/iopcore/udnl/Makefile index 458f4f280..1abb40247 100644 --- a/modules/iopcore/udnl/Makefile +++ b/modules/iopcore/udnl/Makefile @@ -1,6 +1,11 @@ IOP_BIN = udnl.irx IOP_OBJS = udnl.o udnl_asm.o imports.o +BIN2C = $(PS2SDK)/bin/bin2c +BIN2S = $(PS2SDK)/bin/bin2s +BIN2O = $(PS2SDK)/bin/bin2o +IOP_SRC_DIR = ./ + IOP_INCS += -I./include ifeq ($(DECI2_DEBUG),1) IOP_CFLAGS += -D__DECI2_DEBUG @@ -21,4 +26,4 @@ IOPRP_DECI2_img.c: $(BIN2C) IOPRP_DECI2.img IOPRP_DECI2_img.c IOPRP_img include $(PS2SDK)/Defs.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/isofs/Makefile b/modules/isofs/Makefile index 84b1c590b..b79cdc002 100644 --- a/modules/isofs/Makefile +++ b/modules/isofs/Makefile @@ -3,4 +3,4 @@ IOP_OBJS = isofs.o imports.o include $(PS2SDK)/Defs.make include ../Rules.bin.make -include ../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/mcemu/Makefile b/modules/mcemu/Makefile index 622953cdd..b0a68744a 100644 --- a/modules/mcemu/Makefile +++ b/modules/mcemu/Makefile @@ -21,8 +21,6 @@ IOP_OBJS += device-bdm.o IOP_CFLAGS += -DBDM_DRIVER endif -IOP_OBJS := $(IOP_OBJS:%=$(IOP_OBJS_DIR)%) - ifeq ($(IOPCORE_DEBUG),1) IOP_CFLAGS += -DDEBUG endif @@ -33,4 +31,4 @@ endif include $(PS2SDK)/Defs.make include ../Rules.bin.make -include ../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/network/SMSTCPIP/Makefile b/modules/network/SMSTCPIP/Makefile index 8f636c726..8e17cdd28 100644 --- a/modules/network/SMSTCPIP/Makefile +++ b/modules/network/SMSTCPIP/Makefile @@ -30,7 +30,7 @@ endif include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal ifneq ($(IOP_CC_VERSION),3.2.2) ifneq ($(IOP_CC_VERSION),3.2.3) diff --git a/modules/network/SMSUTILS/Makefile b/modules/network/SMSUTILS/Makefile index db24badb8..03002069a 100644 --- a/modules/network/SMSUTILS/Makefile +++ b/modules/network/SMSUTILS/Makefile @@ -5,4 +5,4 @@ IOP_INCS += -I../../iopcore/common include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/network/httpclient/Makefile b/modules/network/httpclient/Makefile index 3ec74286d..99f35aaca 100644 --- a/modules/network/httpclient/Makefile +++ b/modules/network/httpclient/Makefile @@ -5,4 +5,4 @@ IOP_INCS += -I../common include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/network/lwnbdsvr/Makefile b/modules/network/lwnbdsvr/Makefile index 5a60bab2c..0f4a2998b 100644 --- a/modules/network/lwnbdsvr/Makefile +++ b/modules/network/lwnbdsvr/Makefile @@ -2,7 +2,7 @@ IOP_BIN = lwnbdsvr.irx IOP_OBJS = lwnbdsvr.o imports.o exports.o drivers/atad.o lwNBD/nbd_server.o IOP_CFLAGS += -DPS2SDK -IOP_INCS += -I../../iopcore/common -I../../../include/ +IOP_INCS += -I../../iopcore/common -I../../../include/ ifeq ($(DEBUG),1) IOP_CFLAGS += -DDEBUG -DNBD_DEBUG @@ -10,7 +10,7 @@ endif include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal ifneq ($(IOP_CC_VERSION),3.2.2) ifneq ($(IOP_CC_VERSION),3.2.3) diff --git a/modules/network/nbns/Makefile b/modules/network/nbns/Makefile index 8270f7f1b..2ca55cc59 100644 --- a/modules/network/nbns/Makefile +++ b/modules/network/nbns/Makefile @@ -5,4 +5,4 @@ IOP_INCS += -I../../../include include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/network/smap-ingame/Makefile b/modules/network/smap-ingame/Makefile index 20a94b21f..c99608dab 100644 --- a/modules/network/smap-ingame/Makefile +++ b/modules/network/smap-ingame/Makefile @@ -5,4 +5,4 @@ IOP_INCS += -I../../iopcore/common -I../common include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/network/smbinit/Makefile b/modules/network/smbinit/Makefile index d2732260f..246737f89 100644 --- a/modules/network/smbinit/Makefile +++ b/modules/network/smbinit/Makefile @@ -5,4 +5,4 @@ IOP_INCS += -I../../iopcore/common include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/pademu/Makefile b/modules/pademu/Makefile index 3956b1a2b..9c6e93f62 100644 --- a/modules/pademu/Makefile +++ b/modules/pademu/Makefile @@ -18,10 +18,8 @@ ifeq ($(VMC),1) IOP_CFLAGS += -DVMC endif -IOP_OBJS := $(IOP_OBJS:%=$(IOP_OBJS_DIR)%) - IOP_CFLAGS += -DUSE_SMSUTILS include $(PS2SDK)/Defs.make include ../Rules.bin.make -include ../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal diff --git a/modules/vmc/genvmc/Makefile b/modules/vmc/genvmc/Makefile index 56cae80dc..03641a599 100644 --- a/modules/vmc/genvmc/Makefile +++ b/modules/vmc/genvmc/Makefile @@ -7,4 +7,4 @@ endif include $(PS2SDK)/Defs.make include ../../Rules.bin.make -include ../../Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal