forked from aaSSfxxx/r2-regressions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
220 lines (182 loc) · 4.88 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
VERSION=1.4.0-git
DESTDIR?=/
PREFIX?=/usr/local
BINDIR=$(DESTDIR)/$(PREFIX)/bin
PWD=$(shell pwd)
PKG=radare2-regressions
TAR=tar -cvf
TAREXT=tar.xz
CZ=xz -f
TDIRS=$(shell ls -d t*| grep -v tmp) bins
LIBDIR=$(DESTDIR)/$(PREFIX)/lib
-include config.mk
PULLADDR=https://github.com/radare/radare2-regressions.git
do:
-git pull ${PULLADDR}
-$(MAKE) overlay-apply
$(SHELL) run_tests.sh
overlay:
if [ -f ../t/overlay ]; then \
$(SHELL) overlay.sh create ; \
fi
apply-overlay overlay-apply:
$(SHELL) overlay.sh apply
all:
-$(MAKE) overlay-apply
$(MAKE) alltargets
alltargets: js-tests radare2 commands formats tools io anal esil tools archos unit_tests
radare2:
@if [ -f ../binr/radare2/radare2 ]; then $(SHELL) run_tests.sh ../t ; fi
archos:
@$(MAKE) -C t.archos
dbg.linux:
$(SHELL) run_tests.sh t.archos/Linux
commands:
$(SHELL) run_tests.sh
java: anal.java format.java
tools:
$(SHELL) run_tests.sh t.tools
io:
$(SHELL) run_tests.sh t.io
anal: anal.arc anal.arm anal.avr anal.dalvik anal.java anal.mips anal.x86 anal.others anal.ppc anal.6502 anal.8051 anal.tm320
anal.arc:
$(SHELL) run_tests.sh t.anal/arc
anal.arm:
$(SHELL) run_tests.sh t.anal/arm
anal.avr:
$(SHELL) run_tests.sh t.anal/avr
anal.dalvik:
$(SHELL) run_tests.sh t.anal/dalvik
anal.java:
$(SHELL) run_tests.sh t.anal/java
anal.mips:
$(SHELL) run_tests.sh t.anal/mips
anal.tm320:
$(SHELL) run_tests.sh t.anal/tms320
anal.x86:
$(SHELL) run_tests.sh t.anal/x86
anal.others:
$(SHELL) run_tests.sh t.anal/others_anal
anal.ppc:
$(SHELL) run_tests.sh t.anal/ppc
anal.6502:
$(SHELL) run_tests.sh t.anal/6502
anal.8051:
$(SHELL) run_tests.sh t.anal/8051
esil:
$(SHELL) run_tests.sh t.esil
formats: format.bflt format.coff format.smd format.vsf format.dex format.elf format.firmware format.java format.mach0 format.mangling format.mdmp format.msil format.omf format.others format.pdb format.pe format.xbe format.zimg format.nes format.gba format.wasm
format.vsf:
$(SHELL) run_tests.sh t.formats/vsf
format.smd:
$(SHELL) run_tests.sh t.formats/smd
format.coff:
$(SHELL) run_tests.sh t.formats/coff
format.bflt:
$(SHELL) run_tests.sh t.formats/bflt
format.dex:
$(SHELL) run_tests.sh t.formats/dex
format.elf:
$(SHELL) run_tests.sh t.formats/elf
format.firmware:
$(SHELL) run_tests.sh t.formats/firmware
format.java:
$(SHELL) run_tests.sh t.formats/java
format.mach0:
$(SHELL) run_tests.sh t.formats/mach0
format.mangling:
$(SHELL) run_tests.sh t.formats/mangling
format.mdmp:
$(SHELL) run_tests.sh t.formats/mdmp
format.msil:
$(SHELL) run_tests.sh t.formats/msil
format.omf:
$(SHELL) run_tests.sh t.formats/omf
format.others:
$(SHELL) run_tests.sh t.formats/others
format.pdb:
$(SHELL) run_tests.sh t.formats/pdb
format.pe:
$(SHELL) run_tests.sh t.formats/pe
format.xbe:
$(SHELL) run_tests.sh t.formats/xbe
format.zimg:
$(SHELL) run_tests.sh t.formats/zimg
format.nes:
$(SHELL) run_tests.sh t.formats/nes
format.gba:
$(SHELL) run_tests.sh t.formats/gba
format.wasm:
$(SHELL) run_tests.sh t.formats/wasm
tools: rabin2 radiff2 ragg2 ragg2-cc rahash2 rasm2 rax2 r2
rabin2:
$(SHELL) run_tests.sh t.tools/rabin2
radiff2:
$(SHELL) run_tests.sh t.tools/radiff2
ragg2:
$(SHELL) run_tests.sh t.tools/ragg2
ragg2-cc:
$(SHELL) run_tests.sh t.tools/ragg2-cc
rahash2:
$(SHELL) run_tests.sh t.tools/rahash2
rasm2:
$(SHELL) run_tests.sh t.tools/rasm2
rax2:
$(SHELL) run_tests.sh t.tools/rax2
r2:
$(SHELL) run_tests.sh t.tools/r2
keystone:
$(SHELL) run_tests.sh t.extras/keystone
swf:
$(SHELL) run_tests.sh t.extras/swf
m68k-extras:
$(SHELL) run_tests.sh t.extras/m68k
olly-extras:
$(SHELL) run_tests.sh t.extras/x86_olly
dwarf:
$(SHELL) run_tests.sh t.extras/dwarf
broken:
grep BROKEN=1 t -r -l
clean:
rm -rf tmp
symstall:
mkdir -p $(BINDIR)
chmod +x r2-v r2r
ln -fs $(PWD)/r2-v $(BINDIR)/r2-v
ln -fs $(PWD)/r2r $(BINDIR)/r2r
#sed -e 's,@R2RDIR@,$(PWD),g' < $(PWD)/r2-v > $(BINDIR)/r2-v
#sed -e 's,@R2RDIR@,$(PWD),g' < $(PWD)/r2r > $(BINDIR)/r2r
install:
mkdir -p $(BINDIR)
sed -e 's,@R2RDIR@,$(LIBDIR)/radare2-regressions,g' < $(PWD)/r2-v > $(BINDIR)/r2-v
sed -e 's,@R2RDIR@,$(LIBDIR)/radare2-regressions,g' < $(PWD)/r2r > $(BINDIR)/r2r
chmod +x $(BINDIR)/r2-v
chmod +x $(BINDIR)/r2r
mkdir -p $(LIBDIR)/radare2-regressions
cp -rf $(TDIRS) $(LIBDIR)/radare2-regressions
cp -rf *.sh $(LIBDIR)/radare2-regressions
uninstall:
rm -f $(BINDIR)/r2r
rm -f $(BINDIR)/r2-v
rm -rf $(LIBDIR)/radare2-regressions
unit_tests:
@make -C ./unit all
@./run_unit.sh
tested:
@grep -re FILE= t* | cut -d : -f 2- | sed -e 's/^.*bins\///g' |sort -u | grep -v FILE
untested:
@${MAKE} -s tested > .a
@${MAKE} -s allbins > .b
@diff -ru .a .b | grep ^+ | grep -v +++ | cut -c 2-
@rm -f .a .b
js-tests:
cd new && npm install
cd new && node bin/r2r.js
allbins:
find bins -type f
dist:
git clone . $(PKG)-$(VERSION)
rm -rf $(PKG)-$(VERSION)/.git
$(TAR) "$(PKG)-${VERSION}.tar" "$(PKG)-$(VERSION)"
${CZ} "$(PKG)-${VERSION}.tar"
.PHONY: all clean allbins dist