forked from ps2dev/ps2link
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
135 lines (110 loc) · 3.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Compilation variables
# Set this to 1 to enable debug mode
DEBUG = 0
# Set this to 1 to build a highloading version, 0 for normal low version
LOADHIGH = 0
# Set this to 1 to build ps2link with all the needed IRX builtins
BUILTIN_IRXS = 1
# Set this to 1 to enable caching of config files
CACHED_CFG = 1
# Set this to 1 to enable zero-copy on fileio writes.
ZEROCOPY = 0
# Set this to 1 to power off the ps2 when the reset button is tapped
# otherwise it will try and reset ps2link
PWOFFONRESET = 1
# Set this to 1 to hook the kernel CreateThread/DeleteThread calls.
# Note that this will cause problems when loading PS2LINK.ELF from PS2LINK...
HOOK_THREADS = 0
# Set to the path where ps2eth is located
PS2ETH = $(PS2DEV)/ps2eth
SHELL=/usr/bin/env bash
BIN2O=$(PS2SDK)/bin/bin2o
RM=rm -f
#
# You shouldn't need to modify anything below this point
#
include $(PS2SDK)/Defs.make
EEFILES=ee/ps2link.elf
IRXFILES=iop/ps2link.irx $(PS2SDK)/iop/irx/ps2ip.irx \
$(PS2ETH)/smap/ps2smap.irx \
$(PS2SDK)/iop/irx/ioptrap.irx \
$(PS2SDK)/iop/irx/ps2dev9.irx \
$(PS2SDK)/iop/irx/poweroff.irx
VARIABLES=DEBUG=$(DEBUG) LOADHIGH=$(LOADHIGH) BUILTIN_IRXS=$(BUILTIN_IRXS) ZEROCOPY=$(ZEROCOPY) PWOFFONRESET=$(PWOFFONRESET) CACHED_CFG=$(CACHED_CFG) HOOK_THREADS=$(HOOK_THREADS)
ifeq ($(BUILTIN_IRXS),1)
TARGETS = iop builtins ee
else
TARGETS = ee iop
endif
all: $(TARGETS)
ifneq ($(BUILTIN_IRXS),1)
@for file in $(IRXFILES); do \
new=`echo $${file/*\//}|tr "[:lower:]" "[:upper:]"`; \
cp $$file bin/$$new; \
done;
endif
@for file in $(EEFILES); do \
new=`echo $${file/*\//}|tr "[:lower:]" "[:upper:]"`; \
ps2-packer $$file bin/$$new; \
done;
ee:
$(VARIABLES) $(MAKE) -C ee
iop:
$(VARIABLES) $(MAKE) -C iop
clean:
$(MAKE) -C ee clean
$(MAKE) -C iop clean
@rm -f ee/*_irx.o bin/*.ELF bin/*.IRX
check:
$(VARIABLES) $(MAKE) -C ee check
# Creates a zip from what you have
dist: all
@rm -rf dist
@mkdir -p dist/ps2link
ifneq ($(BUILTIN_IRXS),1)
@for file in $(IRXFILES); do \
new=`echo $${file/*\//}|tr "[:lower:]" "[:upper:]"`; \
cp $$file dist/ps2link/$$new; \
done;
endif
@for file in $(EEFILES); do \
new=`echo $${file/*\//}|tr "[:lower:]" "[:upper:]"`; \
cp $$file dist/ps2link/$$new; \
done;
cd dist; \
tar -jcf ps2link.tar.bz2 ps2link/
RELEASE_FILES=bin/*IRX bin/*DAT bin/*cnf bin/*ELF LICENSE README
#
# Creates zip with iso and all necessary files of last release
release:
@rm -rf RELEASE
@mkdir -p RELEASE
@VERSION=`cvs log Makefile | grep -A 1 symbolic | tail -1 | awk '{print substr($$1, 0, length($$1)-1)}'`; \
cd RELEASE; \
cvs co -r $$VERSION ps2link; \
cd ps2link; \
make; \
make check; \
mkdir -p bin; \
for file in $(IRXFILES); do \
new=`echo $${file/*\//}|tr "[:lower:]" "[:upper:]"`; \
cp $$file bin/$$new; \
done; \
for file in $(EEFILES); do \
new=`echo $${file/*\//}|tr "[:lower:]" "[:upper:]"`; \
cp $$file bin/$$new; \
done; \
dd if=/dev/zero of=bin/dummy bs=1024 count=28672; \
ps2mkisofs -o ps2link_$$VERSION.iso bin/; \
rm bin/dummy; \
tar -jcf ps2link_$$VERSION.tbz $(RELEASE_FILES) ps2link_$$VERSION.iso
docs:
doxygen doxy.conf
builtins:
@for file in $(IRXFILES); do \
basefile=$${file/*\//}; \
basefile=$${basefile/\.*/}; \
echo "Embedding IRX file $$basefile"; \
$(BIN2O) $$file ee/$${basefile}_irx.o _binary_$${basefile}_irx; \
done;
.PHONY: iop ee