mirror of
https://github.com/radareorg/r2ghidra.git
synced 2026-11-07 06:25:57 -10:00
Use the upstream Meson dependency, shared source manifest, and Sleigh compilation helper instead of maintaining local copies. Check pinned subprojects before Make and XPS builds, cache fetched revisions for offline reuse, and save local ghidra-native changes in a named stash before updating.
70 lines
2.2 KiB
Makefile
70 lines
2.2 KiB
Makefile
include config.mk
|
|
DESTDIR?=
|
|
|
|
all: subprojects ghidra-processors.txt
|
|
$(MAKE) -C src
|
|
$(MAKE) -C ghidra
|
|
|
|
subprojects:
|
|
$(MAKE) -C subprojects
|
|
|
|
c: subprojects
|
|
make -C src -j4
|
|
|
|
purge: clean
|
|
$(MAKE) uninstall
|
|
$(MAKE) user-uninstall
|
|
|
|
ghidra-processors.txt: ghidra-processors.txt.default
|
|
cp -f ghidra-processors.txt.default ghidra-processors.txt
|
|
|
|
asan: subprojects ghidra-processors.txt
|
|
CFLAGS=-g CXXFLAGS=-g $(MAKE) -C src asan
|
|
|
|
asan-run:
|
|
DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib r2 -s 9664 /Users/pancake/Downloads/usr-4/bin/bc
|
|
|
|
help:
|
|
@echo
|
|
@echo "./configure # first you need to run configure"
|
|
@echo "make # build r2ghidra plugins"
|
|
@echo "make install # install plugin and sleighs into prefix"
|
|
@echo "make uninstall # uninstall r2ghidra from prefix (see user-uninstall)"
|
|
@echo "make user-install # install in your home"
|
|
@echo "make user-uninstall # uninstall r2ghidra from prefix (see user-uninstall)"
|
|
@echo
|
|
|
|
clean:
|
|
$(MAKE) -C src clean
|
|
$(MAKE) -C ghidra clean
|
|
rm -f ghidra-processors.txt
|
|
rm -f config.mk
|
|
|
|
install uninstall user-install user-uninstall:
|
|
$(MAKE) -C src $@
|
|
$(MAKE) -C ghidra $@
|
|
|
|
mrproper: clean
|
|
rm -rf subprojects/ghidra-native
|
|
rm -rf subprojects/zlib
|
|
|
|
r2ghidra_sleigh.zip dist: ghidra-processors.txt
|
|
rm -rf tmp && mkdir -p tmp
|
|
$(MAKE) -C ghidra user-install DH=$(shell pwd)/tmp/r2ghidra_sleigh-$(VERSION)
|
|
cd tmp && zip -r ../r2ghidra_sleigh-$(VERSION).zip *
|
|
rm -rf tmp
|
|
|
|
|
|
# Binary package for r2pm -bi: plugins/ (with r2ghidra_sleigh/) and bin/ for this r2 version and platform
|
|
BINDIST_ZIP=r2ghidra-$(shell r2 -qv)-$(shell r2pm -H R2PM_OS)-$(shell r2pm -H R2PM_ARCH)-$(shell r2pm -H R2PM_BITS).zip
|
|
BINDIST_DIR=$(CURDIR)/tmp/bindist
|
|
|
|
bindist: ghidra-processors.txt
|
|
rm -rf $(BINDIST_DIR) $(BINDIST_ZIP)
|
|
$(MAKE) -C src install DESTDIR= PLUGDIR=$(BINDIST_DIR)/plugins BINDIR=$(BINDIST_DIR)/bin
|
|
$(MAKE) -C ghidra user-install DH=$(BINDIST_DIR)/plugins/r2ghidra_sleigh
|
|
cd $(BINDIST_DIR) && zip -r $(CURDIR)/$(BINDIST_ZIP) plugins bin
|
|
rm -rf $(BINDIST_DIR)
|
|
|
|
.PHONY: mrproper clean install uninstall all dist bindist subprojects
|