From d448260816b59ff56ac502094a7de4c79ae3e335 Mon Sep 17 00:00:00 2001 From: xambroz Date: Mon, 26 Oct 2015 21:33:45 +0000 Subject: [PATCH] build cleanup focused on possibility to control the lib directories with the build parameters needed mainly for RedHat/Fedora builds --- Makefile | 249 +++++++++++++++++----------------- binr/Makefile | 69 +++++----- binr/blob/Makefile | 23 ++-- binr/radare2/Makefile | 6 +- binr/rules.mk | 2 +- config-user.mk.acr | 4 +- global.mk | 4 +- libr/Makefile | 174 ++++++++++++------------ libr/asm/d/Makefile | 3 +- libr/bin/d/Makefile | 10 +- libr/cons/d/Makefile | 6 +- libr/crypto/Makefile | 2 +- libr/egg/t/Makefile | 2 +- libr/fs/Makefile | 2 +- libr/include/r_userconf.h.acr | 2 +- libr/magic/d/Makefile | 6 +- libr/parse/Makefile | 6 +- libr/rules.mk | 2 +- libr/syscall/d/Makefile | 6 +- shlr/Makefile | 34 ++--- shlr/sdb/Makefile | 130 +++++++++--------- shlr/www/graph/make.sh | 6 +- sys/android-build.sh | 14 +- sys/cydia/radare2/Makefile | 6 +- sys/debian/radare2/Makefile | 6 +- sys/farm.sh | 8 +- 26 files changed, 390 insertions(+), 392 deletions(-) diff --git a/Makefile b/Makefile index c5865ec483ae7..7d5062d3c774d 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,8 @@ -include config-user.mk include global.mk -DESTDIR:=$(call rmbdlslash,$(DESTDIR)) -WWWROOT:=$(call rmbdlslash,$(WWWROOT)) R2R=radare2-regressions R2R_URL=$(shell doc/repo REGRESSIONS) -DLIBDIR=$(call rmdblslash,$(DESTDIR)/$(LIBDIR)) -WWWROOT=${DATADIR}/radare2/${VERSION}/www R2BINS=$(shell cd binr ; echo r*2 r2agent r2pm) DATADIRS=libr/cons/d libr/bin/d libr/asm/d libr/syscall/d libr/magic/d R2VC=$(shell git rev-list --all --count) @@ -77,52 +73,52 @@ R=$(shell printf "\033[0m") windist: @echo "${C}[WINDIST] Installing binaries and libraries${R}" [ -n "${WINBITS}" ] || exit 1 - rm -rf radare2-${WINBITS}-${VERSION} ${WINDIST} - mkdir ${WINDIST} - for a in `find libr | grep -e dll$$`; do cp $$a ${WINDIST} ; done - for a in `find binr | grep -e exe$$`; do cp $$a ${WINDIST} ; done - rm -f ${WINDIST}/plugin.dll + rm -rf "radare2-${WINBITS}-${VERSION}" "${WINDIST}" + mkdir "${WINDIST}" + for FILE in `find libr | grep -e dll$$`; do cp "$$FILE" "${WINDIST}" ; done + for FILE in `find binr | grep -e exe$$`; do cp "$$FILE" "${WINDIST}" ; done + rm -f "${WINDIST}/plugin.dll" @echo "${C}[WINDIST] Picking plugins from libraries${R}" - mkdir -p ${WINDIST}/libs - mv ${WINDIST}/lib*.dll ${WINDIST}/libs - mkdir -p ${WINDIST}/plugins - mv ${WINDIST}/*.dll ${WINDIST}/plugins - mv ${WINDIST}/libs/* ${WINDIST} + mkdir -p "${WINDIST}/libs" + mv "${WINDIST}/lib*.dll ${WINDIST}/libs" + mkdir -p "${WINDIST}/plugins" + mv ${WINDIST}/*.dll "${WINDIST}/plugins" + mv ${WINDIST}/libs/* "${WINDIST}" @echo "${C}[WINDIST] Do not include plugins for now${R}" - rm -rf ${WINDIST}/libs + rm -rf "${WINDIST}/libs" rm -rf ${WINDIST}/plugins/* @echo "${C}[WINDIST] Copying web interface${R}" - mkdir -p ${WINDIST}/www - cp -rf shlr/www/* ${WINDIST}/www - mkdir -p ${WINDIST}/share/radare2/${VERSION}/magic - cp -f libr/magic/d/default/* ${WINDIST}/share/radare2/${VERSION}/magic - mkdir -p ${WINDIST}/share/radare2/${VERSION}/syscall - cp -f libr/syscall/d/*.sdb ${WINDIST}/share/radare2/${VERSION}/syscall - mkdir -p ${WINDIST}/share/radare2/${VERSION}/opcodes - cp -f libr/asm/d/*.sdb ${WINDIST}/share/radare2/${VERSION}/opcodes - mkdir -p ${WINDIST}/share/doc/radare2 - mkdir -p ${WINDIST}/include/libr/sdb + mkdir -p "${WINDIST}/www" + cp -rf shlr/www/* "${WINDIST}/www" + mkdir -p "${WINDIST}/share/radare2/${VERSION}/magic" + cp -f libr/magic/d/default/* "${WINDIST}/share/radare2/${VERSION}/magic" + mkdir -p "${WINDIST}/share/radare2/${VERSION}/syscall" + cp -f libr/syscall/d/*.sdb "${WINDIST}/share/radare2/${VERSION}/syscall" + mkdir -p "${WINDIST}/share/radare2/${VERSION}/opcodes" + cp -f libr/asm/d/*.sdb "${WINDIST}/share/radare2/${VERSION}/opcodes" + mkdir -p "${WINDIST}/share/doc/radare2" + mkdir -p "${WINDIST}/include/libr/sdb" @echo "${C}[WINDIST] Copying development files${R}" - cp -f libr/include/sdb/*.h ${WINDIST}/include/libr/sdb/ - cp -f libr/include/*.h ${WINDIST}/include/libr - #mkdir -p ${WINDIST}/include/libr/sflib - @cp -f doc/fortunes.* ${WINDIST}/share/doc/radare2 - @mkdir -p ${WINDIST}/share/radare2/${VERSION}/cons - @cp -f libr/cons/d/* ${WINDIST}/share/radare2/${VERSION}/cons - @mkdir -p ${WINDIST}/share/radare2/${VERSION}/hud - @cp -f doc/hud ${WINDIST}/share/radare2/${VERSION}/hud/main - @mv ${WINDIST} radare2-${WINBITS}-${VERSION} - @rm -f radare2-${WINBITS}-${VERSION}.zip + cp -f libr/include/sdb/*.h "${WINDIST}/include/libr/sdb/" + cp -f libr/include/*.h "${WINDIST}/include/libr" + #mkdir -p "${WINDIST}/include/libr/sflib" + @cp -f doc/fortunes.* "${WINDIST}/share/doc/radare2" + @mkdir -p "${WINDIST}/share/radare2/${VERSION}/cons" + @cp -f libr/cons/d/* "${WINDIST}/share/radare2/${VERSION}/cons" + @mkdir -p "${WINDIST}/share/radare2/${VERSION}/hud" + @cp -f doc/hud "${WINDIST}/share/radare2/${VERSION}/hud/main" + @mv "${WINDIST}" "radare2-${WINBITS}-${VERSION}" + @rm -f "radare2-${WINBITS}-${VERSION}.zip" ifneq ($(USE_ZIP),NO) - $(ZIP) -r radare2-${WINBITS}-${VERSION}.zip radare2-${WINBITS}-${VERSION} + $(ZIP) -r "radare2-${WINBITS}-${VERSION}.zip" "radare2-${WINBITS}-${VERSION}" endif clean: rmd - for a in shlr libr binr ; do (cd $$a ; ${MAKE} clean) ; done + for DIR in shlr libr binr ; do (cd "$$DIR" ; ${MAKE} clean) ; done distclean mrproper: - -rm -f `find . -type f -name *.d` - for a in libr binr shlr ; do ( cd $$a ; ${MAKE} mrproper) ; done + -rm -f `find . -type f -name '*.d'` + for DIR in libr binr shlr ; do ( cd "$$DIR" ; ${MAKE} mrproper) ; done rm -f config-user.mk plugins.cfg libr/config.h rm -f libr/include/r_userconf.h libr/config.mk rm -f pkgcfg/*.pc @@ -131,98 +127,97 @@ pkgcfg: cd libr && ${MAKE} pkgcfg install-man: - 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 + mkdir -p "${DESTDIR}${MANDIR}/man1" + for FILE in man/*.1 ; do ${INSTALL_MAN} "$$FILE" "${DESTDIR}${MANDIR}/man1" ; done + cd "${DESTDIR}${MANDIR}/man1" && ln -fs radare2.1 r2.1 install-man-symlink: - mkdir -p "${MDR}/man1" - cd man && for a in *.1 ; do \ - ln -fs "${PWD}/man/$$a" "${MDR}/man1/$$a" ; done - cd "${MDR}/man1" && ln -fs radare2.1 r2.1 + mkdir -p "${DESTDIR}${MANDIR}/man1" + cd man && for FILE in *.1 ; do \ + ln -fs "${PWD}/man/$$FILE" "${DESTDIR}${MANDIR}/man1/$$FILE" ; done + cd "${DESTDIR}${MANDIR}/man1" && ln -fs radare2.1 r2.1 install-doc: - ${INSTALL_DIR} "${PFX}/share/doc/radare2" - for a in doc/* ; do ${INSTALL_DATA} $$a "${PFX}/share/doc/radare2" ; done + ${INSTALL_DIR} "${DESTDIR}${DATADIR}/doc/radare2" + for FILE in doc/* ; do ${INSTALL_DATA} $$FILE "${DESTDIR}${DATADIR}/doc/radare2" ; done install-doc-symlink: - ${INSTALL_DIR} "${PFX}/share/doc/radare2" - cd doc ; for a in * ; do \ - ln -fs "${PWD}/doc/$$a" "${PFX}/share/doc/radare2" ; done + ${INSTALL_DIR} "${DESTDIR}${DATADIR}/doc/radare2" + cd doc ; for FILE in * ; do \ + ln -fs "${PWD}/doc/$$FILE" "${DESTDIR}${DATADIR}/doc/radare2" ; done install love: install-doc install-man install-www - cd libr && ${MAKE} install PREFIX="${PREFIX}" DESTDIR="${DESTDIR}" PARENT=1 - cd binr && ${MAKE} install PREFIX="${PREFIX}" DESTDIR="${DESTDIR}" - cd shlr && ${MAKE} install PREFIX="${PREFIX}" DESTDIR="${DESTDIR}" - for a in ${DATADIRS} ; do \ - (cd $$a ; ${MAKE} install LIBDIR="${LIBDIR}" PREFIX="${PREFIX}" DESTDIR="${DESTDIR}" ); \ + cd libr && ${MAKE} install PARENT=1 + cd binr && ${MAKE} install + cd shlr && ${MAKE} install + for DIR in ${DATADIRS} ; do \ + (cd "$$DIR" ; ${MAKE} install ); \ done - rm -rf "${DLIBDIR}/radare2/${VERSION}/hud" - mkdir -p "${DLIBDIR}/radare2/${VERSION}/hud" - cp -f doc/hud "${DLIBDIR}/radare2/${VERSION}/hud/main" - mkdir -p $(call rmdblslash,${DESTDIR}/${PREFIX}/share/radare2/${VERSION}/) + rm -rf "${DESTDIR}${LIBDIR}/radare2/${VERSION}/hud" + mkdir -p "${DESTDIR}${LIBDIR}/radare2/${VERSION}/hud" + cp -f doc/hud "${DESTDIR}${LIBDIR}/radare2/${VERSION}/hud/main" + mkdir -p "${DESTDIR}${DATADIR}/radare2/${VERSION}/" sys/ldconfig.sh # Remove make .d files. fixes build when .c files are removed rmd: - rm -f `find . -type f -iname *.d` + rm -f `find . -type f -iname '*.d'` install-www: - rm -rf $(call rmdblslash,${DESTDIR}/${WWWROOT}) - rm -rf ${DLIBDIR}/radare2/${VERSION}/www # old dir - mkdir -p $(call rmdblslash,${DESTDIR}/${WWWROOT}) - cp -rf shlr/www/* $(call rmdblslash,${DESTDIR}/${WWWROOT}) + rm -rf "${DESTDIR}${WWWROOT}" + rm -rf "${DESTDIR}${LIBDIR}/radare2/${VERSION}/www" # old dir + mkdir -p "${DESTDIR}${WWWROOT}" + cp -rf shlr/www/* "${DESTDIR}${WWWROOT}" + -WWWDIR=$(call rmdblslash,${DESTDIR}/${DATADIR}/radare2/${VERSION}/www) symstall-www: - rm -rf $(call rmdblslash,${DESTDIR}/${WWWROOT}) - rm -rf ${DLIBDIR}/radare2/${VERSION}/www # old dir - mkdir -p "$(call rmdblslash,${DESTDIR}/${WWWROOT})" - cd $(call rmdblslash,${DESTDIR}/${WWWROOT}) ; \ - for a in "${PWD}/shlr/www/"* ; do \ - ln -fs $$a "$(WWWDIR)" ; done + rm -rf "${DESTDIR}${WWWROOT}" + rm -rf "${DESTDIR}${LIBDIR}/radare2/${VERSION}/www" # old dir + mkdir -p "${DESTDIR}${WWWROOT}" + cd "${DESTDIR}${WWWROOT}" ; \ + for FILE in "${PWD}/shlr/www/"* ; do \ + ln -fs "$$FILE" "$(DESTDIR)$(WWWROOT)" ; done install-pkgconfig-symlink: - @${INSTALL_DIR} "${DLIBDIR}/pkgconfig" - cd pkgcfg ; for a in *.pc ; do \ - ln -fs "$${PWD}/$$a" "${DLIBDIR}/pkgconfig/$$a" ; done + @${INSTALL_DIR} "${DESTDIR}${LIBDIR}/pkgconfig" + cd pkgcfg ; for FILE in *.pc ; do \ + ln -fs "$${PWD}/$$FILE" "${DESTDIR}${LIBDIR}/pkgconfig/$$FILE" ; done symstall install-symlink: install-man-symlink install-doc-symlink install-pkgconfig-symlink symstall-www - cd libr && ${MAKE} install-symlink PREFIX=${PREFIX} DESTDIR="${DESTDIR}" - cd binr && ${MAKE} install-symlink PREFIX=${PREFIX} DESTDIR="${DESTDIR}" - cd shlr && ${MAKE} install-symlink PREFIX=${PREFIX} DESTDIR="${DESTDIR}" - for a in ${DATADIRS} ; do (\ - cd $$a ; \ - echo $$a ; \ - ${MAKE} install-symlink LIBDIR="${LIBDIR}" \ - PREFIX="${PREFIX}" DESTDIR="${DESTDIR}" ); \ + cd libr && ${MAKE} install-symlink + cd binr && ${MAKE} install-symlink + cd shlr && ${MAKE} install-symlink + for DIR in ${DATADIRS} ; do (\ + cd "$$DIR" ; \ + echo "$$DIR" ; \ + ${MAKE} install-symlink ); \ done - mkdir -p "${DLIBDIR}/radare2/${VERSION}/hud" - cd "$(call rmdblslash,$(DESTDIR)/$(PREFIX)/lib/radare2/)" ;\ + mkdir -p "${DESTDIR}${LIBDIR}/radare2/${VERSION}/hud" + cd "$(DESTDIR)$(LIBDIR)/radare2/" ;\ rm -f last ; ln -fs $(VERSION) last - cd "$(call rmdblslash,$(DESTDIR)/$(PREFIX)/share/radare2/)" ;\ + cd "$(DESTDIR)$(PREFIX)/share/radare2/" ;\ rm -f last ; ln -fs $(VERSION) last - ln -fs "${PWD}/doc/hud" "${DLIBDIR}/radare2/${VERSION}/hud/main" - mkdir -p "$(call rmdblslash,${DESTDIR}/${PREFIX}/share/radare2/${VERSION}/)" + ln -fs "${PWD}/doc/hud" "${DESTDIR}${LIBDIR}/radare2/${VERSION}/hud/main" + mkdir -p "${DESTDIR}${DATADIR}/radare2/${VERSION}/" sys/ldconfig.sh deinstall uninstall: - cd libr && ${MAKE} uninstall PARENT=1 PREFIX=${PREFIX} DESTDIR=${DESTDIR} - cd binr && ${MAKE} uninstall PARENT=1 PREFIX=${PREFIX} DESTDIR=${DESTDIR} - cd shlr && ${MAKE} uninstall PARENT=1 PREFIX=${PREFIX} DESTDIR=${DESTDIR} - cd libr/syscall/d && ${MAKE} uninstall PARENT=1 PREFIX=${PREFIX} DESTDIR=${DESTDIR} LIBDIR=${LIBDIR} + cd libr && ${MAKE} uninstall PARENT=1 + cd binr && ${MAKE} uninstall PARENT=1 + cd shlr && ${MAKE} uninstall PARENT=1 + cd libr/syscall/d && ${MAKE} uninstall PARENT=1 @echo @echo "Run 'make purge' to also remove installed files from previous versions of r2" @echo 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 + rm -rf "${DESTDIR}${DATADIR}/doc/radare2" + cd man ; for FILE in *.1 ; do rm -f "${DESTDIR}${MANDIR}/man1/$$FILE" ; done + rm -f "${DESTDIR}${MANDIR}/man1/r2.1" -user-wrap=echo "\#!/bin/sh" > ~/bin/$1 \ -; echo "${PWD}/env.sh ${PREFIX} $1 \$$@" >> ~/bin/$1 \ +user-wrap=echo "\#!/bin/sh" > ~/bin/"$1" \ +; echo "${PWD}/env.sh '${PREFIX}' '$1' \$$@" >> ~/bin/"$1" \ ; chmod +x ~/bin/"$1" ; user-install: @@ -231,57 +226,57 @@ user-install: cd ~/bin ; ln -fs radare2 r2 user-uninstall: - $(foreach mod,$(R2BINS),rm -f ~/bin/$(mod)) + $(foreach mod,$(R2BINS),rm -f ~/bin/"$(mod)") rm -f ~/bin/r2 -rmdir ~/bin purge-dev: - rm -f ${DESTDIR}/${LIBDIR}/libr_*.${EXT_AR} - rm -f ${DESTDIR}/${LIBDIR}/pkgconfig/r_*.pc - rm -rf ${DESTDIR}/${INCLUDEDIR}/libr - rm -f ${DESTDIR}/${LIBDIR}/radare2/${VERSION}/-* + rm -f "${DESTDIR}${LIBDIR}/libr_"*".${EXT_AR}" + rm -f "${DESTDIR}${LIBDIR}/pkgconfig/r_"*.pc + rm -rf "${DESTDIR}${INCLUDEDIR}/libr" + rm -f "${DESTDIR}${LIBDIR}/radare2/${VERSION}/-"* strip: - -for a in ${R2BINS} ; do ${STRIP} -s ${DESTDIR}/${BINDIR}/$$a 2> /dev/null ; done - -for a in ${DESTDIR}/${LIBDIR}/libr_*.${EXT_SO} \ - ${DESTDIR}/${LIBDIR}/libr2.${EXT_SO} ; do ${STRIP} -s $$a ; done + -for FILE in ${R2BINS} ; do ${STRIP} -s "${DESTDIR}${BINDIR}/$$FILE" 2> /dev/null ; done + -for FILE in "${DESTDIR}${LIBDIR}/libr_"*".${EXT_SO}" "${DESTDIR}${LIBDIR}/libr2.${EXT_SO}" ; do \ + ${STRIP} -s "$$FILE" ; done purge: purge-doc purge-dev - for a in ${R2BINS} ; do rm -f ${DESTDIR}/${BINDIR}/$$a ; done - rm -f ${DESTDIR}/${BINDIR}/ragg2-cc - rm -f ${DESTDIR}/${BINDIR}/r2 - rm -f ${DESTDIR}/${LIBDIR}/libr_* - rm -f ${DESTDIR}/${LIBDIR}/libr2.${EXT_SO} - rm -rf ${DESTDIR}/${LIBDIR}/radare2 - rm -rf ${DESTDIR}/${INCLUDEDIR}/libr + for FILE in ${R2BINS} ; do rm -f "${DESTDIR}${BINDIR}/$$FILE" ; done + rm -f "${DESTDIR}${BINDIR}/ragg2-cc" + rm -f "${DESTDIR}${BINDIR}/r2" + rm -f "${DESTDIR}${LIBDIR}/libr_"* + rm -f "${DESTDIR}${LIBDIR}/libr2.${EXT_SO}" + rm -rf "${DESTDIR}${LIBDIR}/radare2" + rm -rf "${DESTDIR}${INCLUDEDIR}/libr" dist: - -[ configure -nt config-user.mk ] && ./configure --prefix=${PREFIX} + -[ configure -nt config-user.mk ] && ./configure "--prefix=${PREFIX}" git log $$(git show-ref `git tag |tail -n1`)..HEAD > ChangeLog cd shlr && ${MAKE} capstone-sync - DIR=`basename $$PWD` ; \ - FILES=`git ls-files | sed -e s,^,radare2-${VERSION}/,` ; \ - CS_FILES=`cd shlr/capstone ; git ls-files | grep -v pdf | grep -v xcode | grep -v msvc | grep -v suite | grep -v bindings | grep -v tests | sed -e s,^,radare2-${VERSION}/shlr/capstone/,` ; \ - cd .. && mv $${DIR} radare2-${VERSION} && \ - ${TAR} radare2-${VERSION}.tar $${FILES} $${CS_FILES} radare2-${VERSION}/ChangeLog ;\ - ${CZ} radare2-${VERSION}.tar ; \ - mv radare2-${VERSION} $${DIR} + DIR=`basename "$$PWD"` ; \ + FILES=`git ls-files | sed -e "s,^,radare2-${VERSION}/,"` ; \ + CS_FILES=`cd shlr/capstone ; git ls-files | grep -v pdf | grep -v xcode | grep -v msvc | grep -v suite | grep -v bindings | grep -v tests | sed -e "s,^,radare2-${VERSION}/shlr/capstone/,"` ; \ + cd .. && mv "$${DIR}" "radare2-${VERSION}" && \ + ${TAR} "radare2-${VERSION}.tar" $${FILES} $${CS_FILES} "radare2-${VERSION}/ChangeLog" ;\ + ${CZ} "radare2-${VERSION}.tar" ; \ + mv "radare2-${VERSION}" "$${DIR}" shot: DATE=`date '+%Y%m%d'` ; \ - FILES=`git ls-files | sed -e s,^,radare2-${DATE}/,` ; \ - cd .. && mv radare2 radare2-$${DATE} && \ - ${TAR} radare2-$${DATE}.tar $${FILES} ;\ - ${CZ} radare2-$${DATE}.tar ;\ - mv radare2-$${DATE} radare2 && \ - scp radare2-$${DATE}.${TAREXT} \ + FILES=`git ls-files | sed -e "s,^,radare2-${DATE}/,"` ; \ + cd .. && mv radare2 "radare2-$${DATE}" && \ + ${TAR} "radare2-$${DATE}.tar" $${FILES} ;\ + ${CZ} "radare2-$${DATE}.tar" ;\ + mv "radare2-$${DATE}" radare2 && \ + scp "radare2-$${DATE}.${TAREXT}" \ radare.org:/srv/http/radareorg/get/shot tests: @if [ -d $(R2R) ]; then \ cd $(R2R) ; git clean -xdf ; git pull ; \ else \ - git clone --depth 1 ${R2R_URL} $(R2R); \ + git clone --depth 1 "${R2R_URL}" "$(R2R)"; \ fi cd $(R2R) ; ${MAKE} diff --git a/binr/Makefile b/binr/Makefile index f2cd63daec164..972ced3e824d9 100644 --- a/binr/Makefile +++ b/binr/Makefile @@ -1,14 +1,14 @@ include ../global.mk include ../libr/config.mk -DESTDIR:=$(call rmbdlslash,$(DESTDIR)) +DESTDIR:=$(DESTDIR) BTOP=$(shell pwd) .PHONY: all clean install install-symlink deinstall uninstall mrproper preload -PFX=$(call rmdblslash,${DESTDIR}/${PREFIX}) -BFX=$(call rmdblslash,${DESTDIR}/${BINDIR}) -LFX=$(call rmdblslash,${DESTDIR}/${LIBDIR}) + + + BINS=rax2 rasm2 rabin2 rahash2 radiff2 radare2 rafind2 rarun2 ragg2 r2agent # this command needs more love to bring it back @@ -17,51 +17,52 @@ BINS=rax2 rasm2 rabin2 rahash2 radiff2 radare2 rafind2 rarun2 ragg2 r2agent LIBR2=$(call libname-version,libr2.$(EXT_SO),${LIBVERSION}) all: preload - @for a in ${BINS} ; do (cd $$a && ${MAKE} all) || exit 1; done + @for BINARY in ${BINS} ; do (cd $$BINARY && ${MAKE} all) || exit 1; done preload: $(MAKE) -C preload install: - mkdir -p "${BFX}" - for a in ${BINS} ; do \ - rm -f "${BFX}/$$a" ; \ - ${INSTALL_PROGRAM} "$$a/$$a" "${BFX}/$$a" ; \ + mkdir -p "${DESTDIR}${BINDIR}" + for BINARY in ${BINS} ; do \ + rm -f "${DESTDIR}${BINDIR}/$$BINARY" ; \ + ${INSTALL_PROGRAM} "$$BINARY/$$BINARY" "${DESTDIR}${BINDIR}/$$BINARY" ; \ done - ${INSTALL_SCRIPT} "$(BTOP)/r2pm/r2pm" "${BFX}/r2pm" - rm -f "${BFX}/ragg2-cc" - rm -rf "${PFX}/radare2/${VERSION}/r2pm" - mkdir -p "${PFX}/radare2/${VERSION}/r2pm" - cp -rf r2pm/d/* "${PFX}/radare2/${VERSION}/r2pm" - ${INSTALL_SCRIPT} ragg2/ragg2-cc "${BFX}/ragg2-cc" - -cd "${BFX}" && rm -f r2 ; ln -fs radare2 r2 - ${INSTALL_LIB} "preload/libr2.$(EXT_SO)" "$(LFX)" - -cd "$(LFX)" && \ + ${INSTALL_SCRIPT} "$(BTOP)/r2pm/r2pm" "${DESTDIR}${BINDIR}/r2pm" + rm -f "${DESTDIR}${BINDIR}/ragg2-cc" + rm -rf "${DESTDIR}${PREFIX}/radare2/${VERSION}/r2pm" + mkdir -p "${DESTDIR}${PREFIX}/radare2/${VERSION}/r2pm" + cp -rf r2pm/d/* "${DESTDIR}${PREFIX}/radare2/${VERSION}/r2pm" + ${INSTALL_SCRIPT} ragg2/ragg2-cc "${DESTDIR}${BINDIR}/ragg2-cc" + -cd "${DESTDIR}${BINDIR}" && rm -f r2 ; ln -fs radare2 r2 + ${INSTALL_LIB} "preload/libr2.$(EXT_SO)" "${DESTDIR}${LIBDIR}" + -cd "${DESTDIR}${LIBDIR}" && \ mv libr2.$(EXT_SO) $(LIBR2) && \ ln -fs $(LIBR2) libr2.$(EXT_SO) symstall install-symlink: - mkdir -p "${BFX}" - for a in ${BINS} ; do ln -fs "${BTOP}/$$a/$$a" "${BFX}/$$a" ; done - ln -fs "${BTOP}/ragg2/ragg2-cc" "${BFX}/ragg2-cc" - ln -fs "${BTOP}/r2pm/r2pm" "${BFX}/r2pm" - rm -rf "${PFX}/share/radare2/${VERSION}/r2pm" - mkdir -p "${PFX}/share/radare2/${VERSION}/" - ln -fs "$(BTOP)/r2pm/d" "${PFX}/share/radare2/${VERSION}/r2pm" - -ln -fs "${PFX}/bin/radare2" "${BFX}/r2" - -ln -fs "${BTOP}/preload/libr2.$(EXT_SO)" "${LFX}/libr2.$(EXT_SO)" - -cd "$(LFX)" && \ + mkdir -p "${DESTDIR}${BINDIR}" + for BINARY in ${BINS} ; do ln -fs "${BTOP}/$$BINARY/$$BINARY" "${DESTDIR}${BINDIR}/$$BINARY" ; done + ln -fs "${BTOP}/ragg2/ragg2-cc" "${DESTDIR}${BINDIR}/ragg2-cc" + ln -fs "${BTOP}/r2pm/r2pm" "${DESTDIR}${BINDIR}/r2pm" + rm -rf "${DESTDIR}${DATADIR}/radare2/${VERSION}/r2pm" + mkdir -p "${DESTDIR}${DATADIR}/radare2/${VERSION}/" + ln -fs "$(BTOP)/r2pm/d" "${DESTDIR}${DATADIR}/radare2/${VERSION}/r2pm" + -ln -fs "${DESTDIR}${BINDIR}/radare2" "${DESTDIR}${BINDIR}/r2" + -ln -fs "${BTOP}/preload/libr2.$(EXT_SO)" "${DESTDIR}${LIBDIR}/libr2.$(EXT_SO)" + -cd "${DESTDIR}${LIBDIR}" && \ mv libr2.$(EXT_SO) $(LIBR2) && \ ln -fs $(LIBR2) libr2.$(EXT_SO) deinstall uninstall: - for a in ${BINS} ; do rm -f "${BFX}/$$a" ; done - -rm -f "${BFX}/ragg2-cc" - -rm -f "${BFX}/r2pm" - -rm -f "${BFX}/r2" + for BINARY in ${BINS} ; do rm -f "${DESTDIR}${BINDIR}/$$BINARY" ; done + -rm -f "${DESTDIR}${BINDIR}/ragg2-cc" + -rm -f "${DESTDIR}${BINDIR}/r2pm" + -rm -f "${DESTDIR}${BINDIR}/r2" clean: - @for a in preload ${BINS} ; do (cd $$a && ${MAKE} clean); done + @for DIR in preload ${BINS} ; do (cd $$DIR && ${MAKE} clean); done mrproper: - @for a in preload ${BINS} ; do (cd $$a && ${MAKE} mrproper); done + @for DIR in preload ${BINS} ; do (cd $$DIR && ${MAKE} mrproper); done + diff --git a/binr/blob/Makefile b/binr/blob/Makefile index 9b02be70cd948..f2e23d1bd52f5 100644 --- a/binr/blob/Makefile +++ b/binr/blob/Makefile @@ -84,8 +84,8 @@ LDFLAGS+=${LINK} all: symlinks symlinks: build - for a in r2 ${BINS} ; do \ - ln -fs radare2 $$a ; \ + for FILE in r2 ${BINS} ; do \ + ln -fs radare2 $$FILE ; \ done clean: @@ -105,12 +105,12 @@ build: rm -f *.[ch] mv main.k main.c mv version.k version.c - for a in ${BINS2} ; do cp ../$$a/*.[ch] . ; done + for FILE in ${BINS2} ; do cp ../$$FILE/*.[ch] . ; done rm -f rwx.c xorhex.c rsc2.c - for a in ${BINS2} ; do \ - mv $$a.c _$$a.c ;\ - sed -e "s,^int main,int $${a}_main,g" _$$a.c > $$a.c ; \ - rm -f _$$a ; \ + for FILE in ${BINS2} ; do \ + mv $${FILE}.c _$${FILE}.c ;\ + sed -e "s,^int main,int $${FILE}_main,g" _$${FILE}.c > $${FILE}.c ; \ + rm -f _$${FILE} ; \ done rm -f _* ${CC} -o radare2 ${SOURCES} ${CFLAGS} ${LDFLAGS} @@ -121,8 +121,9 @@ build: mv version.k version.c install: - mkdir -p ${DESTDIR}/${PREFIX}/bin - for a in r2 ${BINS2} ; do \ - rm -f ${DESTDIR}/${PREFIX}/bin/$$a ; \ - cp -af $$a ${DESTDIR}/${PREFIX}/bin/$$a ; \ + mkdir -p "${DESTDIR}${BINDIR}" + for FILE in r2 ${BINS2} ; do \ + rm -f "${DESTDIR}${BINDIR}/$$FILE" ; \ + cp -af "$$FILE" "${DESTDIR}${BINDIR}/$$FILE" ; \ done + diff --git a/binr/radare2/Makefile b/binr/radare2/Makefile index 2a869fa7e1a15..bf91a0969d1c3 100644 --- a/binr/radare2/Makefile +++ b/binr/radare2/Makefile @@ -46,9 +46,9 @@ osx-sign osxsign: # sudo chmod 4755 radare2 osx-sign-libs: - for a in ${SIGN_LIBS} ; do \ - echo Signing $$a ; \ - codesign -f -s ${CERTID} $$a ; \ + for LIB in ${SIGN_LIBS} ; do \ + echo Signing $$LIB ; \ + codesign -f -s ${CERTID} $$LIB ; \ done # xcrun --sdk $(MACSDK) codesign -f -s ${CERTID} --entitlements $(ENTITL) radare2 # xcrun --sdk $(MACSDK) codesign -f -s ${CERTID} radare2 diff --git a/binr/rules.mk b/binr/rules.mk index 88a452daafce1..1c0fb5dbdf306 100644 --- a/binr/rules.mk +++ b/binr/rules.mk @@ -15,7 +15,7 @@ EXT_EXE=.js endif ifeq ($(USE_RPATH),1) -LDFLAGS+=-Wl,-rpath "${PREFIX}/lib" +LDFLAGS+=-Wl,-rpath "${LIBDIR}" endif OBJ+=${BIN}.o diff --git a/config-user.mk.acr b/config-user.mk.acr index 32dbeca8b5880..3cf2ccd9d2adb 100644 --- a/config-user.mk.acr +++ b/config-user.mk.acr @@ -1,14 +1,16 @@ # This file should be generated by the ./configure script -DESTDIR= CC=@CC@ WITH_GPL=@WITH_GPL@ # HOST_CC=@HOST_CC@ + +DESTDIR= PREFIX=@PREFIX@ BINDIR=@BINDIR@ LIBDIR=@LIBDIR@ MANDIR=@MANDIR@ DATADIR=@DATADIR@ INCLUDEDIR=@INCLUDEDIR@ + HAVE_LIB_GMP=@HAVE_LIB_GMP@ LIL_ENDIAN=@LIL_ENDIAN@ USE_RPATH=@USE_RPATH@ diff --git a/global.mk b/global.mk index 26fe4eb369ed6..88e2c9c72b1fe 100644 --- a/global.mk +++ b/global.mk @@ -27,8 +27,8 @@ PREFIX=/usr/local rmdblslash=$(subst //,/,$(subst //,/,$(subst /$$,,$1))) -PFX=${DESTDIR}${PREFIX} -MDR=${DESTDIR}${MANDIR} + + LIBDIR=${PREFIX}/lib WWWROOT=${DATADIR}/radare2/${VERSION}/www diff --git a/libr/Makefile b/libr/Makefile index 1e3f120bc81c2..0e8d3badf1f59 100644 --- a/libr/Makefile +++ b/libr/Makefile @@ -4,12 +4,12 @@ include ../config-user.mk include ../mk/platform.mk include ../mk/${COMPILER}.mk -DESTDIR:=$(call rmbdlslash,$(DESTDIR)) +DESTDIR:=$(DESTDIR) PREFIX?=${PWD}/../prefix -PFX=$(call rmdblslash,${DESTDIR}/${PREFIX}) -LFX=$(call rmdblslash,${DESTDIR}/${LIBDIR}) -IFX=$(call rmdblslash,${DESTDIR}/${INCLUDEDIR}) -PWD=$(call rmdblslash,$(shell pwd)) + + + +PWD=$(shell pwd) LIBS0=util hash LIBS1=reg cons db magic bp search config socket @@ -42,10 +42,10 @@ endif libr.a: rm -rf .libr mkdir .libr - for a in */libr_*.a ; do \ - mkdir -p .libr/$$a ; \ - cp -f $$a .libr/$$a ; \ - (cd .libr/$$a ; ${AR} x *.a ; rm -f *.a ) ; \ + for FILE in */libr_*.a ; do \ + mkdir -p .libr/$$FILE ; \ + cp -f $$FILE .libr/$$FILE ; \ + (cd .libr/$$FILE ; ${AR} x *.a ; rm -f *.a ) ; \ done ${AR} qv libr.a `find .libr/ | grep '\\.o$$'` rm -rf .libr @@ -53,7 +53,7 @@ libr.a: gnu_libr.a: $(shell ls */libr_*.a 2>/dev/null) rm -f libr.a echo CREATE libr.a > libr.m - for a in */libr_*.a ; do echo ADDLIB $$a >> libr.m ; done + for FILE in */libr_*.a ; do echo ADDLIB $$FILE >> libr.m ; done echo SAVE >> libr.m # ar -M is a gnu-ism .. try to find a proper portable way to do that ${CC_AR} -M < libr.m @@ -69,121 +69,121 @@ pkgcfg: # TODO: Magically generate libr.pc.acr here using LIBS and so :) install-pkgconfig: - ${INSTALL_DIR} "${LFX}/pkgconfig" - for a in ../pkgcfg/*.pc ; do \ - rm -f "${LFX}/pkgconfig/$$a" ; \ - ${INSTALL_DATA} $$a "${LFX}/pkgconfig" ; done + ${INSTALL_DIR} "${DESTDIR}${LIBDIR}/pkgconfig" + for FILE in ../pkgcfg/*.pc ; do \ + rm -f "${DESTDIR}${LIBDIR}/pkgconfig/$$FILE" ; \ + ${INSTALL_DATA} $$FILE "${DESTDIR}${LIBDIR}/pkgconfig" ; done install-includes: - @-rm -f ${IFX}/libr/sflib - @-rm -f ${IFX}/libr - ${INSTALL_DIR} "${IFX}/libr" - (cd include && for a in *.h ; do ${INSTALL_DATA} $$a "${IFX}/libr" ; done) - ${INSTALL_DIR} "${IFX}/libr/sflib" - (cd include/sflib && for a in * ; do \ - ${INSTALL_DIR} "${IFX}/libr/sflib/$$a" ; \ - for b in $$a/*.h ; do \ - ${INSTALL_DATA} $$b "${IFX}/libr/sflib/$$b" ; \ + @-rm -f "${DESTDIR}${INCLUDEDIR}/libr/sflib" + @-rm -f "${DESTDIR}${INCLUDEDIR}/libr" + ${INSTALL_DIR} "${DESTDIR}${INCLUDEDIR}/libr" + (cd include && for FILE in *.h ; do ${INSTALL_DATA} $$FILE "${DESTDIR}${INCLUDEDIR}/libr" ; done) + ${INSTALL_DIR} "${DESTDIR}${INCLUDEDIR}/libr/sflib" + (cd include/sflib && for DIR in * ; do \ + ${INSTALL_DIR} "${DESTDIR}${INCLUDEDIR}/libr/sflib/$$DIR" ; \ + for FILE in $$DIR/*.h ; do \ + ${INSTALL_DATA} $$FILE "${DESTDIR}${INCLUDEDIR}/libr/sflib/$$FILE" ; \ done ; \ done) - ${INSTALL_DIR} "${IFX}/libr/sdb" - (cd include/sdb && for a in * ; do \ - ${INSTALL_DATA} $$a "${IFX}/libr/sdb/$$a" ; \ + ${INSTALL_DIR} "${DESTDIR}${INCLUDEDIR}/libr/sdb" + (cd include/sdb && for FILE in * ; do \ + ${INSTALL_DATA} $$FILE "${DESTDIR}${INCLUDEDIR}/libr/sdb/$$FILE" ; \ done) symstall install-symlink: - mkdir -p "${PFX}/bin" \ - "${IFX}" \ - "${LFX}/pkgconfig" \ - "${LFX}/radare2/${VERSION}" - rm -rf "${IFX}/libr" && ln -fs "${PWD}/include" "${IFX}/libr" - cd ../pkgcfg && for a in *.pc ; do \ - if [ -e "${PWD}/../pkgcfg/$${a}" ] ; then \ - ln -fs "${PWD}/../pkgcfg/$${a}" \ - "${LFX}/pkgconfig/$${a}" ; \ + mkdir -p "${DESTDIR}${BINDIR}" \ + "${DESTDIR}${INCLUDEDIR}" \ + "${DESTDIR}${LIBDIR}/pkgconfig" \ + "${DESTDIR}${LIBDIR}/radare2/${VERSION}" + rm -rf "${DESTDIR}${INCLUDEDIR}/libr" && ln -fs "${PWD}/include" "${DESTDIR}${INCLUDEDIR}/libr" + cd ../pkgcfg && for FILE in *.pc ; do \ + if [ -e "${PWD}/../pkgcfg/$${FILE}" ] ; then \ + ln -fs "${PWD}/../pkgcfg/$${FILE}" \ + "${DESTDIR}${LIBDIR}/pkgconfig/$${FILE}" ; \ fi ; \ done @$(foreach lib,${LIBS}, \ ln -fs "${PWD}/$(lib)/libr_$(lib).${EXT_SO}" \ - "${LFX}/libr_$(lib).${EXT_SO}" ; \ + "${DESTDIR}${LIBDIR}/libr_$(lib).${EXT_SO}" ; \ ln -fs "${PWD}/$(lib)/libr_$(lib).${EXT_SO}" \ - "${LFX}/$(call libname-version,libr_$(lib).${EXT_SO},${LIBVERSION})" ; \ - ln -fs "${PWD}/$(lib)/libr_$(lib).${EXT_AR}" "${LFX}/libr_$(lib).${EXT_AR}" ; \ + "${DESTDIR}${LIBDIR}/$(call libname-version,libr_$(lib).${EXT_SO},${LIBVERSION})" ; \ + ln -fs "${PWD}/$(lib)/libr_$(lib).${EXT_AR}" "${DESTDIR}${LIBDIR}/libr_$(lib).${EXT_AR}" ; \ $(foreach module,$(wildcard $(lib)/p/*.${EXT_SO}), \ - ln -fs "${PWD}/$(module)" "${LFX}/radare2/${VERSION}/" ; \ + ln -fs "${PWD}/$(module)" "${DESTDIR}${LIBDIR}/radare2/${VERSION}/" ; \ ) \ ) - cd "${LFX}/radare2" ; rm -f last ; ln -fs "${VERSION}" last + cd "${DESTDIR}${LIBDIR}/radare2" ; rm -f last ; ln -fs "${VERSION}" last install: install-includes install-pkgconfig # TODO :Use INSTALL_DATA_DIR instead of mkdir # libraries - @${INSTALL_DIR} "${LFX}" + @${INSTALL_DIR} "${DESTDIR}${LIBDIR}" @$(foreach lib,$(shell find * -type f | grep -e '\.${EXT_SO}$$' | grep -Ev '(lib|parse)/t/' | grep lib | grep -v /bin/ | grep -v /p/), \ - echo " ${LFX}/$(call libpath-to-name-version,$(lib),${LIBVERSION})"; \ - rm -f "${LFX}/$(call libpath-to-name-version,$(lib),${LIBVERSION})"; \ - ${INSTALL_LIB} "$(lib)" "${LFX}/$(call libpath-to-name-version,$(lib),${LIBVERSION})"; \ - ( cd "${LFX}" ; ln -fs "$(call libpath-to-name-version,$(lib),${LIBVERSION})" "$(call libpath-to-name,$(lib))" ) ; \ + echo " ${DESTDIR}${LIBDIR}/$(call libpath-to-name-version,$(lib),${LIBVERSION})"; \ + rm -f "${DESTDIR}${LIBDIR}/$(call libpath-to-name-version,$(lib),${LIBVERSION})"; \ + ${INSTALL_LIB} "$(lib)" "${DESTDIR}${LIBDIR}/$(call libpath-to-name-version,$(lib),${LIBVERSION})"; \ + ( cd "${DESTDIR}${LIBDIR}" ; ln -fs "$(call libpath-to-name-version,$(lib),${LIBVERSION})" "$(call libpath-to-name,$(lib))" ) ; \ ) # object archives - @for a in `find * -type f | grep -e '\.a$$' | grep -v fs/p` ; do \ - echo " ${LFX}/$$a"; ${INSTALL_DATA} $$a ${LFX} ; done + @for FILE in `find * -type f | grep -e '\.a$$' | grep -v fs/p` ; do \ + echo " ${DESTDIR}${LIBDIR}/$$FILE"; ${INSTALL_DATA} $$FILE "${DESTDIR}${LIBDIR}" ; done # plugins - @${INSTALL_DIR} "${LFX}/radare2/${VERSION}" - @for a in `find */p -perm -u+x -type f | grep -v exe | grep -v dll | grep ${EXT_SO}`; \ - do echo " ${LFX}/radare2/${VERSION}/$$a"; \ - ${INSTALL_LIB} "$$a" "${LFX}/radare2/${VERSION}" ; done - cd "${LFX}/radare2" ; ln -fs "${VERSION}" last + @${INSTALL_DIR} "${DESTDIR}${LIBDIR}/radare2/${VERSION}" + @for FILE in `find */p -perm -u+x -type f | grep -v exe | grep -v dll | grep ${EXT_SO}`; \ + do echo " ${DESTDIR}${LIBDIR}/radare2/${VERSION}/$$FILE"; \ + ${INSTALL_LIB} "$$FILE" "${DESTDIR}${LIBDIR}/radare2/${VERSION}" ; done + cd "${DESTDIR}${LIBDIR}/radare2" ; ln -fs "${VERSION}" last -#@echo "lang/p/radare.* ${DESTDIR}/${PFX}/${LIBDIR}/radare2/${VERSION}" -#${INSTALL_DATA} lang/p/radare.* ${LFX}/radare2/${VERSION} +#@echo "lang/p/radare.* ${DESTDIR}${DESTDIR}${PREFIX}/${LIBDIR}/radare2/${VERSION}" +#${INSTALL_DATA} lang/p/radare.* ${DESTDIR}${LIBDIR}/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 "${LFX}/$$a" ; rm -f "${LFX}/$$a" ; done + -@for FILE in `find * | grep -e '\.${EXT_SO}$$' | grep -v 'lib/t' | grep lib` ; do \ + FILE=`echo $$FILE | awk -F / '{ print $$NF; }'`; \ + echo "${DESTDIR}${LIBDIR}/$$FILE" ; rm -f "${DESTDIR}${LIBDIR}/$$FILE" ; done # object archives - -@for a in `find * | grep -e '\.a$$'` ; do \ - a=`echo $$a | awk -F / '{ print $$NF; }'`; \ - echo "${LFX}/$$a" ; rm -f "${LFX}/$$a" ; done + -@for FILE in `find * | grep -e '\.a$$'` ; do \ + FILE=`echo $$FILE | awk -F / '{ print $$NF; }'`; \ + echo "${DESTDIR}${LIBDIR}/$$FILE" ; rm -f "${DESTDIR}${LIBDIR}/$$FILE" ; done # includes - -if [ -h "${IFX}/libr" ]; then \ - rm -f "${IFX}/libr" ; \ + -if [ -h "${DESTDIR}${INCLUDEDIR}/libr" ]; then \ + rm -f "${DESTDIR}${INCLUDEDIR}/libr" ; \ else \ - (cd include && for a in * ; do rm -f "${IFX}/libr/$$a" ; done) ; \ + (cd include && for FILE in * ; do rm -f "${DESTDIR}${INCLUDEDIR}/libr/$$FILE" ; done) ; \ fi # 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 + -@for FILE in `find */t -perm -u+x -type f | grep 2`; do \ + FILE=`echo $$FILE|awk -F / '{ print $$NF; }'`; \ + echo "${DESTDIR}${BINDIR}/$$FILE" ; rm -f "${DESTDIR}${BINDIR}/$$FILE" ; done # plugins - -@for a in `find */p -perm -u+x -type f`; do \ - a="${LFX}/radare2/${VERSION}/`echo $$a|awk -F / '{ print $$NF; }'`"; \ - echo $$a ; rm -f $$a ; done - rm -rf "${LFX}/radare2/${VERSION}" - rm -f "${LFX}/pkgconfig/libr.pc" - rm -f "${LFX}/pkgconfig/r_"*.pc + -@for FILE in `find */p -perm -u+x -type f`; do \ + FILE="${DESTDIR}${LIBDIR}/radare2/${VERSION}/`echo $$FILE|awk -F / '{ print $$NF; }'`"; \ + echo $$FILE ; rm -f $$FILE ; done + rm -rf "${DESTDIR}${LIBDIR}/radare2/${VERSION}" + rm -f "${DESTDIR}${LIBDIR}/pkgconfig/libr.pc" + rm -f "${DESTDIR}${LIBDIR}/pkgconfig/r_"*.pc # test programs - rm -rf "${PFX}/bin/libr-test" - # TODO: use for a in LIBS (like in binr/Makefile) - rm -rf "${IFX}/libr" - rm -rf "${LFX}/libr_*.so.${LIBVERSION}" - rm -rf "${LFX}/libr_*.so.0" - rm -rf "${LFX}/libr_*.so" - rm -rf "${LFX}/libr_*.a" - rm -rf "${LFX}/libr2.so"* - rm -rf "${LFX}/libr2.a" - rm -rf "${LFX}/libr.so"* - rm -rf "${LFX}/libr.a" - rm -rf "${DESTDIR}${DATADIR}/share/doc/radare2" - @echo libr aka radare2 has been uninstalled from PREFIX=${PFX} + rm -rf "${DESTDIR}${BINDIR}/libr-test" + # TODO: use for FILE in LIBS (like in binr/Makefile) + rm -rf "${DESTDIR}${INCLUDEDIR}/libr" + rm -rf "${DESTDIR}${LIBDIR}/libr_*.so.${LIBVERSION}" + rm -rf "${DESTDIR}${LIBDIR}/libr_*.so.0" + rm -rf "${DESTDIR}${LIBDIR}/libr_*.so" + rm -rf "${DESTDIR}${LIBDIR}/libr_*.a" + rm -rf "${DESTDIR}${LIBDIR}/libr2.so"* + rm -rf "${DESTDIR}${LIBDIR}/libr2.a" + rm -rf "${DESTDIR}${LIBDIR}/libr.so"* + rm -rf "${DESTDIR}${LIBDIR}/libr.a" + rm -rf "${DESTDIR}${DATADIR}/doc/radare2" + @echo libr aka radare2 has been uninstalled from PREFIX=${DESTDIR}${PREFIX} clean: - for lib in ${LIBS}; do ( cd $${lib} && ${MAKE} clean ); done + for LIB in ${LIBS}; do ( cd $${LIB} && ${MAKE} clean ); done mrproper: - for lib in ${LIBS}; do ( cd $${lib} && ${MAKE} mrproper ); done + for LIB in ${LIBS}; do ( cd $${LIB} && ${MAKE} mrproper ); done .PHONY: sloc mrproper clean pkgcfg install deinstall uninstall libr .PHONY: install-includes install-pkgconfig install-symlink all diff --git a/libr/asm/d/Makefile b/libr/asm/d/Makefile index 2c5d0583509f0..acc3327edf1ed 100644 --- a/libr/asm/d/Makefile +++ b/libr/asm/d/Makefile @@ -15,7 +15,6 @@ clean: .PHONY: all clean install install-symlink symstall uninstall # XXX rmdblslash not defined, but doesnt warns about it -#OPDIR=$(call rmdblslash,${DESTDIR}${LIBDIR}/radare2/${VERSION}/opcodes) OPDIR=${DESTDIR}${LIBDIR}/radare2/${VERSION}/opcodes install: ${F_SDB} @@ -27,7 +26,7 @@ install: ${F_SDB} CWD=$(shell pwd) symstall install-symlink: ${F_SDB} mkdir -p "${OPDIR}" - for a in *.sdb ; do ln -fs "${CWD}/$$a" "${OPDIR}/$$a" ; done + for FILE in *.sdb ; do ln -fs "${CWD}/$$FILE" "${OPDIR}/$$FILE" ; done uninstall: rm -rf "${DESTDIR}${LIBDIR}/radare2/opcodes" diff --git a/libr/bin/d/Makefile b/libr/bin/d/Makefile index f39ef6ca9e166..4b8193ac74aaa 100644 --- a/libr/bin/d/Makefile +++ b/libr/bin/d/Makefile @@ -1,8 +1,8 @@ include ../../../global.mk include ../../../config-user.mk -SDBPATH=$(call rmdblslash,$(LTOP)/../shlr/sdb/) -SDB=$(call rmdblslash,$(SDBPATH)/sdb) +SDBPATH=$(LTOP)/../shlr/sdb/ +SDB=$(SDBPATH)/sdb P=${DESTDIR}${DATADIR}/radare2/${VERSION}/format @@ -28,9 +28,9 @@ install: ${F_SDB} CWD=$(shell pwd) symstall install-symlink: mkdir -p "$P" - for a in * ; do \ - if [ $$a != Makefile ]; then \ - ln -fs "${CWD}/$$a" "$P/$$a" ; \ + for FILE in * ; do \ + if [ "$$FILE" != Makefile ]; then \ + ln -fs "${CWD}/$$FILE" "$P/$$FILE" ; \ fi ; \ done diff --git a/libr/cons/d/Makefile b/libr/cons/d/Makefile index 909ac02d06dde..d76ec440cf083 100644 --- a/libr/cons/d/Makefile +++ b/libr/cons/d/Makefile @@ -13,9 +13,9 @@ install: ${F_SDB} CWD=$(shell pwd) symstall install-symlink: mkdir -p "$P" - for a in * ; do \ - if [ $$a != Makefile ]; then \ - ln -fs "${CWD}/$$a" "$P/$$a" ; \ + for FILE in * ; do \ + if [ $$FILE != Makefile ]; then \ + ln -fs "${CWD}/$$FILE" "$P/$$FILE" ; \ fi ; \ done diff --git a/libr/crypto/Makefile b/libr/crypto/Makefile index 5dd3a47b2cf6b..57b5917b81116 100644 --- a/libr/crypto/Makefile +++ b/libr/crypto/Makefile @@ -5,7 +5,7 @@ CFLAGS+=-DCORELIB include ../config.mk foo: - @for a in ${LIBSO} ${LIBAR} plugins ; do ${MAKE} $$a ; done + @for TARGET in ${LIBSO} ${LIBAR} plugins ; do ${MAKE} $$TARGET ; done include ${STATIC_CRYPTO_PLUGINS} STATIC_OBJS=$(subst ..,p/..,$(subst crypto_,p/crypto_,$(STATIC_OBJ))) diff --git a/libr/egg/t/Makefile b/libr/egg/t/Makefile index 3480de9c46ce4..a6cb6ac147e8e 100644 --- a/libr/egg/t/Makefile +++ b/libr/egg/t/Makefile @@ -19,7 +19,7 @@ include ../../rules.mk include ../../db/r.mk t tests: - @for a in ${TESTS} ; do sh t-$$a.sh ; done + @for TEST in ${TESTS} ; do sh t-$${TEST}.sh ; done myclean: rm -f test${EXT_EXE} test.o diff --git a/libr/fs/Makefile b/libr/fs/Makefile index 6afd44dacc24b..6c08687098e2d 100644 --- a/libr/fs/Makefile +++ b/libr/fs/Makefile @@ -10,7 +10,7 @@ LDFLAGS+=$(SHLR)/grub/libgrubfs.a EXTRA_TARGETS=plugins foo: - for a in pre plugins ${LIBSO} ${LIBAR} ; do ${MAKE} $$a ; done + for TARGET in pre plugins ${LIBSO} ${LIBAR} ; do ${MAKE} $$TARGET ; done include ${STATIC_FS_PLUGINS} STATIC_OBJS=$(subst ..,p/..,$(subst fs_,p/fs_,$(STATIC_OBJ))) diff --git a/libr/include/r_userconf.h.acr b/libr/include/r_userconf.h.acr index 228294147cce2..6e81f42520e3a 100644 --- a/libr/include/r_userconf.h.acr +++ b/libr/include/r_userconf.h.acr @@ -37,6 +37,6 @@ #define WITH_GPL @WITH_GPL@ -#define R2_WWWROOT "@DATADIR@/radare2/@VERSION@/www" +#define R2_WWWROOT "@WWWROOT@" #endif diff --git a/libr/magic/d/Makefile b/libr/magic/d/Makefile index ee31facd464ae..db28dc25b3cfb 100644 --- a/libr/magic/d/Makefile +++ b/libr/magic/d/Makefile @@ -1,6 +1,6 @@ include ../../config.mk -MAGICDIR=$(call rmdblslash,${DESTDIR}${PREFIX}/lib/radare2/${VERSION}/magic) +MAGICDIR=${DESTDIR}${LIBDIR}/radare2/${VERSION}/magic install: ${F_SDB} -rm -rf "$(MAGICDIR)" mkdir -p "$(MAGICDIR)" @@ -9,7 +9,7 @@ install: ${F_SDB} CWD=$(shell pwd) symstall install-symlink: ${F_SDB} mkdir -p "$(MAGICDIR)" - cd default ; for a in * ; do ln -fs "${CWD}/default/$$a" \ - "$(MAGICDIR)/$$a" ; done + cd default ; for FILE in * ; do ln -fs "${CWD}/default/$$FILE" \ + "$(MAGICDIR)/$$FILE" ; done .PHONY: install symstall diff --git a/libr/parse/Makefile b/libr/parse/Makefile index 8e135d0ef3121..82cfdebf5842d 100644 --- a/libr/parse/Makefile +++ b/libr/parse/Makefile @@ -7,9 +7,9 @@ LINK+=$(STOP)/tcc/libr_tcc.a CFLAGS+=-I$(STOP)/tcc/ foo: - @for a in pre libr_parse.${EXT_SO} \ - libr_parse.${EXT_AR} plugins bins \ - ; do ${MAKE} $$a ; done + @for TARGET in pre libr_parse.${EXT_SO} \ + libr_parse.${EXT_AR} plugins bins ; do \ + ${MAKE} $$TARGET ; done CFLAGS+=-DCORELIB -include ${STATIC_PARSE_PLUGINS} diff --git a/libr/rules.mk b/libr/rules.mk index 50b1975ec368c..cc0f91d025002 100644 --- a/libr/rules.mk +++ b/libr/rules.mk @@ -21,7 +21,7 @@ LIBR:=$(abspath $(dir $(lastword $(MAKEFILE_LIST)))) BEXE=$(BIN)$(EXT_EXE) ifeq ($(USE_RPATH),1) -LINK+=-Wl,-rpath "${PREFIX}/lib" +LINK+=-Wl,-rpath "${LIBDIR}" endif ifeq (${OSTYPE},gnulinux) diff --git a/libr/syscall/d/Makefile b/libr/syscall/d/Makefile index 4ada5a6234df4..e44a93026debc 100644 --- a/libr/syscall/d/Makefile +++ b/libr/syscall/d/Makefile @@ -23,13 +23,13 @@ HOST_CC?=gcc F_SDB=$(addsuffix .sdb,$F) -SDBPATH=$(call rmdblslash,$(LTOP)/../shlr/sdb/) +SDBPATH=$(LTOP)/../shlr/sdb/ ifeq ($(BUILD_OS),windows) BUILD_EXT_EXE=.exe else BUILD_EXT_EXE= endif -SDB=$(call rmdblslash,$(SDBPATH)/sdb${BUILD_EXT_EXE}) +SDB=$(SDBPATH)/sdb${BUILD_EXT_EXE} all: ${SDB} @$(MAKE) compile @@ -73,7 +73,7 @@ install: ${F_SDB} CWD=$(shell pwd) symstall install-symlink: ${F_SDB} mkdir -p "${DESTDIR}${LIBDIR}/radare2/${VERSION}/syscall" - for a in *.sdb ; do ln -fs "${CWD}/$$a" "${DESTDIR}${LIBDIR}/radare2/${VERSION}/syscall/$$a" ; done + for FILE in *.sdb ; do ln -fs "${CWD}/$$FILE" "${DESTDIR}${LIBDIR}/radare2/${VERSION}/syscall/$$FILE" ; done uninstall: rm -rf "${DESTDIR}${LIBDIR}/radare2/syscall" diff --git a/shlr/Makefile b/shlr/Makefile index 8220756cdd8e5..19aad2ad33d09 100644 --- a/shlr/Makefile +++ b/shlr/Makefile @@ -44,9 +44,9 @@ all: endif preall: targets libwind capstone-build - @for a in ${MODS} ; do \ - echo $(MAKE) -C $$a ; \ - $(MAKE) -C $$a HAVE_VALA= ROOT="${PWD}/../" CC="${CC}" ; \ + @for MOD in ${MODS} ; do \ + echo $(MAKE) -C $$MOD ; \ + $(MAKE) -C $$MOD HAVE_VALA= ROOT="${PWD}/../" CC="${CC}" ; \ done SDBFILES=sdb/src/.sdb${EXT_EXE} sdb/sdb${EXT_EXE} sdb/src/.sdb sdb/sdb @@ -54,7 +54,7 @@ PREMODS=capstone gdb wind sdb clean mrproper: rm -f ${SDBFILES} - @for a in ${PREMODS} ${MODS} ; do $(MAKE) -C $$a clean ; done + @for MOD in ${PREMODS} ${MODS} ; do $(MAKE) -C $$MOD clean ; done ifeq ($(BUILD_OS),windows) BUILD_EXT_EXE=.exe @@ -74,7 +74,7 @@ SDB_TARGETS+=sdb/sdb${BUILD_EXT_EXE} endif targets: - for a in ${SDB_TARGETS} ; do ${MAKE} $$a ; done + for TARGET in ${SDB_TARGETS} ; do ${MAKE} $$TARGET ; done ${SDB_TARGETS}: @echo @@ -166,25 +166,25 @@ tcc-sync sync-tcc: git clone --depth 1 git://repo.or.cz/tinycc.git _ cd _ ; ./configure --prefix=${PREFIX} mkdir -p tcc - for a in ${CFILES} ${HFILES} ; do cp -f _/$$a tcc ; done + for FILE in ${CFILES} ${HFILES} ; do cp -f _/$$FILE tcc ; done cp -f _/VERSION _/COPYING _/stab.def tcc git add tcc rm -rf _ -D=$(call rmdblslash,${DESTDIR}/${PREFIX}) + install: - #mkdir -p ${D}/lib - #cp -f tcc/libr_tcc* ${D}/lib - #cp -f zip/libr_z* ${D}/lib + #mkdir -p ${DESTDIR}${LIBDIR} + #cp -f tcc/libr_tcc* ${DESTDIR}${LIBDIR} + #cp -f zip/libr_z* ${DESTDIR}${LIBDIR} install-symlink symstall: - mkdir -p ${D}/lib - #cd tcc ; for a in libr_tcc* ; do \ - # ln -fs `pwd`/$$a ${D}/lib/$$a ; done + mkdir -p "${DESTDIR}${LIBDIR}" + #cd tcc ; for FILE in libr_tcc* ; do \ + # ln -fs `pwd`/$$FILE ${DESTDIR}${LIBDIR}/$$FILE ; done uninstall deinstall: - #rm -f ${D}/lib/libr_tcc* - #rm -f ${D}/lib/libr_z* + #rm -f ${DESTDIR}${LIBDIR}/libr_tcc* + #rm -f ${DESTDIR}${LIBDIR}/libr_z* ifeq ($(USE_CAPSTONE),1) # Do nothing here @@ -203,7 +203,7 @@ capstone-sync: "$(SHELL)" capstone.sh "${CS_URL}" "${CS_BRA}" "${CS_TIP}" "${CS_REV}" ifeq ($(CS_PATCHES),1) cd capstone ; git reset --hard - cd capstone ; for a in ../capstone-patches/* ; do patch -p1 < $$a ; done + cd capstone ; for PATCH in ../capstone-patches/* ; do patch -p1 < $$PATCH ; done endif .PHONY: capstone @@ -218,7 +218,7 @@ capstone: capstone-$(CS_VER).tar.gz tar xzvf capstone-$(CS_VER).tar.gz rm -rf capstone mv capstone-$(CS_VER) capstone - cd capstone ; for a in ../capstone-patches/* ; do patch -p1 < $$a ; done + cd capstone ; for PATCH in ../capstone-patches/* ; do patch -p1 < $$PATCH ; done capstone-$(CS_VER).tar.gz: $(WGET) --no-check-certificate -O capstone-$(CS_VER).tar.gz -c $(CS_TAR) diff --git a/shlr/sdb/Makefile b/shlr/sdb/Makefile index b186bf1d52c7b..2621babb9456b 100644 --- a/shlr/sdb/Makefile +++ b/shlr/sdb/Makefile @@ -2,7 +2,7 @@ include config.mk VALADIR=bindings/vala PWD=$(shell pwd) -PFX=${DESTDIR}${PREFIX} + HGFILES=`find sdb-${SDBVER} -type f | grep -v hg | grep -v swp` MKDIR=mkdir @@ -47,96 +47,96 @@ ifneq (${HAVE_VALA},) endif dist: - rm -f sdb-${SDBVER}.tar.gz - rm -rf sdb-${SDBVER} - git clone . sdb-${SDBVER} - rm -rf sdb-${SDBVER}/.git* - tar czvf sdb-${SDBVER}.tar.gz sdb-${SDBVER} - pub sdb-${SDBVER}.tar.gz - rm -rf sdb-${SDBVER} + rm -f "sdb-${SDBVER}.tar.gz" + rm -rf "sdb-${SDBVER}" + git clone . "sdb-${SDBVER}" + rm -rf "sdb-${SDBVER}/.git"* + tar czvf "sdb-${SDBVER}.tar.gz" "sdb-${SDBVER}" + pub "sdb-${SDBVER}.tar.gz" + rm -rf "sdb-${SDBVER}" w32dist: - rm -f sdb-${SDBVER}.zip - rm -rf sdb-${SDBVER} - mkdir -p sdb-${SDBVER} - cp src/sdb.exe sdb-${SDBVER} - zip -r sdb-${SDBVER}.zip sdb-${SDBVER} - rm -rf sdb-${SDBVER} + rm -f "sdb-${SDBVER}.zip" + rm -rf "sdb-${SDBVER}" + mkdir -p "sdb-${SDBVER}" + cp src/sdb.exe "sdb-${SDBVER}" + zip -r "sdb-${SDBVER}.zip" "sdb-${SDBVER}" + rm -rf "sdb-${SDBVER}" install-dirs: - $(INSTALL_DIR) ${DESTDIR}${MANDIR} ${DESTDIR}${LIBDIR}/pkgconfig ${DESTDIR}${BINDIR} - $(INSTALL_DIR) ${DESTDIR}${DATADIR}/vala/vapi ${DESTDIR}${INCDIR}/sdb + $(INSTALL_DIR) "${DESTDIR}${MANDIR}" "${DESTDIR}${LIBDIR}/pkgconfig" "${DESTDIR}${BINDIR}" + $(INSTALL_DIR) "${DESTDIR}${DATADIR}/vala/vapi" "${DESTDIR}${INCDIR}/sdb" INCFILES=src/sdb.h src/sdb_version.h src/cdb.h src/ht.h src/types.h INCFILES+=src/ls.h src/cdb_make.h src/buffer.h src/config.h install: pkgconfig install-dirs - $(INSTALL_MAN) src/sdb.1 ${DESTDIR}${MANDIR} - $(INSTALL_LIB) src/libsdb.${EXT_SO} ${DESTDIR}${LIBDIR} - $(INSTALL_DATA) src/libsdb.a ${DESTDIR}${LIBDIR} + $(INSTALL_MAN) src/sdb.1 "${DESTDIR}${MANDIR}" + $(INSTALL_LIB) src/libsdb.${EXT_SO} "${DESTDIR}${LIBDIR}" + $(INSTALL_DATA) src/libsdb.a "${DESTDIR}${LIBDIR}" -if [ "$(EXT_SO)" != "$(SOVER)" ]; then \ - cd ${DESTDIR}${LIBDIR} ; \ + cd "${DESTDIR}${LIBDIR}" ; \ mv libsdb.$(EXT_SO) libsdb.$(SOVER) ; \ ln -s libsdb.$(SOVER) libsdb.$(EXT_SO) ; \ ln -s libsdb.$(SOVER) libsdb.$(EXT_SO).$(SOVERSION) ; \ fi - $(INSTALL_DATA) $(INCFILES) ${DESTDIR}${INCDIR}/sdb - $(INSTALL_PROGRAM) src/sdb ${DESTDIR}${BINDIR} + $(INSTALL_DATA) $(INCFILES) "${DESTDIR}${INCDIR}/sdb" + $(INSTALL_PROGRAM) src/sdb "${DESTDIR}${BINDIR}" ifeq ($(BUILD_MEMCACHE),1) - $(INSTALL_DATA) memcache/libmcsdb.a ${DESTDIR}${LIBDIR} - $(INSTALL_DATA) memcache/mcsdb.h ${DESTDIR}${INCDIR}/sdb - $(INSTALL_PROGRAM) memcache/mcsdbd ${DESTDIR}${BINDIR} - $(INSTALL_PROGRAM) memcache/mcsdbc ${DESTDIR}${BINDIR} - $(INSTALL_DATA) pkgconfig/mcsdb.pc ${DESTDIR}${LIBDIR}/pkgconfig + $(INSTALL_DATA) memcache/libmcsdb.a "${DESTDIR}${LIBDIR}" + $(INSTALL_DATA) memcache/mcsdb.h "${DESTDIR}${INCDIR}/sdb" + $(INSTALL_PROGRAM) memcache/mcsdbd "${DESTDIR}${BINDIR}" + $(INSTALL_PROGRAM) memcache/mcsdbc "${DESTDIR}${BINDIR}" + $(INSTALL_DATA) pkgconfig/mcsdb.pc "${DESTDIR}${LIBDIR}/pkgconfig" endif - $(INSTALL_DATA) pkgconfig/sdb.pc ${DESTDIR}${LIBDIR}/pkgconfig + $(INSTALL_DATA) pkgconfig/sdb.pc "${DESTDIR}${LIBDIR}/pkgconfig" ifneq (${HAVE_VALA},) - $(INSTALL_DATA) ${VALADIR}/sdb.vapi ${DESTDIR}${DATADIR}/vala/vapi - cd ${VALADIR}/types && ${MAKE} install DESTDIR=${DESTDIR} PREFIX=${PREFIX} + $(INSTALL_DATA) ${VALADIR}/sdb.vapi "${DESTDIR}${DATADIR}/vala/vapi" + cd ${VALADIR}/types && ${MAKE} install ifeq ($(BUILD_MEMCACHE),1) - $(INSTALL_DATA) ${VALADIR}/mcsdb.vapi ${DESTDIR}${DATADIR}/vala/vapi + $(INSTALL_DATA) ${VALADIR}/mcsdb.vapi "${DESTDIR}${DATADIR}/vala/vapi" endif endif deinstall uninstall: - rm -rf ${DESTDIR}${INCDIR}/sdb - rm -f ${DESTDIR}${BINDIR}/sdb - rm -f ${DESTDIR}${BINDIR}/mcsdbc - rm -f ${DESTDIR}${BINDIR}/mcsdbd - rm -f ${DESTDIR}${LIBDIR}/libsdb.* - rm -f ${DESTDIR}${LIBDIR}/libmcsdb.a - rm -f ${DESTDIR}${LIBDIR}/pkgconfig/sdb.pc - rm -f ${DESTDIR}${LIBDIR}/pkgconfig/mcsdb.pc - rm -f ${DESTDIR}${MANDIR}/sdb.1 + rm -rf "${DESTDIR}${INCDIR}/sdb" + rm -f "${DESTDIR}${BINDIR}/sdb" + rm -f "${DESTDIR}${BINDIR}/mcsdbc" + rm -f "${DESTDIR}${BINDIR}/mcsdbd" + rm -f "${DESTDIR}${LIBDIR}/libsdb."* + rm -f "${DESTDIR}${LIBDIR}/libmcsdb.a" + rm -f "${DESTDIR}${LIBDIR}/pkgconfig/sdb.pc" + rm -f "${DESTDIR}${LIBDIR}/pkgconfig/mcsdb.pc" + rm -f "${DESTDIR}${MANDIR}/sdb.1" ifneq (${HAVE_VALA},) - rm -f ${DESTDIR}${DATADIR}/vala/vapi/sdb.vapi - rm -f ${DESTDIR}${DATADIR}/vala/vapi/mcsdb.vapi - cd ${VALADIR}/types && ${MAKE} uninstall DESTDIR=${DESTDIR} PREFIX=${PREFIX} + rm -f "${DESTDIR}${DATADIR}/vala/vapi/sdb.vapi" + rm -f "${DESTDIR}${DATADIR}/vala/vapi/mcsdb.vapi" + cd ${VALADIR}/types && ${MAKE} uninstall endif symstall: install-dirs - cd src ; for a in libsdb.* ; do \ - ln -fs ${PWD}/src/$$a ${DESTDIR}${LIBDIR}/$$a ; done - ln -fs ${PWD}/src/sdb.1 ${DESTDIR}${MANDIR}/sdb.1 - ln -fs ${PWD}/src/sdb ${DESTDIR}${BINDIR} - ln -fs ${PWD}/src/sdb.h ${DESTDIR}${INCDIR}/sdb - ln -fs ${PWD}/src/sdb_version.h ${DESTDIR}${INCDIR}/sdb - ln -fs ${PWD}/src/cdb.h ${DESTDIR}${INCDIR}/sdb - ln -fs ${PWD}/src/ht.h ${DESTDIR}${INCDIR}/sdb - ln -fs ${PWD}/src/types.h ${DESTDIR}${INCDIR}/sdb - ln -fs ${PWD}/src/ls.h ${DESTDIR}${INCDIR}/sdb - ln -fs ${PWD}/src/cdb_make.h ${DESTDIR}${INCDIR}/sdb - ln -fs ${PWD}/src/buffer.h ${DESTDIR}${INCDIR}/sdb - ln -fs ${PWD}/src/config.h ${DESTDIR}${INCDIR}/sdb - ln -fs ${PWD}/bindings/vala/sdb.pc ${DESTDIR}${LIBDIR}/pkgconfig - ln -fs ${PWD}/bindings/vala/mcsdb.pc ${DESTDIR}${LIBDIR}/pkgconfig + cd src ; for FILE in libsdb.* ; do \ + ln -fs ${PWD}/src/$$FILE "${DESTDIR}${LIBDIR}/$$FILE" ; done + ln -fs ${PWD}/src/sdb.1 "${DESTDIR}${MANDIR}/sdb.1" + ln -fs ${PWD}/src/sdb "${DESTDIR}${BINDIR}" + ln -fs ${PWD}/src/sdb.h "${DESTDIR}${INCDIR}/sdb" + ln -fs ${PWD}/src/sdb_version.h "${DESTDIR}${INCDIR}/sdb" + ln -fs ${PWD}/src/cdb.h "${DESTDIR}${INCDIR}/sdb" + ln -fs ${PWD}/src/ht.h "${DESTDIR}${INCDIR}/sdb" + ln -fs ${PWD}/src/types.h "${DESTDIR}${INCDIR}/sdb" + ln -fs ${PWD}/src/ls.h "${DESTDIR}${INCDIR}/sdb" + ln -fs ${PWD}/src/cdb_make.h "${DESTDIR}${INCDIR}/sdb" + ln -fs ${PWD}/src/buffer.h "${DESTDIR}${INCDIR}/sdb" + ln -fs ${PWD}/src/config.h "${DESTDIR}${INCDIR}/sdb" + ln -fs ${PWD}/bindings/vala/sdb.pc "${DESTDIR}${LIBDIR}/pkgconfig" + ln -fs ${PWD}/bindings/vala/mcsdb.pc "${DESTDIR}${LIBDIR}/pkgconfig" ifneq (${HAVE_VALA},) - $(MKDIR) -p ${DESTDIR}$(VAPIDIR) - ln -fs ${PWD}/bindings/vala/sdb.vapi ${DESTDIR}$(VAPIDIR) - ln -fs ${PWD}/bindings/vala/mcsdb.vapi ${DESTDIR}$(VAPIDIR) - ln -fs ${PWD}/bindings/vala/sdb.vapi ${DESTDIR}$(VAPIDIR) - ln -fs ${PWD}/bindings/vala/mcsdb.vapi ${DESTDIR}$(VAPIDIR) - cd ${VALADIR}/types && ${MAKE} symstall DESTDIR=${DESTDIR} PREFIX=${PREFIX} + $(MKDIR) -p "${DESTDIR}$(VAPIDIR)" + ln -fs ${PWD}/bindings/vala/sdb.vapi "${DESTDIR}$(VAPIDIR)" + ln -fs ${PWD}/bindings/vala/mcsdb.vapi "${DESTDIR}$(VAPIDIR)" + ln -fs ${PWD}/bindings/vala/sdb.vapi "${DESTDIR}$(VAPIDIR)" + ln -fs ${PWD}/bindings/vala/mcsdb.vapi "${DESTDIR}$(VAPIDIR)" + cd ${VALADIR}/types && ${MAKE} symstall endif # windows compiler prefix @@ -147,7 +147,7 @@ WCP=i386-mingw32 w32: src/sdb_version.h cd src ; \ - ${MAKE} OS=w32 WCP=${WCP} CC=${WCP}-gcc AR=${WCP}-ar RANLIB=${WCP}-ranlib sdb.exe + ${MAKE} OS=w32 WCP="${WCP}" CC="${WCP}-gcc" AR="${WCP}-ar" RANLIB="${WCP}-ranlib" sdb.exe # ios toolchain IOS_CC=$(shell xcrun --sdk iphoneos --find clang) -isysroot $(shell xcrun --sdk iphoneos --show-sdk-path) -arch armv7 -arch arm64 diff --git a/shlr/www/graph/make.sh b/shlr/www/graph/make.sh index 1ad1a383d50bc..bf17deef25024 100644 --- a/shlr/www/graph/make.sh +++ b/shlr/www/graph/make.sh @@ -1,6 +1,6 @@ cd img -for a in *.gif ; do +for FILE in *.gif ; do printf ''$a'' + printf "%s" `base64 $FILE | tr '\r' ' '` + echo '" alt="'$FILE'">' done diff --git a/sys/android-build.sh b/sys/android-build.sh index e95ebe3ab7b75..07eb86fb99404 100755 --- a/sys/android-build.sh +++ b/sys/android-build.sh @@ -125,8 +125,8 @@ rm -rf ${PWD}/${D}/include rm -rf ${PWD}/${D}/lib/pkgconfig rm -rf ${PWD}/${D}/lib/libsdb.a -echo rm -rf ${PWD}/${D}/${PREFIX}/bin/* -rm -rf "${PWD}/${D}/${PREFIX}/bin/"* +echo rm -rf ${PWD}/${D}/${BINDIR}/* +rm -rf "${PWD}/${D}/${BINDIR}/"* #end build @@ -141,12 +141,12 @@ mkdir -p ${HERE}/${D}/${PREFIX}/tmp :> ${HERE}/${D}/${PREFIX}/tmp/.empty cd ../.. -chmod +x "${HERE}/${D}/${PREFIX}/bin/"* -find ${D}/${PREFIX}/share/radare2/*/www +chmod +x "${HERE}/${D}/${BINDIR}/"* +find ${D}/${DATADIR}/radare2/*/www # Remove development files -rm -f ${HERE}/${D}/${PREFIX}/lib/radare2/*/*.so -rm -f ${HERE}/${D}/${PREFIX}/lib/*.a -rm -rf ${HERE}/${D}/${PREFIX}/share/radare2/*/www/*/node_modules +rm -f ${HERE}/${D}/${LIBDIR}/radare2/*/*.so +rm -f ${HERE}/${D}/${LIBDIR}/*.a +rm -rf ${HERE}/${D}/${DATADIR}/radare2/*/www/*/node_modules rm -rf ${HERE}/${D}/${PREFIX}/include eval `grep ^VERSION= ${HERE}/config-user.mk` #WWWROOT="/data/data/org.radare2.installer/radare2/share/radare2/${VERSION}/www" diff --git a/sys/cydia/radare2/Makefile b/sys/cydia/radare2/Makefile index 8a2059b4c2026..7e0f33b399dd7 100644 --- a/sys/cydia/radare2/Makefile +++ b/sys/cydia/radare2/Makefile @@ -7,9 +7,9 @@ all: ${MAKE} clean mkdir -p data cp -aRf root/* data - rm -rf data/usr/lib/pkgconfig - rm -rf data/usr/lib/*.a - rm -rf data/usr/include + rm -rf data${LIBDIR}/pkgconfig + rm -rf data${LIBDIR}/*.a + rm -rf data${INCLUDEDIR} ${MAKE} control ${MAKE} deb diff --git a/sys/debian/radare2/Makefile b/sys/debian/radare2/Makefile index e2e0795a06eb5..cae83614d3884 100644 --- a/sys/debian/radare2/Makefile +++ b/sys/debian/radare2/Makefile @@ -11,9 +11,9 @@ all: ${MAKE} clean mkdir -p data cp -aRf root/* data - rm -rf data/usr/lib/pkgconfig - rm -rf data/usr/lib/*.a - rm -rf data/usr/include + rm -rf data${LIBDIR}/pkgconfig + rm -rf data${LIBDIR}/*.a + rm -rf data${INCLUDEDIR} ${MAKE} control ${MAKE} deb diff --git a/sys/farm.sh b/sys/farm.sh index dec5d81ad48e4..d9a8f2b54a153 100755 --- a/sys/farm.sh +++ b/sys/farm.sh @@ -226,9 +226,9 @@ if [ -z "${DONTFIND}" ]; then fi log "[==] Running some tests..." -export PATH=${DESTDIR}/${PREFIX}/bin:$PATH -export PKG_CONFIG_PATH=${DESTDIR}/${PREFIX}/lib/pkgconfig -export LD_LIBRARY_PATH=${DESTDIR}/${PREFIX}/lib +export PATH=${DESTDIR}${BINDIR}:$PATH +export PKG_CONFIG_PATH=${DESTDIR}${LIBDIR}/pkgconfig +export LD_LIBRARY_PATH=${DESTDIR}${LIBDIR} logcmd type r2 logcmd type rasm2 logcmd type rabin2 @@ -259,7 +259,7 @@ log "[==] Installing valabind bindings..." logcmd time ${MAKE} install DESTDIR=${DESTDIR} log "[==] Testing bindings.." -export PYTHONPATH=${DESTDIR}/${PREFIX}/lib/python2.5/site-packages/ +export PYTHONPATH=${DESTDIR}${LIBDIR}/python2.5/site-packages/ logcmd ${PYTHON} -c "'from r2.r_util import *;b=RBuffer()'" logcmd ${PYTHON} -c "'from r2.r_asm import *;a=RAsm()'" logcmd ${PYTHON} -c "'from r2.r_core import *;c=RCore()'"