mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-04 19:47:31 +00:00
3bc0212ee6
- 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
108 lines
3.6 KiB
Makefile
108 lines
3.6 KiB
Makefile
include ../config-user.mk
|
|
|
|
PREFIX?=${PWD}/../prefix
|
|
PFX=${DESTDIR}${PREFIX}
|
|
#PREFIX=${PFX}
|
|
|
|
# Libraries
|
|
LIBLIST=util lib io meta lang flags bin bininfo macro hash line cons print config syscall range socket cmd asm anal parse search diff bp reg debug core var sign trace vm th db
|
|
|
|
# Under development
|
|
#LIBLIST+=print
|
|
#LIBLIST+=util
|
|
#LIBLIST+=search
|
|
|
|
# TODO : generate single library linking against the rest
|
|
#LIBSO=libr.so
|
|
#LIBAR=libr.a
|
|
|
|
all:
|
|
@echo PREFIX=${PREFIX}
|
|
@for lib in ${LIBLIST}; do ( cd $${lib} && ${MAKE} all ); done
|
|
@echo Build done for: ${LIBLIST}
|
|
|
|
pkgcfg:
|
|
for lib in ${LIBLIST}; do ( cd $${lib} && ${MAKE} pkgcfg ); done
|
|
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:
|
|
# TODO :Use INSTALL_DATA_DIR instead of mkdir
|
|
echo Using prefix: ${PFX}
|
|
# libraries
|
|
@${INSTALL_DIR} ${PFX}/lib
|
|
@for a in `find * | grep -e '\.so$$' | grep lib` ; do \
|
|
echo " $$a "; ${INSTALL_DATA} $$a ${PFX}/lib ; done
|
|
# object archives
|
|
@for a in `find * | grep -e '\.a$$'` ; do \
|
|
echo " $$a"; ${INSTALL_DATA} $$a ${PFX}/lib ; done
|
|
# includes
|
|
@${INSTALL_DIR} ${PFX}/include/libr
|
|
(cd include && ${INSTALL_DATA} * ${PFX}/include/libr)
|
|
# programs
|
|
@${INSTALL_DIR} ${PFX}/bin
|
|
@for a in `find */t -perm /u+x -type f | grep 2`; \
|
|
do echo " $$a"; ${INSTALL_PROGRAM} $$a ${PFX}/bin ; done
|
|
# plugins
|
|
@${INSTALL_DIR} ${PFX}/lib/pkgconfig
|
|
for a in ../pkgcfg/*.pc ; do ${INSTALL_DATA} $$a ${PFX}/lib/pkgconfig ; done
|
|
#${INSTALL_DATA} libr.pc ${PFX}/lib/pkgconfig
|
|
@${INSTALL_DIR} ${PFX}/share/vala/vapi
|
|
${INSTALL_DATA} vapi/*.vapi vapi/*.deps ${PFX}/share/vala/vapi
|
|
@${INSTALL_DIR} ${PFX}/lib/radare2
|
|
@for a in `find */p -perm /u+x -type f`; \
|
|
do echo " $$a"; ${INSTALL_DATA} $$a ${PFX}/lib/radare2 ; done
|
|
# test programs
|
|
@${INSTALL_DIR} ${PFX}/bin/libr-test
|
|
@for a in `find */t -perm /u+x -type f | grep -v 2`; \
|
|
do echo " $$a"; ${INSTALL_PROGRAM} $$a ${PFX}/bin/libr-test ; done
|
|
@echo libr aka radare2 has been installed:
|
|
@echo PREFIX=${PREFIX}
|
|
@echo DESTDIR=${DESTDIR}
|
|
${INSTALL_DATA} lang/p/radare.* ${PFX}/lib/radare2
|
|
|
|
deinstall uninstall:
|
|
# libraries
|
|
-@for a in `find * | grep -e '\.so$$' | grep lib` ; do \
|
|
a=`echo $$a|awk -F / '{ print $$NF; }'`; \
|
|
echo ${PREFIX}/lib/$$a ; rm -f ${PREFIX}/lib/$$a ; done
|
|
### object archives
|
|
-@for a in `find * | grep -e '\.a$$'` ; do \
|
|
a=`echo $$a|awk -F / '{ print $$NF; }'`; \
|
|
echo ${PREFIX}/lib/$$a ; rm -f ${PREFIX}/lib/$$a ; done
|
|
### includes
|
|
-(cd include && for a in * ; do rm -f ${PREFIX}/libr/$$a ; done)
|
|
cd vapi/ ; for a in *.vapi *.deps ; do rm -f ${PREFIX}/share/vala/vapi/$$a ; done
|
|
### programs
|
|
-@for a in `find */t -perm /u+x -type f | grep 2`; do \
|
|
a=`echo $$a|awk -F / '{ print $$NF; }'`; \
|
|
echo ${PREFIX}/bin/$$a ; rm -f ${PREFIX}/bin/$$a ; done
|
|
# plugins
|
|
-@for a in `find */p -perm /u+x -type f`; do \
|
|
a="${PREFIX}/lib/radare2/`echo $$a|awk -F / '{ print $$NF; }'`"; \
|
|
echo $$a ; rm -f $$a ; done
|
|
rm -rf ${PREFIX}/lib/radare2
|
|
rm -f ${PREFIX}/lib/pkgconfig/libr.pc
|
|
rm -f ${PREFIX}/lib/pkgconfig/r_*.pc
|
|
# test programs
|
|
-@for a in `find */t -perm /u+x -type f | grep -v 2`; do \
|
|
a="${PREFIX}/bin/libr-test/`echo $$a|awk -F / '{ print $$NF; }'`"; \
|
|
echo $$a ; rm -f $$a ; done
|
|
rm -rf ${PREFIX}/bin/libr-test
|
|
@echo libr aka radare2 has been uninstalled from PREFIX=${PREFIX}
|
|
|
|
todo:
|
|
grep -re TODO -e XXX *
|
|
|
|
clean:
|
|
for lib in ${LIBLIST}; do ( cd $${lib} && ${MAKE} clean ); done
|
|
cd vapi/t && ${MAKE} clean
|
|
|
|
mrproper: clean
|
|
rm -f libr.pc
|
|
|
|
sloc:
|
|
${MAKE} -C .. sloc SLOCDIR=libr
|
|
|
|
.PHONY: mrproper clean todo all pkgcfg install deinstall uninstall
|