forked from radareorg/radare2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (40 loc) · 1.06 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
include ../../config-user.mk
include ../../libr/config.mk
CFLAGS+=-g -Wall
PFX=${DESTDIR}${PREFIX}
OBJS=rarc2.o emit_x86.o emit_x64.o emit_arm.o out.o
all: config.h rarc2${EXT_EXE}
config.h:
cp -f config.def.h config.h
rarc2${EXT_EXE}: ${OBJS}
${CC} ${LDFLAGS} -I. ${OBJS} -o rarc2${EXT_EXE}
osx:
./rarc2 -ax86 osxtest.r > osxtest.asm
rasm2 -a x86.olly -f osxtest.asm > osxtest.hex
rabin2 -c mach0:$(shell cat osxtest.hex) osxtest
test:
# only works with att mode
./rarc2 t/hello.r > t/hello.S
gcc t/hello.S -o t/hello
# cat t/hello.S
t/hello
#spp test.r | ./rarc2
#./rarc2 test.r
install:
chmod +x rarc2
mkdir -p ${PFX}/bin
cp rarc2 ${PFX}/bin
chmod +x rarc2-tool
cp rarc2-tool ${PFX}/bin
install-symlink:
mkdir -p ${PFX}/bin
ln -fs ${PWD}/rarc2 ${PFX}/bin/rarc2
ln -fs ${PWD}/rarc2-tool ${PFX}/bin/rarc2-tool
deinstall uninstall:
rm -f ${PFX}/bin/rarc2 ${PFX}/bin/rarc2-tool
clean:
cd t && ${MAKE} clean
-rm -f rarc2 rarc2.o out.o emit*.o
mrproper: clean
-rm -f config.h
.PHONY: all clean install install-symlink deinstall uninstall test mrproper