-
-
Notifications
You must be signed in to change notification settings - Fork 92
/
rules.mk
84 lines (73 loc) · 1.84 KB
/
rules.mk
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
include ../config.mk
include ../libs.mk
ifneq ($(MY_SOEXT),)
SOEXT=${MY_SOEXT}
endif
.SUFFIXES: .$(SOEXT)
all: ${LIBS}
w32:
# TODO: add support for debian
LDFLAGS="-L${W32PY}/libs ${LDFLAGS}" \
CFLAGS="-I../../radare2-w32-${VERSION}/include/libr/ -Wl,--enable-auto-import -L../../radare2-w32-${VERSION} ${CFLAGS}" \
export CC CXX CFLAGS LDFLAGS ; \
${MAKE} CC=${CC} CXX=${CXX}
%.${SOEXT}: ../vapi/%.vapi
ifeq (${LANG},cxx)
mod=`echo $@ | sed -e s,.${SOEXT},,` ; \
echo "MOD=$$mod" ; \
valabind --cxx -N Radare -m $$mod --vapidir=../vapi $$mod && \
${CXX} -shared -fPIC -o $@ $${mod}.cxx `pkg-config --cflags --libs $$mod`
else
ifeq (${LANG},dlang)
mod=`echo $@ | sed -e s,.${SOEXT},,` ; \
echo "MOD=$$mod" ; \
valabind --dlang -N Radare -m $$mod --vapidir=../vapi $$mod
else
ifeq (${LANG},java)
mkdir -p ${R2_JAVA_DIR}
endif
@test ../vapi/`echo $@|sed -e s,.${SOEXT},.vapi,` -nt ${LIBS_PFX}$@ ; \
if [ ! $$? = 0 ]; then \
if [ ! -e ${LIBS_PFX}$@ ]; then \
true ; \
else \
false ; \
fi ; \
fi ; \
if [ $$? = 0 ] ; then \
cd .. ; \
RELEASE=$(RELEASE) sh do-swig.sh ${LANG} `echo $@ | sed -e s,.${SOEXT},,` || exit 1; \
[ "${LANG}`uname`" = pythonDarwin ] && cp _${LIBPFX}$@ _`echo $@|sed -e s,.${SOEXT},.so,` ; \
[ "${LANG}" = java ] && cp $@ lib$@ ; \
true ; \
fi
@echo ... $@
endif
endif
ifneq ($(POSTDEP),)
$(MAKE) $(POSTDEP)
endif
install:
cd .. ; ${MAKE} install-${LANG}
uninstall:
cd .. ; ${MAKE} uninstall-${LANG}
clean:
ifeq (${LANG},java)
rm -rf radare2.jar
rm -rf ${R2_JAVA_DIR}
endif
ifneq ($(SAVED),)
mkdir -p .skip
cp $(SAVED) .skip
endif
rm -f r_*.${SOEXT} _r_*.$(SOEXT)
ifneq ($(SAVED),)
cd .skip ; cp * ..
rm -rf .skip
endif
mrproper: clean
test:
-${LANG} test-r_bp.${LANG_EXT}
-${LANG} test-r_asm.${LANG_EXT}
-${LANG} test-r_hash.${LANG_EXT}
.PHONY: all test clean w32