radare2/libr/Makefile

126 lines
4.3 KiB
Makefile
Raw Normal View History

include ../global.mk
include config.mk
PREFIX?=${PWD}/../prefix
PFX=${DESTDIR}${PREFIX}
PWD=`pwd`
#PREFIX=${PFX}
# Libraries
LIBLIST=util socket cons line lib io lang flags bin hash config syscall cmd
LIBLIST+=reg asm diff anal print parse search bp sign debug fs core
#DEPRECATED APIS : LIBLIST+=th crypto
# sysproxy ... common wat du?
all: libs
libs:
@for lib in ${LIBLIST}; do \
cd $${lib} && ${MAKE} all || exit 1 ; cd .. ; done
@echo Build done for: ${LIBLIST}
pkgcfg:
@for lib in ${LIBLIST}; do ( cd $${lib} && ${MAKE} pkgcfg ); done
# XXX
cd asm && ${MAKE} pkgcfg NAME=libr DEPS="r_`echo ${LIBLIST}|sed -e 's, , r_,g'`"
# TODO: Magically generate libr.pc.acr here using LIBLIST and so :)
install-pkgconfig:
@${INSTALL_DIR} ${PFX}/lib/pkgconfig
for a in ../pkgcfg/*.pc ; do ${INSTALL_DATA} $$a ${PFX}/lib/pkgconfig ; done
install-includes:
@${INSTALL_DIR} ${PFX}/include/libr
(cd include && for a in *.h ; do ${INSTALL_DATA} $$a ${PFX}/include/libr ; done)
install-symlink:
mkdir -p ${PFX}/bin
mkdir -p ${PFX}/include
mkdir -p ${PFX}/lib/pkgconfig
mkdir -p ${PFX}/lib/radare2/${VERSION}
rm -rf ${PFX}/include/libr && ln -fs ${PWD}/include ${PFX}/include/libr
cd ../pkgcfg && for a in *.pc ; do \
if [ -e ${PWD}/../pkgcfg/$${a} ] ; then \
ln -fs ${PWD}/../pkgcfg/$${a} ${PFX}/lib/pkgconfig/$${a} ; \
fi ; \
done
for a in ${LIBLIST} ; do \
ln -fs ${PWD}/$${a}/libr_$${a}.${EXT_SO} ${PFX}/lib/libr_$${a}.${EXT_SO} ; \
ln -fs ${PWD}/$${a}/libr_$${a}.${EXT_SO} ${PFX}/lib/libr_$${a}.${EXT_SO}.${LIBVERSION} ; \
ln -fs ${PWD}/$${a}/libr_$${a}.${EXT_AR} ${PFX}/lib/libr_$${a}.${EXT_AR} ; \
for b in $${a}/p/*.${EXT_SO} ; do \
if [ -e ${PWD}/$${b} ] ; then \
ln -fs ${PWD}/$${b} ${PFX}/lib/radare2/${VERSION}/ ; \
fi ; \
done ; \
done
install: install-includes install-pkgconfig
# TODO :Use INSTALL_DATA_DIR instead of mkdir
# libraries
@${INSTALL_DIR} ${PFX}/lib
@for a in `find * -type f | grep -e '\.${EXT_SO}$$' | grep -v lib/t | grep lib | grep -v /p/` ; do \
b=`echo $$a|cut -d / -f 2`; \
echo " ${PFX}/lib/$$b.${LIBVERSION}"; \
${INSTALL_LIB} $$a ${PFX}/lib/$$b.${LIBVERSION} ; \
( cd ${PFX}/lib ; ln -fs $$b.${LIBVERSION} $$b.0 ; ln -fs $$b.0 $$b ); \
2010-03-19 12:57:21 +00:00
done
# object archives
@for a in `find * -type f | grep -e '\.a$$' | grep -v fs/p` ; do \
echo " ${PFX}/lib/$$a"; ${INSTALL_DATA} $$a ${PFX}/lib ; done
# plugins
@${INSTALL_DIR} ${PFX}/lib/radare2/${VERSION}
@for a in `find */p -perm -u+x -type f | grep -v exe | grep -v dll | grep ${EXT_SO}`; \
do echo " ${PFX}/lib/radare2/${VERSION}/$$a"; \
${INSTALL_DATA} $$a ${PFX}/lib/radare2/${VERSION} ; done
@echo "lang/p/radare.* ${PFX}/lib/radare2/${VERSION}"
${INSTALL_DATA} lang/p/radare.* ${PFX}/lib/radare2/${VERSION}
deinstall uninstall:
# libraries
-@for a in `find * | grep -e '\.${EXT_SO}$$' | grep -v 'lib/t' | grep lib` ; do \
a=`echo $$a | awk -F / '{ print $$NF; }'`; \
echo ${PFX}/lib/$$a ; rm -f ${PFX}/lib/$$a ; done
# object archives
-@for a in `find * | grep -e '\.a$$'` ; do \
a=`echo $$a | awk -F / '{ print $$NF; }'`; \
echo ${PFX}/lib/$$a ; rm -f ${PFX}/lib/$$a ; done
# includes
-(cd include && for a in * ; do rm -f ${PFX}/libr/$$a ; done)
# programs
-@for a in `find */t -perm -u+x -type f | grep 2`; do \
a=`echo $$a|awk -F / '{ print $$NF; }'`; \
echo ${PFX}/bin/$$a ; rm -f ${PFX}/bin/$$a ; done
# plugins
-@for a in `find */p -perm -u+x -type f`; do \
a="${PFX}/lib/radare2/${VERSION}/`echo $$a|awk -F / '{ print $$NF; }'`"; \
echo $$a ; rm -f $$a ; done
rm -rf ${PFX}/lib/radare2/${VERSION}
rm -f ${PFX}/lib/pkgconfig/libr.pc
rm -f ${PFX}/lib/pkgconfig/r_*.pc
# test programs
rm -rf ${PFX}/bin/libr-test
# TODO: use for a in LIBLIST (like in binr/Makefile)
rm -rf ${PFX}/include/libr
rm -rf ${PFX}/lib/libr_*.so.${LIBVERSION}
rm -rf ${PFX}/lib/libr_*.so.0
rm -rf ${PFX}/lib/libr_*.so
rm -rf ${PFX}/lib/libr_*.a
rm -rf ${PFX}/lib/libr2.so*
rm -rf ${PFX}/lib/libr2.a
rm -rf ${PFX}/lib/libr.so*
rm -rf ${PFX}/lib/libr.a
rm -rf ${PFX}/share/doc/radare2
@echo libr aka radare2 has been uninstalled from PREFIX=${PFX}
clean:
for lib in ${LIBLIST}; do ( cd $${lib} && ${MAKE} clean ); done
2009-06-15 02:44:05 +00:00
2010-07-13 09:59:55 +00:00
mrproper:
for lib in ${LIBLIST}; do ( cd $${lib} && ${MAKE} mrproper ); done
* Initial import of the 'configure-plugins' script - accepts --static and --shared to setup which plugins you want to build statically in the library or dynamically - normalize .mk and plugin file names to adopt a single standard - WARNING: huge commit * Added 'mk/sloc.mk' with 'sloc' target to count lines with sloccount everywhere (yeah!) --HG-- rename : libr/asm/p/x86bea.mk => libr/asm/p/x86_bea.mk rename : libr/asm/p/x86nasm.mk => libr/asm/p/x86_nasm.mk rename : libr/asm/p/x86olly.mk => libr/asm/p/x86_olly.mk rename : libr/config.h => libr/config.h.head rename : libr/config.mk => libr/config.mk.head rename : libr/debug/p/dbg_gdb.c => libr/debug/p/debug_gdb.c rename : libr/debug/p/dbg_ptrace.c => libr/debug/p/debug_ptrace.c rename : libr/debug/p/dbg_libgdbwrap/Makefile => libr/debug/p/libgdbwrap/Makefile rename : libr/debug/p/dbg_libgdbwrap/README => libr/debug/p/libgdbwrap/README rename : libr/debug/p/dbg_libgdbwrap/client.c => libr/debug/p/libgdbwrap/client.c rename : libr/debug/p/dbg_libgdbwrap/gdbwrapper.c => libr/debug/p/libgdbwrap/gdbwrapper.c rename : libr/debug/p/dbg_libgdbwrap/include/gdbwrapper-internals.h => libr/debug/p/libgdbwrap/include/gdbwrapper-internals.h rename : libr/debug/p/dbg_libgdbwrap/include/gdbwrapper-stddef.h => libr/debug/p/libgdbwrap/include/gdbwrapper-stddef.h rename : libr/debug/p/dbg_libgdbwrap/include/gdbwrapper.h => libr/debug/p/libgdbwrap/include/gdbwrapper.h rename : libr/debug/p/dbg_libgdbwrap/include/libaspect.h => libr/debug/p/libgdbwrap/include/libaspect.h rename : libr/debug/p/dbg_libgdbwrap/include/libe2dbg.h => libr/debug/p/libgdbwrap/include/libe2dbg.h rename : libr/debug/p/dbg_libgdbwrap/include/revm.h => libr/debug/p/libgdbwrap/include/revm.h rename : libr/debug/p/dbg_libgdbwrap/interface.c => libr/debug/p/libgdbwrap/interface.c rename : libr/io/p/dbg.mk => libr/io/p/debug.mk rename : libr/io/p/io_dbg.c => libr/io/p/io_debug.c
2010-01-13 22:42:49 +00:00
sloc:
${MAKE} -C .. sloc SLOCDIR=libr
.PHONY: sloc mrproper clean all pkgcfg install deinstall uninstall libr install-symlink