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
|
|
|
|
2018-02-18 02:04:34 +01:00
|
|
|
PREVIOUS_RELEASE=`git log --tags --simplify-by-decoration --pretty='format:%d'|head -n1|cut -d ' ' -f3 |sed -e 's,),,'`
|
2016-01-20 03:44:59 +01:00
|
|
|
|
2018-05-26 18:12:13 +02:00
|
|
|
B=$(DESTDIR)$(BINDIR)
|
|
|
|
L=$(DESTDIR)$(LIBDIR)
|
2017-05-15 00:39:41 +02:00
|
|
|
MESON?=meson
|
2017-07-28 14:02:27 +02:00
|
|
|
PYTHON?=python
|
2019-12-08 15:31:14 +01:00
|
|
|
R2R=test
|
2020-03-29 21:04:51 +02:00
|
|
|
R2BINS=$(shell cd binr ; echo r*2 r2agent r2pm r2-indent r2r)
|
2018-05-05 00:59:51 +02:00
|
|
|
ifdef SOURCE_DATE_EPOCH
|
|
|
|
BUILDSEC=$(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+__%H:%M:%S" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+__%H:%M:%S" 2>/dev/null || date -u "+__%H:%M:%S")
|
|
|
|
else
|
2017-02-06 00:08:02 +01:00
|
|
|
BUILDSEC=$(shell date "+__%H:%M:%S")
|
2018-05-05 00:59:51 +02:00
|
|
|
endif
|
2020-12-13 10:21:46 +01:00
|
|
|
DATADIRS=libr/cons/d libr/flag/d libr/bin/d libr/asm/d libr/syscall/d libr/magic/d libr/anal/d libr/util/d
|
2015-05-25 18:27:59 +02:00
|
|
|
USE_ZIP=YES
|
|
|
|
ZIP=zip
|
2016-02-27 12:33:39 +01:00
|
|
|
|
|
|
|
R2VC=$(shell git rev-list --all --count 2>/dev/null)
|
2015-04-29 00:47:44 +03:00
|
|
|
ifeq ($(R2VC),)
|
2017-01-29 15:25:14 +01:00
|
|
|
# release
|
|
|
|
R2VC=0
|
2015-04-29 00:47:44 +03:00
|
|
|
endif
|
2016-02-27 12:33:39 +01:00
|
|
|
|
2012-02-17 13:55:54 +01:00
|
|
|
STRIP?=strip
|
2015-09-23 22:37:15 +02:00
|
|
|
ifneq ($(shell xz --help 2>/dev/null | grep improve),)
|
2013-07-07 23:03:10 +02:00
|
|
|
TAR=tar -cvf
|
|
|
|
TAREXT=tar.xz
|
|
|
|
CZ=xz -f
|
2011-07-19 00:12:36 +02:00
|
|
|
else
|
2013-07-07 23:03:10 +02:00
|
|
|
TAR=bsdtar cvf
|
|
|
|
TAREXT=tar.gz
|
|
|
|
CZ=gzip -f
|
2011-07-19 00:12:36 +02:00
|
|
|
endif
|
2014-09-01 15:50:04 +02:00
|
|
|
PWD=$(shell pwd)
|
2010-10-29 03:38:43 +02:00
|
|
|
|
2016-01-22 22:48:34 +03:00
|
|
|
# For echo without quotes
|
2016-02-16 15:01:41 +03:00
|
|
|
Q='
|
|
|
|
ESC=
|
2016-01-22 22:48:34 +03:00
|
|
|
ifeq ($(BUILD_OS),windows)
|
2016-02-03 14:13:01 +03:00
|
|
|
ifeq ($(OSTYPE),mingw32)
|
2016-02-25 19:03:48 +03:00
|
|
|
ifneq (,$(findstring mingw32-make,$(MAKE)))
|
2016-02-16 15:01:41 +03:00
|
|
|
ifneq ($(APPVEYOR),True)
|
2016-01-23 01:15:33 +03:00
|
|
|
Q=
|
|
|
|
ESC=^
|
|
|
|
LC_ALL=C
|
|
|
|
export LC_ALL
|
2016-01-22 22:48:34 +03:00
|
|
|
endif
|
2016-02-16 15:01:41 +03:00
|
|
|
endif
|
2016-01-22 22:48:34 +03:00
|
|
|
endif
|
2016-02-25 19:03:48 +03:00
|
|
|
endif
|
2016-01-22 22:48:34 +03:00
|
|
|
|
2015-02-07 00:09:14 +01:00
|
|
|
all: plugins.cfg libr/include/r_version.h
|
2020-08-19 10:31:20 +02:00
|
|
|
${MAKE} -C shlr sdbs
|
2014-08-11 01:06:21 +02:00
|
|
|
${MAKE} -C shlr/zip
|
2013-06-25 17:35:36 +02:00
|
|
|
${MAKE} -C libr/util
|
2014-07-17 10:34:53 +02:00
|
|
|
${MAKE} -C libr/socket
|
2014-05-08 02:58:20 +02:00
|
|
|
${MAKE} -C shlr
|
|
|
|
${MAKE} -C libr
|
|
|
|
${MAKE} -C binr
|
2010-01-13 23:42:49 +01:00
|
|
|
|
2020-12-23 23:27:50 +01:00
|
|
|
GIT_TAP=$(shell git tag -l --sort=refname | grep '^[0-9]\.[0-9]' | tail -n1 || echo $(VERSION))
|
2015-09-23 22:37:15 +02:00
|
|
|
GIT_TIP=$(shell git rev-parse HEAD 2>/dev/null || echo HEAD)
|
2020-12-07 17:21:40 +01:00
|
|
|
R2_VER=$(shell ./configure -qV)
|
2018-05-05 00:59:51 +02:00
|
|
|
ifdef SOURCE_DATE_EPOCH
|
|
|
|
GIT_NOW=$(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+%Y-%m-%d" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+%Y-%m-%d" 2>/dev/null || date -u "+%Y-%m-%d")
|
2016-09-28 19:17:43 +02:00
|
|
|
else
|
2018-05-05 00:59:51 +02:00
|
|
|
GIT_NOW=$(shell date "+%Y-%m-%d")
|
2016-09-28 19:17:43 +02:00
|
|
|
endif
|
2015-09-23 22:37:15 +02:00
|
|
|
|
2015-02-07 00:09:14 +01:00
|
|
|
libr/include/r_version.h:
|
2016-01-25 15:19:41 +03:00
|
|
|
@echo Generating r_version.h file
|
2016-01-23 00:51:58 +03:00
|
|
|
@echo $(Q)#ifndef R_VERSION_H$(Q) > $@.tmp
|
|
|
|
@echo $(Q)#define R_VERSION_H 1$(Q) >> $@.tmp
|
|
|
|
@echo $(Q)#define R2_VERSION_COMMIT $(R2VC)$(Q) >> $@.tmp
|
2020-01-17 12:18:05 +01:00
|
|
|
@echo $(Q)#define R2_VERSION $(ESC)"$(R2_VERSION)$(ESC)"$(Q) >> $@.tmp
|
|
|
|
@echo $(Q)#define R2_VERSION_MAJOR $(R2_VERSION_MAJOR)$(Q) >> $@.tmp
|
|
|
|
@echo $(Q)#define R2_VERSION_MINOR $(R2_VERSION_MINOR)$(Q) >> $@.tmp
|
|
|
|
@echo $(Q)#define R2_VERSION_PATCH $(R2_VERSION_PATCH)$(Q) >> $@.tmp
|
|
|
|
@echo $(Q)#define R2_VERSION_NUMBER $(R2_VERSION_NUMBER)$(Q) >> $@.tmp
|
2016-01-23 00:51:58 +03:00
|
|
|
@echo $(Q)#define R2_GITTAP $(ESC)"$(GIT_TAP)$(ESC)"$(Q) >> $@.tmp
|
|
|
|
@echo $(Q)#define R2_GITTIP $(ESC)"$(GIT_TIP)$(ESC)"$(Q) >> $@.tmp
|
2017-02-06 00:08:02 +01:00
|
|
|
@echo $(Q)#define R2_BIRTH $(ESC)"$(GIT_NOW)$(BUILDSEC)$(ESC)"$(Q) >> $@.tmp
|
2016-01-23 00:51:58 +03:00
|
|
|
@echo $(Q)#endif$(Q) >> $@.tmp
|
2017-02-10 17:43:47 +01:00
|
|
|
@mv -f $@.tmp $@
|
2016-01-03 02:13:53 +01:00
|
|
|
@rm -f $@.tmp
|
2015-02-07 00:09:14 +01:00
|
|
|
|
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
|
2017-05-15 01:41:35 +02:00
|
|
|
$(SHELL) ./configure-plugins
|
2010-01-12 19:57:33 +01:00
|
|
|
|
2010-10-18 01:51:00 +02:00
|
|
|
w32:
|
2013-07-04 03:34:28 +02:00
|
|
|
sys/mingw32.sh
|
2010-10-18 01:51:00 +02:00
|
|
|
|
2012-09-03 01:27:52 +02:00
|
|
|
depgraph.png:
|
2016-09-02 17:13:03 +02:00
|
|
|
cd libr ; perl depgraph.pl dot | dot -Tpng -o../depgraph.png
|
2012-09-03 01:27:52 +02:00
|
|
|
|
|
|
|
android:
|
2016-01-22 20:53:01 +01:00
|
|
|
@if [ -z "$(NDK_ARCH)" ]; then echo "Set NDK_ARCH=[arm|arm64|mips|x86]" ; false; fi
|
2012-09-03 01:27:52 +02:00
|
|
|
sys/android-${NDK_ARCH}.sh
|
|
|
|
|
2010-01-15 17:02:04 +01:00
|
|
|
w32dist:
|
2015-03-20 13:07:56 +01:00
|
|
|
${MAKE} windist WINBITS=w32
|
|
|
|
|
|
|
|
w64dist:
|
|
|
|
${MAKE} windist WINBITS=w64
|
|
|
|
|
|
|
|
WINDIST=${WINBITS}dist
|
2017-05-18 16:50:52 +02:00
|
|
|
ZIPNAME?=radare2-${WINBITS}-${VERSION}.zip
|
2015-03-20 13:07:56 +01:00
|
|
|
|
2015-10-23 02:58:48 +02:00
|
|
|
C=$(shell printf "\033[32m")
|
|
|
|
R=$(shell printf "\033[0m")
|
2015-03-20 13:07:56 +01:00
|
|
|
windist:
|
2015-10-23 02:58:48 +02:00
|
|
|
@echo "${C}[WINDIST] Installing binaries and libraries${R}"
|
2015-03-20 13:07:56 +01:00
|
|
|
[ -n "${WINBITS}" ] || exit 1
|
2015-10-26 21:33:45 +00:00
|
|
|
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"
|
2015-10-23 02:58:48 +02:00
|
|
|
@echo "${C}[WINDIST] Picking plugins from libraries${R}"
|
2015-10-26 21:33:45 +00:00
|
|
|
mkdir -p "${WINDIST}/libs"
|
2015-10-27 15:42:09 +01:00
|
|
|
mv "${WINDIST}/"lib*.dll "${WINDIST}/libs"
|
2015-10-26 21:33:45 +00:00
|
|
|
mkdir -p "${WINDIST}/plugins"
|
|
|
|
mv ${WINDIST}/*.dll "${WINDIST}/plugins"
|
|
|
|
mv ${WINDIST}/libs/* "${WINDIST}"
|
2015-10-23 02:58:48 +02:00
|
|
|
@echo "${C}[WINDIST] Do not include plugins for now${R}"
|
2015-10-26 21:33:45 +00:00
|
|
|
rm -rf "${WINDIST}/libs"
|
2015-10-23 02:58:48 +02:00
|
|
|
rm -rf ${WINDIST}/plugins/*
|
|
|
|
@echo "${C}[WINDIST] Copying web interface${R}"
|
2015-10-26 21:33:45 +00:00
|
|
|
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"
|
2016-07-03 14:12:30 +03:00
|
|
|
mkdir -p "${WINDIST}/share/radare2/${VERSION}/sysregs"
|
|
|
|
cp -f libr/sysregs/d/*.sdb "${WINDIST}/share/radare2/${VERSION}/sysregs"
|
2015-10-30 03:07:22 +01:00
|
|
|
mkdir -p "${WINDIST}/share/radare2/${VERSION}/fcnsign"
|
2015-10-30 11:08:58 +01:00
|
|
|
cp -f libr/anal/d/*.sdb "${WINDIST}/share/radare2/${VERSION}/fcnsign"
|
2015-10-26 21:33:45 +00:00
|
|
|
mkdir -p "${WINDIST}/share/radare2/${VERSION}/opcodes"
|
|
|
|
cp -f libr/asm/d/*.sdb "${WINDIST}/share/radare2/${VERSION}/opcodes"
|
2018-05-26 18:12:13 +02:00
|
|
|
mkdir -p "${WINDIST}/share/radare2/${VERSION}/flag"
|
|
|
|
cp -f libr/flag/d/*.r2 "${WINDIST}/share/radare2/${VERSION}/flag"
|
2015-10-26 21:33:45 +00:00
|
|
|
mkdir -p "${WINDIST}/share/doc/radare2"
|
|
|
|
mkdir -p "${WINDIST}/include/libr/sdb"
|
2016-07-10 11:56:55 +03:00
|
|
|
mkdir -p "${WINDIST}/include/libr/r_util"
|
2015-10-23 02:58:48 +02:00
|
|
|
@echo "${C}[WINDIST] Copying development files${R}"
|
2020-07-21 10:28:43 +02:00
|
|
|
cp -f shlr/sdb/src/*.h "${WINDIST}/include/libr/sdb/"
|
2016-07-10 00:04:38 +03:00
|
|
|
cp -f libr/include/r_util/*.h "${WINDIST}/include/libr/r_util/"
|
2015-10-26 21:33:45 +00:00
|
|
|
cp -f libr/include/*.h "${WINDIST}/include/libr"
|
|
|
|
#mkdir -p "${WINDIST}/include/libr/sflib"
|
|
|
|
@cp -f doc/fortunes.* "${WINDIST}/share/doc/radare2"
|
2016-01-20 21:15:33 +01:00
|
|
|
@mkdir -p "${WINDIST}/share/radare2/${VERSION}/format/dll"
|
2016-06-26 04:44:59 +02:00
|
|
|
@cp -f libr/bin/d/elf32 "${WINDIST}/share/radare2/${VERSION}/format"
|
|
|
|
@cp -f libr/bin/d/elf64 "${WINDIST}/share/radare2/${VERSION}/format"
|
|
|
|
@cp -f libr/bin/d/elf_enums "${WINDIST}/share/radare2/${VERSION}/format"
|
|
|
|
@cp -f libr/bin/d/pe32 "${WINDIST}/share/radare2/${VERSION}/format"
|
|
|
|
@cp -f libr/bin/d/trx "${WINDIST}/share/radare2/${VERSION}/format"
|
2016-01-20 21:15:33 +01:00
|
|
|
@cp -f libr/bin/d/dll/*.sdb "${WINDIST}/share/radare2/${VERSION}/format/dll"
|
2015-10-26 21:33:45 +00:00
|
|
|
@mkdir -p "${WINDIST}/share/radare2/${VERSION}/cons"
|
2018-05-20 00:29:53 +02:00
|
|
|
@cp -PRpf libr/cons/d/* "${WINDIST}/share/radare2/${VERSION}/cons"
|
2015-10-26 21:33:45 +00:00
|
|
|
@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"
|
2015-05-25 18:27:59 +02:00
|
|
|
ifneq ($(USE_ZIP),NO)
|
2017-05-18 16:50:52 +02:00
|
|
|
$(ZIP) -r "${ZIPNAME}" "radare2-${WINBITS}-${VERSION}"
|
2015-05-25 18:27:59 +02:00
|
|
|
endif
|
2010-01-15 17:02:04 +01:00
|
|
|
|
2018-08-10 17:06:41 +03:00
|
|
|
clean:
|
2018-06-16 10:51:31 -05:00
|
|
|
rm -f libr/libr.a libr/libr.dylib libr/include/r_version.h
|
2018-05-09 23:31:52 +02:00
|
|
|
rm -rf libr/.libr
|
|
|
|
for DIR in shlr libr binr ; do $(MAKE) -C "$$DIR" clean ; done
|
2015-10-26 21:33:45 +00:00
|
|
|
-rm -f `find . -type f -name '*.d'`
|
2015-12-28 20:40:18 +01:00
|
|
|
rm -f `find . -type f -name '*.o'`
|
2012-09-04 01:46:12 +02:00
|
|
|
rm -f config-user.mk plugins.cfg libr/config.h
|
2018-08-10 17:06:41 +03:00
|
|
|
rm -f libr/include/r_userconf.h libr/config.mk
|
2010-06-15 14:10:42 +02:00
|
|
|
rm -f pkgcfg/*.pc
|
2009-06-15 02:44:05 +00:00
|
|
|
|
2018-08-13 14:17:41 +02:00
|
|
|
distclean mrproper: clean
|
|
|
|
rm -f `find . -type f -iname '*.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:
|
2015-10-26 21:33:45 +00:00
|
|
|
mkdir -p "${DESTDIR}${MANDIR}/man1"
|
2016-01-20 01:22:00 +00:00
|
|
|
mkdir -p "${DESTDIR}${MANDIR}/man7"
|
2015-10-26 21:33:45 +00:00
|
|
|
for FILE in man/*.1 ; do ${INSTALL_MAN} "$$FILE" "${DESTDIR}${MANDIR}/man1" ; done
|
|
|
|
cd "${DESTDIR}${MANDIR}/man1" && ln -fs radare2.1 r2.1
|
2016-01-20 01:22:00 +00:00
|
|
|
for FILE in man/*.7 ; do ${INSTALL_MAN} "$$FILE" "${DESTDIR}${MANDIR}/man7" ; done
|
2010-06-18 17:52:30 +02:00
|
|
|
|
|
|
|
install-man-symlink:
|
2015-10-26 21:33:45 +00:00
|
|
|
mkdir -p "${DESTDIR}${MANDIR}/man1"
|
2016-01-20 01:22:00 +00:00
|
|
|
mkdir -p "${DESTDIR}${MANDIR}/man7"
|
2017-10-18 17:53:00 +02:00
|
|
|
for FILE in $(shell cd man && ls *.1) ; do \
|
2015-10-26 21:33:45 +00:00
|
|
|
ln -fs "${PWD}/man/$$FILE" "${DESTDIR}${MANDIR}/man1/$$FILE" ; done
|
|
|
|
cd "${DESTDIR}${MANDIR}/man1" && ln -fs radare2.1 r2.1
|
2016-01-20 01:22:00 +00:00
|
|
|
for FILE in *.7 ; do \
|
|
|
|
ln -fs "${PWD}/man/$$FILE" "${DESTDIR}${MANDIR}/man7/$$FILE" ; done
|
2010-03-12 18:46:11 +01:00
|
|
|
|
2011-02-17 01:22:15 +01:00
|
|
|
install-doc:
|
2020-08-18 12:11:35 +08:00
|
|
|
mkdir -p "${DESTDIR}${DOCDIR}"
|
2017-03-15 19:00:52 +01:00
|
|
|
${INSTALL_DIR} "${DESTDIR}${DOCDIR}"
|
2017-10-18 17:53:00 +02:00
|
|
|
@echo ${DOCDIR}
|
2017-07-16 10:39:01 +02:00
|
|
|
for FILE in doc/* ; do \
|
2017-10-18 13:14:17 +02:00
|
|
|
if [ -f $$FILE ]; then ${INSTALL_DATA} $$FILE "${DESTDIR}${DOCDIR}" || true ; fi; \
|
2017-07-16 10:39:01 +02:00
|
|
|
done
|
2011-02-17 01:22:15 +01:00
|
|
|
|
|
|
|
install-doc-symlink:
|
2020-08-18 12:11:35 +08:00
|
|
|
mkdir -p "${DESTDIR}${DOCDIR}"
|
2017-03-15 19:00:52 +01:00
|
|
|
${INSTALL_DIR} "${DESTDIR}${DOCDIR}"
|
2017-10-18 17:53:00 +02:00
|
|
|
for FILE in $(shell cd doc ; ls) ; do \
|
|
|
|
ln -fs "$(PWD)/doc/$$FILE" "${DESTDIR}${DOCDIR}" ; done
|
2011-02-17 01:22:15 +01:00
|
|
|
|
2020-12-19 10:29:46 +01:00
|
|
|
install: install-doc install-man install-www install-pkgconfig
|
|
|
|
$(MAKE) -C libr install
|
|
|
|
$(MAKE) -C binr install
|
|
|
|
$(MAKE) -C shlr install
|
2018-05-26 18:12:13 +02:00
|
|
|
for DIR in ${DATADIRS} ; do $(MAKE) -C "$$DIR" install ; done
|
2015-12-03 17:02:13 +01:00
|
|
|
cd "$(DESTDIR)$(LIBDIR)/radare2/" ;\
|
|
|
|
rm -f last ; ln -fs $(VERSION) last
|
|
|
|
cd "$(DESTDIR)$(DATADIR)/radare2/" ;\
|
|
|
|
rm -f last ; ln -fs $(VERSION) last
|
2016-11-12 11:08:34 +01:00
|
|
|
rm -rf "${DESTDIR}${DATADIR}/radare2/${VERSION}/hud"
|
|
|
|
mkdir -p "${DESTDIR}${DATADIR}/radare2/${VERSION}/hud"
|
2017-02-14 12:46:54 +01:00
|
|
|
mkdir -p "${DESTDIR}${BINDIR}"
|
2017-10-16 00:06:25 +02:00
|
|
|
#${INSTALL_SCRIPT} "${PWD}/sys/indent.sh" "${DESTDIR}${BINDIR}/r2-indent"
|
|
|
|
#${INSTALL_SCRIPT} "${PWD}/sys/r1-docker.sh" "${DESTDIR}${BINDIR}/r2-docker"
|
2016-11-12 11:08:34 +01:00
|
|
|
cp -f doc/hud "${DESTDIR}${DATADIR}/radare2/${VERSION}/hud/main"
|
2015-10-26 21:33:45 +00:00
|
|
|
mkdir -p "${DESTDIR}${DATADIR}/radare2/${VERSION}/"
|
2017-10-18 17:53:00 +02:00
|
|
|
$(SHELL) ./configure-plugins --rm-static $(DESTDIR)$(LIBDIR)/radare2/last/
|
2009-02-05 22:28:33 +01:00
|
|
|
|
2012-09-06 03:12:54 +02:00
|
|
|
install-www:
|
2015-10-26 21:33:45 +00:00
|
|
|
rm -rf "${DESTDIR}${WWWROOT}"
|
|
|
|
rm -rf "${DESTDIR}${LIBDIR}/radare2/${VERSION}/www" # old dir
|
|
|
|
mkdir -p "${DESTDIR}${WWWROOT}"
|
|
|
|
cp -rf shlr/www/* "${DESTDIR}${WWWROOT}"
|
|
|
|
|
2012-09-06 03:12:54 +02:00
|
|
|
symstall-www:
|
2015-10-26 21:33:45 +00:00
|
|
|
rm -rf "${DESTDIR}${WWWROOT}"
|
|
|
|
rm -rf "${DESTDIR}${LIBDIR}/radare2/${VERSION}/www" # old dir
|
|
|
|
mkdir -p "${DESTDIR}${WWWROOT}"
|
2017-10-18 17:53:00 +02:00
|
|
|
for FILE in $(shell cd shlr/www ; ls) ; do \
|
|
|
|
ln -fs "$(PWD)/shlr/www/$$FILE" "$(DESTDIR)$(WWWROOT)" ; done
|
2012-09-06 03:12:54 +02:00
|
|
|
|
2020-04-20 12:14:28 +02:00
|
|
|
install-pkgconfig pkgconfig-install:
|
|
|
|
@${INSTALL_DIR} "${DESTDIR}${LIBDIR}/pkgconfig"
|
|
|
|
for FILE in $(shell cd pkgcfg ; ls *.pc) ; do \
|
|
|
|
cp -f "$(PWD)/pkgcfg/$$FILE" "${DESTDIR}${LIBDIR}/pkgconfig/$$FILE" ; done
|
|
|
|
|
|
|
|
install-pkgconfig-symlink pkgconfig-symstall symstall-pkgconfig:
|
2020-08-18 12:11:35 +08:00
|
|
|
mkdir -p "${DESTDIR}${LIBDIR}/pkgconfig"
|
2015-10-26 21:33:45 +00:00
|
|
|
@${INSTALL_DIR} "${DESTDIR}${LIBDIR}/pkgconfig"
|
2017-10-18 17:53:00 +02:00
|
|
|
for FILE in $(shell cd pkgcfg ; ls *.pc) ; do \
|
|
|
|
ln -fs "$(PWD)/pkgcfg/$$FILE" "${DESTDIR}${LIBDIR}/pkgconfig/$$FILE" ; done
|
2014-07-10 01:13:04 +02:00
|
|
|
|
2017-07-26 23:15:41 +02:00
|
|
|
symstall-sdb:
|
2015-10-26 21:33:45 +00:00
|
|
|
for DIR in ${DATADIRS} ; do (\
|
|
|
|
cd "$$DIR" ; \
|
|
|
|
echo "$$DIR" ; \
|
|
|
|
${MAKE} install-symlink ); \
|
2011-11-29 03:14:27 +01:00
|
|
|
done
|
2017-07-26 23:15:41 +02:00
|
|
|
|
|
|
|
symstall install-symlink: install-man-symlink install-doc-symlink install-pkgconfig-symlink symstall-www symstall-sdb
|
|
|
|
cd libr && ${MAKE} install-symlink
|
|
|
|
cd binr && ${MAKE} install-symlink
|
|
|
|
cd shlr && ${MAKE} install-symlink
|
2017-02-14 12:46:54 +01:00
|
|
|
mkdir -p "${DESTDIR}${BINDIR}"
|
|
|
|
ln -fs "${PWD}/sys/indent.sh" "${DESTDIR}${BINDIR}/r2-indent"
|
2017-03-10 10:24:43 +01:00
|
|
|
ln -fs "${PWD}/sys/r2-docker.sh" "${DESTDIR}${BINDIR}/r2-docker"
|
2016-11-12 11:08:34 +01:00
|
|
|
mkdir -p "${DESTDIR}${DATADIR}/radare2/${VERSION}/hud"
|
2018-05-26 18:12:13 +02:00
|
|
|
ln -fs "${PWD}/doc/hud" "${DESTDIR}${DATADIR}/radare2/${VERSION}/hud/main"
|
2018-05-30 18:11:14 +02:00
|
|
|
#mkdir -p "${DESTDIR}${DATADIR}/radare2/${VERSION}/flag"
|
|
|
|
#ln -fs $(PWD)/libr/flag/d/tags.r2 "${DESTDIR}${DATADIR}/radare2/${VERSION}/flag/tags.r2"
|
2015-10-26 21:33:45 +00:00
|
|
|
cd "$(DESTDIR)$(LIBDIR)/radare2/" ;\
|
2014-07-10 01:13:04 +02:00
|
|
|
rm -f last ; ln -fs $(VERSION) last
|
2015-12-03 17:02:13 +01:00
|
|
|
cd "$(DESTDIR)$(DATADIR)/radare2/" ;\
|
2014-07-10 01:13:04 +02:00
|
|
|
rm -f last ; ln -fs $(VERSION) last
|
2015-10-26 21:33:45 +00:00
|
|
|
mkdir -p "${DESTDIR}${DATADIR}/radare2/${VERSION}/"
|
2017-05-15 00:57:14 +02:00
|
|
|
$(SHELL) sys/ldconfig.sh
|
2017-05-15 01:41:35 +02:00
|
|
|
$(SHELL) ./configure-plugins --rm-static $(DESTDIR)/$(LIBDIR)/radare2/last/
|
2010-05-24 17:51:51 +02:00
|
|
|
|
2011-03-28 10:24:01 +02:00
|
|
|
deinstall uninstall:
|
2017-02-13 00:56:51 +01:00
|
|
|
rm -f $(DESTDIR)$(BINDIR)/r2-indent
|
2017-03-10 10:24:43 +01:00
|
|
|
rm -f $(DESTDIR)$(BINDIR)/r2-docker
|
2018-05-20 12:03:35 +02:00
|
|
|
cd libr && ${MAKE} uninstall
|
|
|
|
cd binr && ${MAKE} uninstall
|
|
|
|
cd shlr && ${MAKE} uninstall
|
|
|
|
cd libr/syscall/d && ${MAKE} uninstall
|
|
|
|
cd libr/anal/d && ${MAKE} uninstall
|
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:
|
2017-03-15 19:00:52 +01:00
|
|
|
rm -rf "${DESTDIR}${DOCDIR}"
|
2015-10-26 21:33:45 +00:00
|
|
|
cd man ; for FILE in *.1 ; do rm -f "${DESTDIR}${MANDIR}/man1/$$FILE" ; done
|
|
|
|
rm -f "${DESTDIR}${MANDIR}/man1/r2.1"
|
2012-02-17 13:23:58 +01:00
|
|
|
|
2015-10-26 21:33:45 +00:00
|
|
|
user-wrap=echo "\#!/bin/sh" > ~/bin/"$1" \
|
2015-10-31 20:50:49 +01:00
|
|
|
; echo "${PWD}/env.sh '${PREFIX}' '$1' \"\$$@\"" >> ~/bin/"$1" \
|
2015-08-31 23:46:13 +02:00
|
|
|
; chmod +x ~/bin/"$1" ;
|
2014-12-22 04:50:08 +01:00
|
|
|
|
|
|
|
user-install:
|
|
|
|
mkdir -p ~/bin
|
|
|
|
$(foreach mod,$(R2BINS),$(call user-wrap,$(mod)))
|
2015-09-08 15:53:06 +02:00
|
|
|
cd ~/bin ; ln -fs radare2 r2
|
2014-12-22 04:50:08 +01:00
|
|
|
|
|
|
|
user-uninstall:
|
2015-10-26 21:33:45 +00:00
|
|
|
$(foreach mod,$(R2BINS),rm -f ~/bin/"$(mod)")
|
2015-09-08 23:47:45 +02:00
|
|
|
rm -f ~/bin/r2
|
2014-12-22 04:50:08 +01:00
|
|
|
-rmdir ~/bin
|
|
|
|
|
2012-02-17 13:23:58 +01:00
|
|
|
purge-dev:
|
2015-10-26 21:33:45 +00:00
|
|
|
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}/-"*
|
2014-10-04 22:24:35 +09:30
|
|
|
|
2017-05-29 22:47:51 +02:00
|
|
|
# required for EXT_SO
|
|
|
|
include libr/config.mk
|
|
|
|
|
2014-11-22 02:51:35 +01:00
|
|
|
strip:
|
2018-01-28 03:12:50 +01:00
|
|
|
#-for FILE in ${R2BINS} ; do ${STRIP} -s "${DESTDIR}${BINDIR}/$$FILE" 2> /dev/null ; done
|
|
|
|
ifeq ($(HOST_OS),darwin)
|
|
|
|
-${STRIP} -STxX "${DESTDIR}${LIBDIR}/libr_"*".${EXT_SO}"
|
|
|
|
else
|
|
|
|
-${STRIP} -s "${DESTDIR}${LIBDIR}/libr_"*".${EXT_SO}"
|
|
|
|
endif
|
2012-02-17 13:23:58 +01:00
|
|
|
|
2016-01-27 03:02:11 +01:00
|
|
|
purge: purge-doc purge-dev user-uninstall
|
2015-10-26 21:33:45 +00:00
|
|
|
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_"*
|
2017-09-19 08:36:48 -04:00
|
|
|
rm -f "${DESTDIR}${LIBDIR}/libr2"*".${EXT_SO}"
|
2015-10-26 21:33:45 +00:00
|
|
|
rm -rf "${DESTDIR}${LIBDIR}/radare2"
|
|
|
|
rm -rf "${DESTDIR}${INCLUDEDIR}/libr"
|
2017-05-31 13:41:42 +02:00
|
|
|
rm -rf "${DESTDIR}${DATADIR}/radare2"
|
2009-03-06 00:38:23 +00:00
|
|
|
|
2018-08-10 17:06:41 +03:00
|
|
|
system-purge: purge
|
|
|
|
sys/purge.sh
|
2018-02-28 00:50:01 +01:00
|
|
|
|
2016-02-24 18:11:45 +01:00
|
|
|
R2V=radare2-${VERSION}
|
2016-02-23 02:47:49 +01:00
|
|
|
|
2018-02-18 02:04:34 +01:00
|
|
|
v ver version:
|
|
|
|
@echo CURRENT=${VERSION}
|
|
|
|
@echo PREVIOUS=${PREVIOUS_RELEASE}
|
|
|
|
|
2009-03-05 13:15:28 +01:00
|
|
|
dist:
|
2016-02-24 18:11:45 +01:00
|
|
|
rm -rf $(R2V)
|
|
|
|
git clone . $(R2V)
|
2016-02-26 11:44:52 +01:00
|
|
|
-cd $(R2V) && [ ! -f config-user.mk -o configure -nt config-user.mk ] && ./configure "--prefix=${PREFIX}"
|
2016-02-24 18:11:45 +01:00
|
|
|
cd $(R2V) ; git log $$(git show-ref | grep ${PREVIOUS_RELEASE} | awk '{print $$1}')..HEAD > ChangeLog
|
2016-02-26 11:44:52 +01:00
|
|
|
$(MAKE) -C $(R2V)/shlr capstone-sync
|
2016-02-24 18:11:45 +01:00
|
|
|
FILES=`cd $(R2V); git ls-files | sed -e "s,^,$(R2V)/,"` ; \
|
|
|
|
CS_FILES=`cd $(R2V)/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,^,$(R2V)/shlr/capstone/,"` ; \
|
|
|
|
${TAR} "radare2-${VERSION}.tar" $${FILES} $${CS_FILES} "$(R2V)/ChangeLog" ; \
|
2016-02-23 02:47:49 +01:00
|
|
|
${CZ} "radare2-${VERSION}.tar"
|
|
|
|
|
|
|
|
olddist:
|
2015-10-26 21:33:45 +00:00
|
|
|
-[ configure -nt config-user.mk ] && ./configure "--prefix=${PREFIX}"
|
2016-01-20 03:44:59 +01:00
|
|
|
#git log $$(git show-ref `git tag |tail -n1`)..HEAD > ChangeLog
|
|
|
|
git log $$(git show-ref | grep ${PREVIOUS_RELEASE} | awk '{print $$1}')..HEAD > ChangeLog
|
2014-06-14 02:44:31 +02:00
|
|
|
cd shlr && ${MAKE} capstone-sync
|
2018-05-26 18:12:13 +02:00
|
|
|
$(MAKE) -R capstone.ps
|
2015-10-26 21:33:45 +00:00
|
|
|
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}" && \
|
2016-01-20 03:44:59 +01:00
|
|
|
${TAR} "radare2-${VERSION}.tar" $${FILES} $${CS_FILES} "radare2-${VERSION}/ChangeLog" ; \
|
2015-10-26 21:33:45 +00:00
|
|
|
${CZ} "radare2-${VERSION}.tar" ; \
|
|
|
|
mv "radare2-${VERSION}" "$${DIR}"
|
2009-04-25 11:29:39 +00:00
|
|
|
|
|
|
|
shot:
|
|
|
|
DATE=`date '+%Y%m%d'` ; \
|
2015-10-26 21:33:45 +00:00
|
|
|
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}" \
|
2013-07-07 23:03:10 +02:00
|
|
|
radare.org:/srv/http/radareorg/get/shot
|
2009-08-22 01:54:24 +00:00
|
|
|
|
2012-09-04 01:46:12 +02:00
|
|
|
tests:
|
2018-05-26 18:12:13 +02:00
|
|
|
$(MAKE) -C $(R2R)
|
2012-02-03 16:28:52 +01:00
|
|
|
|
2017-11-15 16:43:31 +01:00
|
|
|
macos-sign:
|
|
|
|
$(MAKE) -C binr/radare2 macos-sign
|
2016-01-22 20:53:01 +01:00
|
|
|
|
2017-11-15 16:43:31 +01:00
|
|
|
macos-sign-libs:
|
|
|
|
$(MAKE) -C binr/radare2 macos-sign-libs
|
2015-09-20 23:16:09 +02:00
|
|
|
|
2016-07-07 00:32:59 +02:00
|
|
|
osx-pkg:
|
|
|
|
sys/osx-pkg.sh $(VERSION)
|
|
|
|
|
2015-04-17 21:12:30 +02:00
|
|
|
quality:
|
|
|
|
./sys/shellcheck.sh
|
|
|
|
|
2016-03-25 11:10:16 +01:00
|
|
|
menu nconfig:
|
|
|
|
./sys/menu.sh || true
|
|
|
|
|
2018-01-13 22:11:53 +03:00
|
|
|
meson:
|
2017-12-02 12:56:31 +01:00
|
|
|
@echo "[ Meson R2 Building ]"
|
2018-01-13 22:11:53 +03:00
|
|
|
$(PYTHON) sys/meson.py --prefix="${PREFIX}" --shared
|
2017-05-02 05:05:36 +02:00
|
|
|
|
|
|
|
meson-install:
|
2018-01-13 22:11:53 +03:00
|
|
|
DESTDIR="$(DESTDIR)" ninja -C build install
|
2017-05-02 05:05:36 +02:00
|
|
|
|
2017-07-26 23:15:41 +02:00
|
|
|
meson-symstall: symstall-sdb
|
2018-02-24 14:41:22 +01:00
|
|
|
@echo "[ Meson symstall (not stable) ]"
|
2018-05-26 18:12:13 +02:00
|
|
|
ln -fs $(PWD)/binr/r2pm/r2pm ${B}/r2pm
|
2017-05-15 00:39:41 +02:00
|
|
|
ln -fs $(PWD)/build/binr/rasm2/rasm2 ${B}/rasm2
|
|
|
|
ln -fs $(PWD)/build/binr/rarun2/rarun2 ${B}/rarun2
|
|
|
|
ln -fs $(PWD)/build/binr/radare2/radare2 ${B}/radare2
|
|
|
|
ln -fs $(PWD)/build/binr/rahash2/rahash2 ${B}/rahash2
|
|
|
|
ln -fs $(PWD)/build/binr/rabin2/rabin2 ${B}/rabin2
|
|
|
|
ln -fs $(PWD)/build/binr/radare2/radare2 ${B}/radare2
|
|
|
|
ln -fs $(PWD)/build/binr/ragg2/ragg2 ${B}/ragg2
|
|
|
|
cd $(B) && ln -fs radare2 r2
|
2017-05-29 22:47:51 +02:00
|
|
|
ln -fs $(PWD)/build/libr/util/libr_util.$(EXT_SO) ${L}/libr_util.$(EXT_SO)
|
|
|
|
ln -fs $(PWD)/build/libr/bp/libr_bp.$(EXT_SO) ${L}/libr_bp.$(EXT_SO)
|
|
|
|
ln -fs $(PWD)/build/libr/syscall/libr_syscall.$(EXT_SO) ${L}/libr_syscall.$(EXT_SO)
|
|
|
|
ln -fs $(PWD)/build/libr/cons/libr_cons.$(EXT_SO) ${L}/libr_cons.$(EXT_SO)
|
|
|
|
ln -fs $(PWD)/build/libr/search/libr_search.$(EXT_SO) ${L}/libr_search.$(EXT_SO)
|
|
|
|
ln -fs $(PWD)/build/libr/magic/libr_magic.$(EXT_SO) ${L}/libr_magic.$(EXT_SO)
|
|
|
|
ln -fs $(PWD)/build/libr/flag/libr_flag.$(EXT_SO) ${L}/libr_flag.$(EXT_SO)
|
|
|
|
ln -fs $(PWD)/build/libr/reg/libr_reg.$(EXT_SO) ${L}/libr_reg.$(EXT_SO)
|
|
|
|
ln -fs $(PWD)/build/libr/bin/libr_bin.$(EXT_SO) ${L}/libr_bin.$(EXT_SO)
|
|
|
|
ln -fs $(PWD)/build/libr/config/libr_config.$(EXT_SO) ${L}/libr_config.$(EXT_SO)
|
|
|
|
ln -fs $(PWD)/build/libr/parse/libr_parse.$(EXT_SO) ${L}/libr_parse.$(EXT_SO)
|
|
|
|
ln -fs $(PWD)/build/libr/lang/libr_lang.$(EXT_SO) ${L}/libr_lang.$(EXT_SO)
|
|
|
|
ln -fs $(PWD)/build/libr/asm/libr_asm.$(EXT_SO) ${L}/libr_asm.$(EXT_SO)
|
|
|
|
ln -fs $(PWD)/build/libr/anal/libr_anal.$(EXT_SO) ${L}/libr_anal.$(EXT_SO)
|
|
|
|
ln -fs $(PWD)/build/libr/egg/libr_egg.$(EXT_SO) ${L}/libr_egg.$(EXT_SO)
|
|
|
|
ln -fs $(PWD)/build/libr/fs/libr_fs.$(EXT_SO) ${L}/libr_fs.$(EXT_SO)
|
|
|
|
ln -fs $(PWD)/build/libr/debug/libr_debug.$(EXT_SO) ${L}/libr_debug.$(EXT_SO)
|
|
|
|
ln -fs $(PWD)/build/libr/core/libr_core.$(EXT_SO) ${L}/libr_core.$(EXT_SO)
|
2017-05-15 00:39:41 +02:00
|
|
|
|
|
|
|
meson-uninstall:
|
2018-01-13 22:11:53 +03:00
|
|
|
ninja -C build uninstall
|
2017-05-15 00:39:41 +02:00
|
|
|
$(MAKE) uninstall
|
|
|
|
|
|
|
|
meson-clean:
|
|
|
|
rm -rf build
|
2017-12-02 12:56:31 +01:00
|
|
|
rm -rf build_sdb
|
2017-05-15 00:39:41 +02:00
|
|
|
|
2018-05-26 18:12:13 +02:00
|
|
|
MESON_FILES=$(shell find build/libr build/binr -type f | grep -v @)
|
2017-05-15 00:39:41 +02:00
|
|
|
meson-symstall-experimental:
|
2018-05-26 18:12:13 +02:00
|
|
|
for a in $(MESON_FILES) ; do echo ln -fs "$(PWD)/$$a" "$(PWD)/$$(echo $$a|sed -e s,build/,,)" ; done
|
2017-05-02 05:05:36 +02:00
|
|
|
$(MAKE) symstall
|
|
|
|
|
2018-04-11 02:32:27 +02:00
|
|
|
shlr/capstone:
|
|
|
|
$(MAKE) -C shlr capstone
|
|
|
|
|
2017-05-02 05:05:36 +02:00
|
|
|
.PHONY: meson meson-install
|
|
|
|
|
2009-08-22 01:54:24 +00:00
|
|
|
include ${MKPLUGINS}
|
2009-03-05 13:15:28 +01:00
|
|
|
|
2018-08-10 17:06:41 +03:00
|
|
|
.PHONY: all clean install symstall uninstall deinstall strip
|
2015-04-18 10:35:57 +02:00
|
|
|
.PHONY: libr binr install-man w32dist tests dist shot pkgcfg depgraph.png love
|
2018-08-10 17:06:41 +03:00
|
|
|
.PHONY: purge system-purge
|
2018-04-11 02:32:27 +02:00
|
|
|
.PHONY: shlr/capstone
|