Clean up plugin build workflow and docs

This commit is contained in:
2026-04-22 22:39:53 +02:00
parent 4e49d0d0e6
commit de06753520
6 changed files with 48 additions and 15 deletions

View File

@@ -1,15 +1,24 @@
NAME=asm_adsp219x
R2_PLUGINS=$(shell r2 -H R2_USER_PLUGINS)
R2_INCDIR=$(shell r2 -H R2_INCDIR)
R2_LIBDIR=$(shell r2 -H R2_LIBDIR)
NAME ?= asm_adsp219x
CC ?= gcc
CFLAGS ?= -Wall -Wextra -O2 -fPIC
LDFLAGS ?=
LDLIBS ?= -lr_arch -lr_util
R2_PLUGINS := $(shell r2 -H R2_USER_PLUGINS)
R2_INCDIR := $(shell r2 -H R2_INCDIR)
R2_LIBDIR := $(shell r2 -H R2_LIBDIR)
CPPFLAGS += -I$(R2_INCDIR) -I$(R2_INCDIR)/sdb
all: $(NAME).so
$(NAME).so: $(NAME).c
gcc -shared -Wall -O2 -fPIC \
-I$(R2_INCDIR) -I$(R2_INCDIR)/sdb \
$(CC) $(CPPFLAGS) $(CFLAGS) -shared $(LDFLAGS) \
-L$(R2_LIBDIR) \
$(NAME).c -o $@ -lr_arch -lr_util
$< -o $@ $(LDLIBS)
test: $(NAME).so
r2 -q -a adsp219x -L ./$(NAME).so -b 24 -c "pd 48" ../examples/isa_test.bin >/dev/null
install: $(NAME).so
mkdir -p $(R2_PLUGINS)
@@ -21,4 +30,4 @@ uninstall:
clean:
rm -f $(NAME).so
.PHONY: all install uninstall clean
.PHONY: all test install uninstall clean