diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-02 10:58:21 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-02 10:58:21 -0400 |
| commit | 002e3d7d13c414ea874abbee8d82803dd3a72fe5 (patch) | |
| tree | 6627c12fa07f6a1cf73e5aaeb7390e698dd3a896 /tools/rmtop/Makefile | |
| parent | 2f249817df327f5dcccf0464ad517fa60d6071d3 (diff) | |
| download | open-iov-002e3d7d13c414ea874abbee8d82803dd3a72fe5.tar.gz open-iov-002e3d7d13c414ea874abbee8d82803dd3a72fe5.zip | |
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
Diffstat (limited to 'tools/rmtop/Makefile')
| -rw-r--r-- | tools/rmtop/Makefile | 46 |
1 files changed, 46 insertions, 0 deletions
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 |
