From 002e3d7d13c414ea874abbee8d82803dd3a72fe5 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Fri, 2 Oct 2026 10:58:21 -0400 Subject: debug: green-eye wave 3 - RM harness, local simulator, device map, MCP plugin, value-validation demos, CI pipeline, toolchain docs; add host RM tools rmtool/rmtop --- tools/rmtop/Makefile | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tools/rmtop/Makefile (limited to 'tools/rmtop/Makefile') diff --git a/tools/rmtop/Makefile b/tools/rmtop/Makefile new file mode 100644 index 0000000..3a5cd67 --- /dev/null +++ b/tools/rmtop/Makefile @@ -0,0 +1,46 @@ +# rmtop - read-only ncurses GPU dashboard (Open-IOV). +# +# Reuses rmtool's RM query layer (../rmtool/src) so there is exactly one +# ioctl implementation. Requires ncursesw; falls back to -lncursesw when +# pkg-config is unavailable. +CC ?= gcc +CFLAGS ?= -O2 -Wall -Wextra +RMTOOL = ../rmtool +CPPFLAGS += -Iinclude -I$(RMTOOL)/include +NCURSES_CFLAGS := $(shell pkg-config --cflags ncursesw 2>/dev/null) +NCURSES_LIBS := $(shell pkg-config --libs ncursesw 2>/dev/null || echo -lncursesw) +CFLAGS += $(NCURSES_CFLAGS) + +OBJS = src/main.o src/panel.o +SHARED = build/rm_api.o build/query.o build/output.o +PREFIX ?= /usr/local + +all: rmtop + +rmtop: $(OBJS) $(SHARED) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(NCURSES_LIBS) + +build: + @mkdir -p build + +build/rm_api.o: $(RMTOOL)/src/rm_api.c $(RMTOOL)/include/rm_api.h | build + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< + +build/query.o: $(RMTOOL)/src/query.c $(RMTOOL)/include/rm_api.h $(RMTOOL)/include/rmtool.h | build + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< + +build/output.o: $(RMTOOL)/src/output.c $(RMTOOL)/include/rmtool.h | build + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< + +src/%.o: src/%.c include/rmtop.h $(RMTOOL)/include/rm_api.h $(RMTOOL)/include/rmtool.h | build + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< + +install: rmtop + install -d $(DESTDIR)$(PREFIX)/bin + install -m 0755 rmtop $(DESTDIR)$(PREFIX)/bin/rmtop + +clean: + rm -f $(OBJS) $(SHARED) rmtop + rmdir build 2>/dev/null || true + +.PHONY: all install clean -- cgit v1.2.3