2012-02-18 08:49:59 +08:00
|
|
|
-include config-user.mk
|
2010-01-15 08:32:28 +08:00
|
|
|
include global.mk
|
2009-03-05 20:15:28 +08:00
|
|
|
|
2012-10-03 20:31:35 +08:00
|
|
|
DLIBDIR=$(DESTDIR)/$(LIBDIR)
|
|
|
|
R2BINS=$(shell cd binr ; echo r*2)
|
2013-07-17 09:51:53 +08:00
|
|
|
DATADIRS=libr/cons/d libr/asm/d libr/syscall/d libr/magic/d
|
2012-10-03 20:31:35 +08:00
|
|
|
#binr/ragg2/d
|
2012-02-17 20:55:54 +08:00
|
|
|
STRIP?=strip
|
2013-07-08 05:03:10 +08:00
|
|
|
#ifneq ($(shell bsdtar -h 2>/dev/null|grep bsdtar),)
|
|
|
|
ifneq ($(shell xz --help 2>/dev/null|grep improve),)
|
|
|
|
TAR=tar -cvf
|
|
|
|
TAREXT=tar.xz
|
|
|
|
CZ=xz -f
|
2011-07-19 06:12:36 +08:00
|
|
|
else
|
2013-07-08 05:03:10 +08:00
|
|
|
TAR=bsdtar cvf
|
|
|
|
TAREXT=tar.gz
|
|
|
|
CZ=gzip -f
|
2011-07-19 06:12:36 +08:00
|
|
|
endif
|
2011-05-15 10:31:08 +08:00
|
|
|
PWD=$(shell pwd)
|
2010-10-29 09:38:43 +08:00
|
|
|
|
2010-10-29 09:10:10 +08:00
|
|
|
all: plugins.cfg
|
2013-06-25 23:35:36 +08:00
|
|
|
${MAKE} -C libr/util
|
2013-05-01 07:29:06 +08:00
|
|
|
${MAKE} -C shlr
|
|
|
|
${MAKE} -C libr
|
|
|
|
${MAKE} -C binr
|
2010-01-14 06:42:49 +08:00
|
|
|
|
|
|
|
plugins.cfg:
|
2011-05-16 07:47:01 +08:00
|
|
|
@if [ ! -e config-user.mk ]; then echo ; \
|
|
|
|
echo " Please, run ./configure first" ; echo ; exit 1 ; fi
|
2010-01-14 06:42:49 +08:00
|
|
|
./configure-plugins
|
2010-01-13 02:57:33 +08:00
|
|
|
|
2010-10-18 07:51:00 +08:00
|
|
|
w32:
|
2013-07-04 09:34:28 +08:00
|
|
|
sys/mingw32.sh
|
2010-10-18 07:51:00 +08:00
|
|
|
|
2012-09-03 07:27:52 +08:00
|
|
|
.PHONY: depgraph.png
|
|
|
|
depgraph.png:
|
|
|
|
cd libr ; perl depgraph.pl | dot -Tpng -odepgraph.png
|
|
|
|
|
|
|
|
android:
|
|
|
|
@if [ -z "$(NDK_ARCH)" ]; then echo "Set NDK_ARCH=[arm|mips|x86]" ; false; fi
|
|
|
|
sys/android-${NDK_ARCH}.sh
|
|
|
|
|
2010-01-16 00:02:04 +08:00
|
|
|
w32dist:
|
2010-04-12 08:22:52 +08:00
|
|
|
rm -rf radare2-w32-${VERSION} w32dist
|
2010-01-16 00:02:04 +08:00
|
|
|
mkdir w32dist
|
2011-09-23 18:25:06 +08:00
|
|
|
for a in `find libr | grep -e dll$$`; do cp $$a w32dist ; done
|
|
|
|
for a in `find binr | grep -e exe$$`; do cp $$a w32dist ; done
|
2013-01-23 21:50:50 +08:00
|
|
|
rm -f w32dist/plugin.dll
|
2011-11-30 01:31:26 +08:00
|
|
|
mkdir -p w32dist/radare2/${VERSION}/magic
|
|
|
|
cp -f libr/magic/d/default/* w32dist/radare2/${VERSION}/magic
|
2011-10-24 18:07:12 +08:00
|
|
|
mkdir -p w32dist/radare2/${VERSION}/syscall
|
|
|
|
cp -f libr/syscall/d/*.sdb w32dist/radare2/${VERSION}/syscall
|
2011-11-12 08:52:31 +08:00
|
|
|
mkdir -p w32dist/radare2/${VERSION}/opcodes
|
|
|
|
cp -f libr/asm/d/*.sdb w32dist/radare2/${VERSION}/opcodes
|
2011-10-24 18:07:12 +08:00
|
|
|
mkdir -p w32dist/share/doc/radare2
|
2011-11-29 10:14:27 +08:00
|
|
|
mkdir -p w32dist/include/libr
|
|
|
|
cp libr/include/*.h w32dist/include/libr
|
|
|
|
#mkdir -p w32dist/include/libr/sflib
|
2011-10-24 18:07:12 +08:00
|
|
|
cp -f doc/fortunes w32dist/share/doc/radare2
|
2010-01-16 00:02:04 +08:00
|
|
|
mv w32dist radare2-w32-${VERSION}
|
2011-10-12 09:24:19 +08:00
|
|
|
rm -f radare2-w32-${VERSION}.zip
|
2010-01-16 00:02:04 +08:00
|
|
|
zip -r radare2-w32-${VERSION}.zip radare2-w32-${VERSION}
|
|
|
|
|
2010-01-14 06:42:49 +08:00
|
|
|
clean:
|
2013-04-26 09:15:39 +08:00
|
|
|
for a in shlr libr binr ; do (cd $$a ; ${MAKE} clean) ; done
|
2010-01-14 06:42:49 +08:00
|
|
|
|
2013-01-23 08:53:32 +08:00
|
|
|
distclean mrproper:
|
2012-09-04 08:09:01 +08:00
|
|
|
for a in libr binr shlr ; do ( cd $$a ; ${MAKE} mrproper) ; done
|
2012-09-04 07:46:12 +08:00
|
|
|
rm -f config-user.mk plugins.cfg libr/config.h
|
|
|
|
rm -f libr/include/r_userconf.h libr/config.mk
|
2010-06-15 20:10:42 +08:00
|
|
|
rm -f pkgcfg/*.pc
|
2009-06-15 10:44:05 +08:00
|
|
|
|
2009-07-16 08:30:20 +08:00
|
|
|
pkgcfg:
|
2010-01-22 21:19:10 +08:00
|
|
|
cd libr && ${MAKE} pkgcfg
|
2009-07-16 08:30:20 +08:00
|
|
|
|
2010-03-13 01:46:11 +08:00
|
|
|
install-man:
|
2011-07-03 19:06:16 +08:00
|
|
|
mkdir -p ${MDR}/man1
|
|
|
|
for a in man/*.1 ; do ${INSTALL_MAN} $$a ${MDR}/man1 ; done
|
|
|
|
cd ${MDR}/man1 && ln -fs radare2.1 r2.1
|
2010-06-18 23:52:30 +08:00
|
|
|
|
|
|
|
install-man-symlink:
|
2011-07-03 19:06:16 +08:00
|
|
|
mkdir -p ${MDR}/man1
|
2011-07-13 17:30:25 +08:00
|
|
|
cd man && for a in *.1 ; do ln -fs ${PWD}/man/$$a ${MDR}/man1/$$a ; done
|
2011-07-03 19:06:16 +08:00
|
|
|
cd ${MDR}/man1 && ln -fs radare2.1 r2.1
|
2010-03-13 01:46:11 +08:00
|
|
|
|
2011-02-17 08:22:15 +08:00
|
|
|
install-doc:
|
2011-03-14 03:27:28 +08:00
|
|
|
${INSTALL_DIR} ${PFX}/share/doc/radare2
|
|
|
|
for a in doc/* ; do ${INSTALL_DATA} $$a ${PFX}/share/doc/radare2 ; done
|
2011-02-17 08:22:15 +08:00
|
|
|
|
|
|
|
install-doc-symlink:
|
2011-03-14 03:27:28 +08:00
|
|
|
${INSTALL_DIR} ${PFX}/share/doc/radare2
|
2013-04-19 05:11:12 +08:00
|
|
|
cd doc ; for a in * ; do \
|
|
|
|
ln -fs ${PWD}/doc/$$a ${PFX}/share/doc/radare2 ; done
|
2011-02-17 08:22:15 +08:00
|
|
|
|
2012-09-06 09:12:54 +08:00
|
|
|
install: install-doc install-man install-www
|
2010-02-22 03:21:36 +08:00
|
|
|
cd libr && ${MAKE} install PARENT=1 PREFIX=${PREFIX} DESTDIR=${DESTDIR}
|
2010-05-29 09:30:36 +08:00
|
|
|
cd binr && ${MAKE} install PREFIX=${PREFIX} DESTDIR=${DESTDIR}
|
2013-06-05 15:29:27 +08:00
|
|
|
cd shlr && ${MAKE} install PREFIX=${PREFIX} DESTDIR=${DESTDIR}
|
2011-11-29 10:14:27 +08:00
|
|
|
for a in ${DATADIRS} ; do \
|
|
|
|
(cd $$a ; ${MAKE} install LIBDIR=${LIBDIR} PREFIX=${PREFIX} DESTDIR=${DESTDIR} ); \
|
|
|
|
done
|
2013-06-30 06:31:26 +08:00
|
|
|
mkdir -p ${DLIBDIR}/radare2/${VERSION}/hud
|
2013-07-24 14:57:20 +08:00
|
|
|
cp -f doc/hud ${DLIBDIR}/radare2/${VERSION}/hud/main
|
2013-06-30 06:31:26 +08:00
|
|
|
cp ${PWD}/libr/lang/p/radare.lua ${DLIBDIR}/radare2/${VERSION}/radare.lua
|
2013-06-17 07:39:49 +08:00
|
|
|
sys/ldconfig.sh
|
2009-02-06 05:28:33 +08:00
|
|
|
|
2012-09-06 09:12:54 +08:00
|
|
|
install-www:
|
|
|
|
rm -rf ${DESTDIR}/${WWWROOT}
|
2013-04-19 05:11:12 +08:00
|
|
|
rm -rf ${DLIBDIR}/radare2/${VERSION}/www # old dir
|
2012-09-06 09:12:54 +08:00
|
|
|
mkdir -p ${DESTDIR}/${WWWROOT}
|
|
|
|
cp -rf shlr/www/* ${DESTDIR}/${WWWROOT}
|
|
|
|
|
|
|
|
symstall-www:
|
|
|
|
rm -rf ${DESTDIR}/${WWWROOT}
|
2013-04-19 05:11:12 +08:00
|
|
|
rm -rf ${DLIBDIR}/radare2/${VERSION}/www # old dir
|
2012-09-06 09:12:54 +08:00
|
|
|
mkdir -p ${DESTDIR}/${WWWROOT}
|
|
|
|
cd ${DESTDIR}/${WWWROOT} ; for a in ${PWD}/shlr/www/* ; do \
|
2013-04-19 05:11:12 +08:00
|
|
|
ln -fs $$a ${DESTDIR}/${DATADIR}/radare2/${VERSION}/www ; done
|
2012-09-06 09:12:54 +08:00
|
|
|
|
2011-02-28 04:56:13 +08:00
|
|
|
install-pkgconfig-symlink:
|
2012-09-04 07:46:12 +08:00
|
|
|
@${INSTALL_DIR} ${DLIBDIR}/pkgconfig
|
|
|
|
cd pkgcfg ; for a in *.pc ; do ln -fs $${PWD}/$$a ${DLIBDIR}/pkgconfig/$$a ; done
|
2011-02-28 04:56:13 +08:00
|
|
|
|
2012-09-06 09:12:54 +08:00
|
|
|
symstall install-symlink: install-man-symlink install-doc-symlink install-pkgconfig-symlink symstall-www
|
2010-05-24 23:51:51 +08:00
|
|
|
cd libr && ${MAKE} install-symlink PREFIX=${PREFIX} DESTDIR=${DESTDIR}
|
2010-06-15 19:10:46 +08:00
|
|
|
cd binr && ${MAKE} install-symlink PREFIX=${PREFIX} DESTDIR=${DESTDIR}
|
2013-06-05 15:29:27 +08:00
|
|
|
cd shlr && ${MAKE} install-symlink PREFIX=${PREFIX} DESTDIR=${DESTDIR}
|
2012-09-04 07:46:12 +08:00
|
|
|
for a in ${DATADIRS} ; do (\
|
|
|
|
cd $$a ; \
|
|
|
|
echo $$a ; \
|
|
|
|
${MAKE} install-symlink LIBDIR=${LIBDIR} PREFIX=${PREFIX} DESTDIR=${DESTDIR} ); \
|
2011-11-29 10:14:27 +08:00
|
|
|
done
|
2012-09-04 07:46:12 +08:00
|
|
|
mkdir -p ${DLIBDIR}/radare2/${VERSION}/hud
|
2013-07-24 14:57:20 +08:00
|
|
|
ln -fs ${PWD}/doc/hud ${DLIBDIR}/radare2/${VERSION}/hud/main
|
2013-06-30 06:31:26 +08:00
|
|
|
ln -fs ${PWD}/libr/lang/p/radare.lua ${DLIBDIR}/radare2/${VERSION}/radare.lua
|
2013-06-17 07:39:49 +08:00
|
|
|
sys/ldconfig.sh
|
2010-05-24 23:51:51 +08:00
|
|
|
|
2011-03-28 16:24:01 +08:00
|
|
|
deinstall uninstall:
|
2010-02-22 03:21:36 +08:00
|
|
|
cd libr && ${MAKE} uninstall PARENT=1 PREFIX=${PREFIX} DESTDIR=${DESTDIR}
|
2010-06-15 19:10:46 +08:00
|
|
|
cd binr && ${MAKE} uninstall PARENT=1 PREFIX=${PREFIX} DESTDIR=${DESTDIR}
|
2013-06-05 15:29:27 +08:00
|
|
|
cd shlr && ${MAKE} uninstall PARENT=1 PREFIX=${PREFIX} DESTDIR=${DESTDIR}
|
2011-10-14 16:09:53 +08:00
|
|
|
cd libr/syscall/d && ${MAKE} uninstall PARENT=1 PREFIX=${PREFIX} DESTDIR=${DESTDIR} LIBDIR=${LIBDIR}
|
2011-03-28 16:24:01 +08:00
|
|
|
@echo
|
|
|
|
@echo "Run 'make purge' to also remove installed files from previous versions of r2"
|
|
|
|
@echo
|
|
|
|
|
2012-02-17 20:23:58 +08:00
|
|
|
purge-doc:
|
|
|
|
rm -rf ${DESTDIR}/${PREFIX}/share/doc/radare2
|
|
|
|
cd man ; for a in *.1 ; do rm -f ${MDR}/man1/$$a ; done
|
|
|
|
rm -f ${MDR}/man1/r2.1
|
|
|
|
|
|
|
|
purge-dev:
|
|
|
|
rm -rf ${DESTDIR}/${LIBDIR}/libr_*.a
|
|
|
|
rm -rf ${DESTDIR}/${LIBDIR}/pkgconfig/r_*.pc
|
|
|
|
rm -rf ${DESTDIR}/${INCLUDEDIR}/libr
|
|
|
|
rm -f ${DESTDIR}/${LIBDIR}/radare2/${VERSION}/-*
|
|
|
|
# XXX: this must be in purge-sym ?
|
2012-08-06 23:34:01 +08:00
|
|
|
-for a in ${R2BINS} ; do ${STRIP} -s ${DESTDIR}/${BINDIR}/$$a 2> /dev/null ; done
|
|
|
|
-for a in ${DESTDIR}/${LIBDIR}/libr_*.so ; do ${STRIP} -s $$a ; done
|
2012-02-17 20:23:58 +08:00
|
|
|
|
|
|
|
purge: purge-doc purge-dev
|
2012-08-06 23:34:01 +08:00
|
|
|
for a in ${R2BINS} ; do rm -f ${DESTDIR}/${BINDIR}/$$a ; done
|
2011-11-26 12:14:03 +08:00
|
|
|
rm -f ${DESTDIR}/${BINDIR}/ragg2-cc
|
2011-11-02 09:01:24 +08:00
|
|
|
rm -f ${DESTDIR}/${LIBDIR}/libr_*
|
2011-07-19 17:25:11 +08:00
|
|
|
rm -rf ${DESTDIR}/${LIBDIR}/radare2
|
|
|
|
rm -rf ${DESTDIR}/${INCLUDEDIR}/libr
|
2009-03-06 08:38:23 +08:00
|
|
|
|
2009-03-05 20:15:28 +08:00
|
|
|
dist:
|
2012-08-14 00:06:24 +08:00
|
|
|
git log $$(git show-ref `git tag |tail -n1`)..HEAD > ChangeLog
|
2012-09-04 07:46:12 +08:00
|
|
|
DIR=`basename $$PWD` ; \
|
2012-08-14 07:48:39 +08:00
|
|
|
FILES=`git ls-files | sed -e s,^,radare2-${VERSION}/,` ; \
|
2012-09-04 07:46:12 +08:00
|
|
|
cd .. && mv $${DIR} radare2-${VERSION} && \
|
2013-07-08 05:03:10 +08:00
|
|
|
${TAR} radare2-${VERSION}.tar $${FILES} radare2-${VERSION}/ChangeLog ;\
|
|
|
|
${CZ} radare2-${VERSION}.tar ; \
|
2012-09-04 07:46:12 +08:00
|
|
|
mv radare2-${VERSION} $${DIR}
|
2009-04-25 19:29:39 +08:00
|
|
|
|
|
|
|
shot:
|
|
|
|
DATE=`date '+%Y%m%d'` ; \
|
2012-08-14 00:06:24 +08:00
|
|
|
FILES=`git ls-files | sed -e s,^,radare2-${DATE}/,` ; \
|
2009-04-25 19:29:39 +08:00
|
|
|
cd .. && mv radare2 radare2-$${DATE} && \
|
2013-07-08 05:03:10 +08:00
|
|
|
${TAR} radare2-$${DATE}.tar $${FILES} ;\
|
|
|
|
${CZ} radare2-$${DATE}.tar ;\
|
2009-04-25 19:29:39 +08:00
|
|
|
mv radare2-$${DATE} radare2 && \
|
2013-07-08 05:03:10 +08:00
|
|
|
scp radare2-$${DATE}.${TAREXT} \
|
|
|
|
radare.org:/srv/http/radareorg/get/shot
|
2009-08-22 09:54:24 +08:00
|
|
|
|
2012-09-04 07:46:12 +08:00
|
|
|
tests:
|
2012-08-28 23:50:49 +08:00
|
|
|
@if [ -d r2-regressions ]; then \
|
2012-10-03 20:31:35 +08:00
|
|
|
cd r2-regressions ; git clean -xdf ; git pull ; \
|
2012-02-03 23:28:52 +08:00
|
|
|
else \
|
|
|
|
git clone git://github.com/vext01/r2-regressions.git ; \
|
|
|
|
fi
|
|
|
|
cd r2-regressions ; ${MAKE}
|
|
|
|
|
2009-08-22 09:54:24 +08:00
|
|
|
include ${MKPLUGINS}
|
2009-03-05 20:15:28 +08:00
|
|
|
|
2013-01-23 08:53:32 +08:00
|
|
|
.PHONY: all clean distclean mrproper install symstall uninstall deinstall dist shot pkgcfg
|
2012-10-03 20:31:35 +08:00
|
|
|
.PHONY: r2-bindings r2-bindings-dist libr binr install-man w32dist tests
|