1 # _____ ___ ____ ___ ____
2 # ____| | ____| | | |____|
3 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
4 #-----------------------------------------------------------------------
6 # Licenced under Academic Free License version 2.0
7 # Review ps2sdk README & LICENSE files for further details.
10 IOP_CC_VERSION
:= $(shell $(IOP_CC
) -v
2>&1 | sed
-n
's/^.*versi[^ ]*n.* //p')
12 ASFLAGS_TARGET
= -mcpu
=r3000
14 ifeq ($(IOP_CC_VERSION
),3.2.2)
16 ASFLAGS_TARGET
= -march
=r3000
17 LDFLAGS_TARGET
= -miop
19 ifeq ($(IOP_CC_VERSION
),gcc
3.2.2)
21 ASFLAGS_TARGET
= -march
=r3000
22 LDFLAGS_TARGET
= -miop
26 IOP_INCS
:= $(IOP_INCS
) -I
$(PS2SDK
)/iop
/include -I
$(PS2SDK
)/common
/include -Iinclude
28 IOP_CFLAGS
:= $(CFLAGS_TARGET
) -O2
-G0
-c
$(IOP_INCS
) $(IOP_CFLAGS
)
29 IOP_ASFLAGS
:= $(ASFLAGS_TARGET
) -EL
-G0
$(IOP_ASFLAGS
)
30 IOP_LDFLAGS
:= $(LDFLAGS_TARGET
) -nostdlib
$(IOP_LDFLAGS
)
32 # Externally defined variables: IOP_BIN, IOP_OBJS, IOP_LIB
35 $(IOP_CC
) $(IOP_CFLAGS
) $< -o
$@
38 $(IOP_AS
) $(IOP_ASFLAGS
) $< -o
$@
40 # A rule to build imports.lst.
42 echo
"#include \"irx_imports.h\"" > build-imports.c
43 cat
$< >> build-imports.c
44 $(IOP_CC
) $(IOP_CFLAGS
) build-imports.c
-o
$@
45 -rm -f build-imports.c
47 # A rule to build exports.tab.
49 echo
"#include \"irx.h\"" > build-exports.c
50 cat
$< >> build-exports.c
51 $(IOP_CC
) $(IOP_CFLAGS
) build-exports.c
-o
$@
52 -rm -f build-exports.c
55 $(IOP_BIN
) : $(IOP_OBJS
)
56 $(IOP_CC
) $(IOP_LDFLAGS
) -o
$(IOP_BIN
) $(IOP_OBJS
) $(IOP_LIBS
)
58 $(IOP_LIB
) : $(IOP_OBJS
)
59 $(IOP_AR
) cru
$(IOP_LIB
) $(IOP_OBJS
)