2012-02-18 01:49:59 +01:00
|
|
|
-include config-user.mk
|
2010-01-15 01:32:28 +01:00
|
|
|
include global.mk
|
2009-03-05 13:15:28 +01:00
|
|
|
|
2012-02-17 13:55:54 +01:00
|
|
|
STRIP?=strip
|
2011-07-21 00:50:16 +02:00
|
|
|
ifneq ($(shell bsdtar -h 2>/dev/null|grep bsdtar),)
|
|
|
|
TAR=bsdtar czvf
|
2011-07-19 00:12:36 +02:00
|
|
|
else
|
|
|
|
TAR=tar -czvf
|
|
|
|
endif
|
2011-05-15 04:31:08 +02:00
|
|
|
PWD=$(shell pwd)
|
2010-10-29 03:38:43 +02:00
|
|
|
REMOTE=radare.org:/srv/http/radareorg/get/beta
|
|
|
|
|
2010-10-29 03:10:10 +02:00
|
|
|
all: plugins.cfg
|
|
|
|
${MAKE} libr
|
|
|
|
${MAKE} binr
|
2010-01-13 23:42:49 +01:00
|
|
|
|
|
|
|
plugins.cfg:
|
2011-05-16 01:47:01 +02:00
|
|
|
@if [ ! -e config-user.mk ]; then echo ; \
|
|
|
|
echo " Please, run ./configure first" ; echo ; exit 1 ; fi
|
2010-01-13 23:42:49 +01:00
|
|
|
./configure-plugins
|
2010-01-12 19:57:33 +01:00
|
|
|
|
2011-07-15 12:48:46 +02:00
|
|
|
gitpush:
|
|
|
|
sh mk/gitpush.sh
|
|
|
|
|
2012-08-02 01:50:39 +02:00
|
|
|
.PHONY: todo
|
|
|
|
todo:
|
|
|
|
grep -re TODO:0.9.2 libr binr
|
|
|
|
|
2012-08-10 11:35:38 +02:00
|
|
|
farm:
|
|
|
|
./sys/farm/run.sh
|
|
|
|
|
2010-01-12 19:57:33 +01:00
|
|
|
libr:
|
2009-07-16 00:30:20 +00:00
|
|
|
cd libr && ${MAKE} all
|
2009-02-05 22:08:46 +01:00
|
|
|
|
2010-05-28 17:15:20 +02:00
|
|
|
binr:
|
|
|
|
cd binr && ${MAKE} all
|
|
|
|
|
2010-10-18 01:51:00 +02:00
|
|
|
w32:
|
2010-10-29 03:38:43 +02:00
|
|
|
make clean
|
2010-10-18 01:51:00 +02:00
|
|
|
# TODO: add support for debian
|
2010-10-28 14:11:19 +02:00
|
|
|
./configure --without-ssl --without-gmp --with-compiler=i486-mingw32-gcc --with-ostype=windows --host=i486-unknown-windows
|
2010-10-18 01:51:00 +02:00
|
|
|
make
|
|
|
|
|
2010-01-15 17:02:04 +01:00
|
|
|
w32dist:
|
2010-04-12 02:22:52 +02:00
|
|
|
rm -rf radare2-w32-${VERSION} w32dist
|
2010-01-15 17:02:04 +01:00
|
|
|
mkdir w32dist
|
2011-09-23 12:25:06 +02: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
|
2010-06-28 02:12:35 +02:00
|
|
|
rm w32dist/plugin.dll
|
2011-11-29 18:31:26 +01:00
|
|
|
mkdir -p w32dist/radare2/${VERSION}/magic
|
|
|
|
cp -f libr/magic/d/default/* w32dist/radare2/${VERSION}/magic
|
2011-10-24 12:07:12 +02:00
|
|
|
mkdir -p w32dist/radare2/${VERSION}/syscall
|
|
|
|
cp -f libr/syscall/d/*.sdb w32dist/radare2/${VERSION}/syscall
|
2011-11-12 01:52:31 +01:00
|
|
|
mkdir -p w32dist/radare2/${VERSION}/opcodes
|
|
|
|
cp -f libr/asm/d/*.sdb w32dist/radare2/${VERSION}/opcodes
|
2011-10-24 12:07:12 +02:00
|
|
|
mkdir -p w32dist/share/doc/radare2
|
2011-11-29 03:14:27 +01:00
|
|
|
mkdir -p w32dist/include/libr
|
|
|
|
cp libr/include/*.h w32dist/include/libr
|
|
|
|
#mkdir -p w32dist/include/libr/sflib
|
2011-10-24 12:07:12 +02:00
|
|
|
cp -f doc/fortunes w32dist/share/doc/radare2
|
2010-01-15 17:02:04 +01:00
|
|
|
mv w32dist radare2-w32-${VERSION}
|
2011-10-12 03:24:19 +02:00
|
|
|
rm -f radare2-w32-${VERSION}.zip
|
2010-01-15 17:02:04 +01:00
|
|
|
zip -r radare2-w32-${VERSION}.zip radare2-w32-${VERSION}
|
|
|
|
|
2010-10-29 03:38:43 +02:00
|
|
|
w32beta: w32dist
|
|
|
|
scp radare2-w32-${VERSION}.zip ${REMOTE}
|
2011-05-18 01:35:52 +02:00
|
|
|
cd r2-bindings ; $(MAKE) w32dist
|
|
|
|
scp radare2-bindings-w32-${VERSION}.zip ${REMOTE}
|
2010-10-29 03:38:43 +02:00
|
|
|
|
2010-01-13 23:42:49 +01:00
|
|
|
clean:
|
2010-01-22 14:19:10 +01:00
|
|
|
cd libr && ${MAKE} clean
|
2010-06-14 18:29:52 +02:00
|
|
|
cd binr && ${MAKE} clean
|
2012-08-06 14:25:31 +02:00
|
|
|
cd shlr && ${MAKE} clean
|
2010-01-13 23:42:49 +01:00
|
|
|
|
2010-07-13 11:59:55 +02:00
|
|
|
mrproper:
|
2010-01-22 14:19:10 +01:00
|
|
|
cd libr && ${MAKE} mrproper
|
2010-06-14 18:29:52 +02:00
|
|
|
cd binr && ${MAKE} mrproper
|
2012-08-10 11:35:38 +02:00
|
|
|
cd shlr && ${MAKE} mrproper
|
2010-06-15 14:10:42 +02:00
|
|
|
rm -f config-user.mk plugins.cfg libr/config.h libr/include/r_userconf.h libr/config.mk
|
|
|
|
rm -f pkgcfg/*.pc
|
2009-06-15 02:44:05 +00:00
|
|
|
|
2011-03-02 12:33:28 +01:00
|
|
|
mrpopper:
|
|
|
|
@echo 8====================D
|
|
|
|
|
2009-07-16 00:30:20 +00:00
|
|
|
pkgcfg:
|
2010-01-22 14:19:10 +01:00
|
|
|
cd libr && ${MAKE} pkgcfg
|
2009-07-16 00:30:20 +00:00
|
|
|
|
2010-03-12 18:46:11 +01:00
|
|
|
install-man:
|
2011-07-03 13:06:16 +02: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 17:52:30 +02:00
|
|
|
|
|
|
|
install-man-symlink:
|
2011-07-03 13:06:16 +02:00
|
|
|
mkdir -p ${MDR}/man1
|
2011-07-13 11:30:25 +02:00
|
|
|
cd man && for a in *.1 ; do ln -fs ${PWD}/man/$$a ${MDR}/man1/$$a ; done
|
2011-07-03 13:06:16 +02:00
|
|
|
cd ${MDR}/man1 && ln -fs radare2.1 r2.1
|
2010-03-12 18:46:11 +01:00
|
|
|
|
2011-02-17 01:22:15 +01:00
|
|
|
install-doc:
|
2011-03-13 20:27:28 +01:00
|
|
|
${INSTALL_DIR} ${PFX}/share/doc/radare2
|
|
|
|
for a in doc/* ; do ${INSTALL_DATA} $$a ${PFX}/share/doc/radare2 ; done
|
2011-02-17 01:22:15 +01:00
|
|
|
|
|
|
|
install-doc-symlink:
|
2011-03-13 20:27:28 +01:00
|
|
|
${INSTALL_DIR} ${PFX}/share/doc/radare2
|
2012-02-14 18:10:01 +01:00
|
|
|
cd doc ; for a in * ; do ln -fs ${PWD}/doc/$$a ${PFX}/share/doc/radare2 ; done
|
2011-02-17 01:22:15 +01:00
|
|
|
|
2011-12-01 15:37:47 +01:00
|
|
|
DATADIRS=libr/asm/d libr/syscall/d libr/magic/d
|
|
|
|
#binr/ragg2/d
|
2011-02-17 01:22:15 +01:00
|
|
|
install: install-doc install-man
|
2010-02-21 20:21:36 +01:00
|
|
|
cd libr && ${MAKE} install PARENT=1 PREFIX=${PREFIX} DESTDIR=${DESTDIR}
|
2010-05-29 03:30:36 +02:00
|
|
|
cd binr && ${MAKE} install PREFIX=${PREFIX} DESTDIR=${DESTDIR}
|
2011-11-29 03:14:27 +01:00
|
|
|
for a in ${DATADIRS} ; do \
|
|
|
|
(cd $$a ; ${MAKE} install LIBDIR=${LIBDIR} PREFIX=${PREFIX} DESTDIR=${DESTDIR} ); \
|
|
|
|
done
|
2012-02-01 02:22:43 +01:00
|
|
|
mkdir -p ${DESTDIR}/${LIBDIR}/radare2/${VERSION}/hud
|
|
|
|
cp -f libr/core/hud/main ${DESTDIR}/${LIBDIR}/radare2/${VERSION}/hud/
|
2009-02-05 22:28:33 +01:00
|
|
|
|
2011-02-27 21:56:13 +01:00
|
|
|
install-pkgconfig-symlink:
|
2011-07-19 11:25:11 +02:00
|
|
|
@${INSTALL_DIR} ${DESTDIR}/${LIBDIR}/pkgconfig
|
|
|
|
cd pkgcfg ; for a in *.pc ; do ln -fs $${PWD}/$$a ${DESTDIR}/${LIBDIR}/pkgconfig/$$a ; done
|
2011-02-27 21:56:13 +01:00
|
|
|
|
|
|
|
symstall install-symlink: install-man-symlink install-doc-symlink install-pkgconfig-symlink
|
2010-05-24 17:51:51 +02:00
|
|
|
cd libr && ${MAKE} install-symlink PREFIX=${PREFIX} DESTDIR=${DESTDIR}
|
2010-06-15 13:10:46 +02:00
|
|
|
cd binr && ${MAKE} install-symlink PREFIX=${PREFIX} DESTDIR=${DESTDIR}
|
2011-11-29 03:14:27 +01:00
|
|
|
for a in ${DATADIRS} ; do \
|
|
|
|
(cd $$a ; echo $$a ; ${MAKE} install-symlink LIBDIR=${LIBDIR} PREFIX=${PREFIX} DESTDIR=${DESTDIR} ); \
|
|
|
|
done
|
2012-01-31 02:45:17 +01:00
|
|
|
mkdir -p ${DESTDIR}/${LIBDIR}/radare2/${VERSION}/hud
|
|
|
|
ln -fs ${PWD}/libr/core/hud/main ${DESTDIR}/${LIBDIR}/radare2/${VERSION}/hud/main
|
2010-05-24 17:51:51 +02:00
|
|
|
|
2011-03-28 10:24:01 +02:00
|
|
|
deinstall uninstall:
|
2010-02-21 20:21:36 +01:00
|
|
|
cd libr && ${MAKE} uninstall PARENT=1 PREFIX=${PREFIX} DESTDIR=${DESTDIR}
|
2010-06-15 13:10:46 +02:00
|
|
|
cd binr && ${MAKE} uninstall PARENT=1 PREFIX=${PREFIX} DESTDIR=${DESTDIR}
|
2011-10-14 10:09:53 +02:00
|
|
|
cd libr/syscall/d && ${MAKE} uninstall PARENT=1 PREFIX=${PREFIX} DESTDIR=${DESTDIR} LIBDIR=${LIBDIR}
|
2011-03-28 10:24:01 +02:00
|
|
|
@echo
|
|
|
|
@echo "Run 'make purge' to also remove installed files from previous versions of r2"
|
|
|
|
@echo
|
|
|
|
|
2012-02-17 13:23:58 +01: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
|
|
|
|
|
2012-08-06 17:34:01 +02:00
|
|
|
R2BINS=$(shell cd binr ; echo r*2)
|
2012-02-17 13:23:58 +01:00
|
|
|
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 17:34:01 +02: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 13:23:58 +01:00
|
|
|
|
|
|
|
purge: purge-doc purge-dev
|
2012-08-06 17:34:01 +02:00
|
|
|
for a in ${R2BINS} ; do rm -f ${DESTDIR}/${BINDIR}/$$a ; done
|
2011-11-26 05:14:03 +01:00
|
|
|
rm -f ${DESTDIR}/${BINDIR}/ragg2-cc
|
2011-11-02 02:01:24 +01:00
|
|
|
rm -f ${DESTDIR}/${LIBDIR}/libr_*
|
2011-07-19 11:25:11 +02:00
|
|
|
rm -rf ${DESTDIR}/${LIBDIR}/radare2
|
|
|
|
rm -rf ${DESTDIR}/${INCLUDEDIR}/libr
|
2009-03-06 00:38:23 +00:00
|
|
|
|
2011-05-18 01:35:52 +02:00
|
|
|
beta: dist r2-bindings-dist
|
2010-10-28 03:30:15 +02:00
|
|
|
scp ../radare2-${VERSION}.tar.gz ${REMOTE}
|
2011-07-19 11:25:11 +02:00
|
|
|
scp r2-bindings-${VERSION}.tar.gz ${REMOTE}
|
2010-10-28 03:30:15 +02:00
|
|
|
|
2011-10-24 11:38:33 +02:00
|
|
|
version:
|
|
|
|
@echo ${VERSION}
|
|
|
|
|
2011-05-18 01:35:52 +02:00
|
|
|
r2-bindings-dist:
|
|
|
|
cd r2-bindings && ${MAKE} dist
|
2010-03-14 19:36:44 +01:00
|
|
|
|
2009-03-05 13:15:28 +01:00
|
|
|
dist:
|
2012-08-13 18:06:24 +02:00
|
|
|
git log $$(git show-ref `git tag |tail -n1`)..HEAD > ChangeLog
|
2009-04-25 19:43:47 +00:00
|
|
|
VERSION=${VERSION} ; \
|
2012-08-14 01:48:39 +02:00
|
|
|
FILES=`git ls-files | sed -e s,^,radare2-${VERSION}/,` ; \
|
2009-03-05 13:15:28 +01:00
|
|
|
cd .. && mv radare2 radare2-${VERSION} && \
|
2012-08-13 18:06:24 +02:00
|
|
|
${TAR} radare2-${VERSION}.tar.gz $${FILES} radare2-${VERSION}/ChangeLog ;\
|
2009-03-05 13:15:28 +01:00
|
|
|
mv radare2-${VERSION} radare2
|
2010-10-28 03:30:15 +02:00
|
|
|
|
|
|
|
pub:
|
|
|
|
scp ../radare2-${VERSION}.tar.gz radare.org:/srv/http/radareorg/get
|
2009-04-25 11:29:39 +00:00
|
|
|
|
|
|
|
shot:
|
|
|
|
DATE=`date '+%Y%m%d'` ; \
|
2012-08-13 18:06:24 +02:00
|
|
|
FILES=`git ls-files | sed -e s,^,radare2-${DATE}/,` ; \
|
2009-04-25 11:29:39 +00:00
|
|
|
cd .. && mv radare2 radare2-$${DATE} && \
|
2011-07-19 00:12:36 +02:00
|
|
|
${TAR} radare2-$${DATE}.tar.gz $${FILES} ;\
|
2009-04-25 11:29:39 +00:00
|
|
|
mv radare2-$${DATE} radare2 && \
|
2009-09-25 04:13:40 +02:00
|
|
|
scp radare2-$${DATE}.tar.gz radare.org:/srv/http/radareorg/get/shot
|
2009-08-22 01:54:24 +00:00
|
|
|
|
2012-02-03 16:28:52 +01:00
|
|
|
# TODO: test/ must be removed
|
|
|
|
.PHONY: test tests
|
|
|
|
test tests:
|
|
|
|
if [ -d r2-regressions ]; then \
|
|
|
|
cd r2-regressions ; git pull ; \
|
|
|
|
else \
|
|
|
|
git clone git://github.com/vext01/r2-regressions.git ; \
|
|
|
|
fi
|
|
|
|
cd r2-regressions ; ${MAKE}
|
|
|
|
|
2009-08-22 01:54:24 +00:00
|
|
|
include ${MKPLUGINS}
|
2009-03-05 13:15:28 +01:00
|
|
|
|
2011-10-24 11:38:33 +02:00
|
|
|
.PHONY: all clean mrproper install symstall uninstall deinstall dist shot pkgcfg
|
2012-08-10 15:59:37 +02:00
|
|
|
.PHONY: r2-bindings r2-bindings-dist libr binr install-man version w32dist
|