1 | # _____ ___ ____ ___ ____
|
---|
2 | # ____| | ____| | | |____|
|
---|
3 | # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
|
---|
4 | #-----------------------------------------------------------------------
|
---|
5 | # Copyright 2001-2004.
|
---|
6 | # Licenced under Academic Free License version 2.0
|
---|
7 | # Review ps2sdk README & LICENSE files for further details.
|
---|
8 |
|
---|
9 |
|
---|
10 | IOP_CC_VERSION := $(shell $(IOP_CC) -v 2>&1 | sed -n 's/^.*version //p')
|
---|
11 |
|
---|
12 | ASFLAGS_TARGET = -mcpu=r3000
|
---|
13 |
|
---|
14 | ifeq ($(IOP_CC_VERSION),3.2.2)
|
---|
15 | CFLAGS_TARGET = -miop
|
---|
16 | ASFLAGS_TARGET = -march=r3000
|
---|
17 | LDFLAGS_TARGET = -miop
|
---|
18 | endif
|
---|
19 |
|
---|
20 | IOP_INCS := $(IOP_INCS) -I$(PS2SDK)/iop/include -I$(PS2SDK)/common/include
|
---|
21 |
|
---|
22 | IOP_CFLAGS := $(CFLAGS_TARGET) -O2 -G0 -c $(IOP_INCS) $(IOP_CFLAGS)
|
---|
23 | IOP_ASFLAGS := $(ASFLAGS_TARGET) -EL -G0 $(IOP_ASFLAGS)
|
---|
24 | IOP_LDFLAGS := $(LDFLAGS_TARGET) -nostdlib $(IOP_LDFLAGS)
|
---|
25 |
|
---|
26 | # Externally defined variables: IOP_BIN, IOP_OBJS, IOP_LIB
|
---|
27 |
|
---|
28 | %.o : %.c
|
---|
29 | $(IOP_CC) $(IOP_CFLAGS) $< -o $@
|
---|
30 |
|
---|
31 | %.o : %.s
|
---|
32 | $(IOP_AS) $(IOP_ASFLAGS) $< -o $@
|
---|
33 |
|
---|
34 | # A rule to build imports.lst.
|
---|
35 | %.o : %.lst
|
---|
36 | echo "#include \"irx_imports.h\"" > build-imports.c
|
---|
37 | cat $< >> build-imports.c
|
---|
38 | $(IOP_CC) $(IOP_CFLAGS) build-imports.c -o $@
|
---|
39 | -rm -f build-imports.c
|
---|
40 |
|
---|
41 | # A rule to build exports.tab.
|
---|
42 | %.o : %.tab
|
---|
43 | echo "#include \"irx.h\"" > build-exports.c
|
---|
44 | cat $< >> build-exports.c
|
---|
45 | $(IOP_CC) $(IOP_CFLAGS) build-exports.c -o $@
|
---|
46 | -rm -f build-exports.c
|
---|
47 |
|
---|
48 |
|
---|
49 | $(IOP_BIN) : $(IOP_OBJS)
|
---|
50 | $(IOP_CC) $(IOP_LDFLAGS) -o $(IOP_BIN) $(IOP_OBJS) $(IOP_LIBS)
|
---|
51 |
|
---|
52 | $(IOP_LIB) : $(IOP_OBJS)
|
---|
53 | $(IOP_AR) cru $(IOP_LIB) $(IOP_OBJS)
|
---|
54 |
|
---|