2009-04-01 00:28:13 +00:00
i n c l u d e . . / c o n f i g - u s e r . m k
PREFIX ?= ${ PWD } /../prefix
2009-03-09 01:14:50 +00:00
PFX = ${ DESTDIR } ${ PREFIX }
#PREFIX=${PFX}
2009-02-05 21:08:46 +00:00
# Libraries
2009-11-23 17:16:10 +00:00
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
2009-02-05 21:08:46 +00:00
# Under development
#LIBLIST+=print
#LIBLIST+=util
#LIBLIST+=search
# TODO : generate single library linking against the rest
#LIBSO=libr.so
#LIBAR=libr.a
all :
2010-01-09 00:14:37 +00:00
@echo PREFIX = ${ PREFIX }
@for lib in ${ LIBLIST } ; do ( cd $$ { lib} && ${ MAKE } all ) ; done
2009-02-05 21:08:46 +00:00
@echo Build done for : ${ LIBLIST }
2009-07-16 00:30:20 +00:00
pkgcfg :
for lib in ${ LIBLIST } ; do ( cd $$ { lib} && ${ MAKE } pkgcfg ) ; done
2009-07-16 09:40:00 +00:00
cd asm && ${ MAKE } pkgcfg NAME = libr DEPS = " r_`echo ${ LIBLIST } |sed -e 's, , r_,g'` "
2009-07-16 00:30:20 +00:00
# TODO: Magically generate libr.pc.acr here using LIBLIST and so :)
2009-02-05 21:08:46 +00:00
install :
2009-04-20 10:31:12 +00:00
# TODO :Use INSTALL_DATA_DIR instead of mkdir
2009-04-03 11:11:17 +00:00
echo Using prefix: ${ PFX }
2009-02-05 21:08:46 +00:00
# libraries
2009-04-20 11:02:04 +00:00
@${ INSTALL_DIR } ${ PFX } /lib
2009-02-11 23:04:30 +00:00
@for a in ` find * | grep -e '\.so$$' | grep lib` ; do \
2009-04-20 09:42:05 +00:00
echo " $$ a " ; ${ INSTALL_DATA } $$ a ${ PFX } /lib ; done
2009-02-05 21:08:46 +00:00
# object archives
@for a in ` find * | grep -e '\.a$$' ` ; do \
2009-04-20 09:42:05 +00:00
echo " $$ a " ; ${ INSTALL_DATA } $$ a ${ PFX } /lib ; done
2009-02-05 21:08:46 +00:00
# includes
2009-04-20 11:02:04 +00:00
@${ INSTALL_DIR } ${ PFX } /include/libr
2009-04-20 09:42:05 +00:00
( cd include && ${ INSTALL_DATA } * ${ PFX } /include/libr)
2009-02-05 21:08:46 +00:00
# programs
2009-04-20 11:02:04 +00:00
@${ INSTALL_DIR } ${ PFX } /bin
2009-02-06 12:17:51 +00:00
@for a in ` find */t -perm /u+x -type f | grep 2` ; \
2009-04-20 09:42:05 +00:00
do echo " $$ a " ; ${ INSTALL_PROGRAM } $$ a ${ PFX } /bin ; done
2009-02-06 17:22:27 +00:00
# plugins
2009-04-20 11:02:04 +00:00
@${ INSTALL_DIR } ${ PFX } /lib/pkgconfig
2009-07-16 00:30:20 +00:00
for a in ../pkgcfg/*.pc ; do ${ INSTALL_DATA } $$ a ${ PFX } /lib/pkgconfig ; done
#${INSTALL_DATA} libr.pc ${PFX}/lib/pkgconfig
2009-04-20 11:02:04 +00:00
@${ INSTALL_DIR } ${ PFX } /share/vala/vapi
2009-04-20 09:42:05 +00:00
${ INSTALL_DATA } vapi/*.vapi vapi/*.deps ${ PFX } /share/vala/vapi
2009-04-20 11:02:04 +00:00
@${ INSTALL_DIR } ${ PFX } /lib/radare2
2009-02-06 17:22:27 +00:00
@for a in ` find */p -perm /u+x -type f` ; \
2009-04-20 09:42:05 +00:00
do echo " $$ a " ; ${ INSTALL_DATA } $$ a ${ PFX } /lib/radare2 ; done
2009-02-05 21:08:46 +00:00
# test programs
2009-09-25 02:04:51 +00:00
@${ INSTALL_DIR } ${ PFX } /bin/libr-test
2009-02-06 12:17:51 +00:00
@for a in ` find */t -perm /u+x -type f | grep -v 2` ; \
2009-09-25 02:04:51 +00:00
do echo " $$ a " ; ${ INSTALL_PROGRAM } $$ a ${ PFX } /bin/libr-test ; done
2009-04-03 11:11:17 +00:00
@echo libr aka radare2 has been installed:
@echo PREFIX = ${ PREFIX }
@echo DESTDIR = ${ DESTDIR }
2009-04-20 09:42:05 +00:00
${ INSTALL_DATA } lang/p/radare.* ${ PFX } /lib/radare2
2009-02-05 21:08:46 +00:00
2009-04-03 11:11:17 +00:00
deinstall uninstall :
2009-03-06 00:38:23 +00:00
# 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
2009-03-07 17:47:59 +00:00
-( cd include && for a in * ; do rm -f ${ PREFIX } /libr/$$ a ; done )
2009-03-10 11:21:46 +00:00
cd vapi/ ; for a in *.vapi *.deps ; do rm -f ${ PREFIX } /share/vala/vapi/$$ a ; done
2009-03-06 00:38:23 +00:00
### 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
2009-03-09 13:08:53 +00:00
rm -f ${ PREFIX } /lib/pkgconfig/libr.pc
2009-07-16 00:30:20 +00:00
rm -f ${ PREFIX } /lib/pkgconfig/r_*.pc
2009-03-06 00:38:23 +00:00
# test programs
-@for a in ` find */t -perm /u+x -type f | grep -v 2` ; do \
2009-09-25 02:04:51 +00:00
a = " ${ PREFIX } /bin/libr-test/`echo $$ a|awk -F / '{ print $$ NF; }'` " ; \
2009-03-06 00:38:23 +00:00
echo $$ a ; rm -f $$ a ; done
2009-09-25 02:04:51 +00:00
rm -rf ${ PREFIX } /bin/libr-test
2009-03-06 00:38:23 +00:00
@echo libr aka radare2 has been uninstalled from PREFIX = ${ PREFIX }
2009-02-05 21:08:46 +00:00
todo :
2009-07-16 09:24:17 +00:00
grep -re TODO -e XXX *
2009-02-05 21:08:46 +00:00
clean :
for lib in ${ LIBLIST } ; do ( cd $$ { lib} && ${ MAKE } clean ) ; done
2009-02-16 23:09:40 +00:00
cd vapi/t && ${ MAKE } clean
2009-06-15 02:44:05 +00:00
mrproper : clean
2009-03-10 11:21:46 +00:00
rm -f libr.pc
2010-01-13 22:42:49 +00:00
sloc :
${ MAKE } -C .. sloc SLOCDIR = libr
.PHONY : mrproper clean todo all pkgcfg install deinstall uninstall