Files
retoor 4bd31393cc feat: add complete rtop system monitoring tool with cpu, memory, process, network, disk, and filesystem modules
Implement the initial project structure for rtop, a terminal-based system monitor written in C, including header files for all monitoring subsystems (cpu.h, memory.h, process.h, network.h, disk.h, filesystem.h, system.h, terminal.h, display.h), a Makefile with static linking and debug build support, a .gitignore for object files, a CHANGELOG documenting version 0.1.0, and a comprehensive README with build instructions, usage examples, and feature descriptions covering per-core CPU utilization, memory/swap stats, process listing with sort options, network interface rates, disk I/O, and filesystem usage with color-coded output and terminal resize handling.
2025-12-13 04:38:27 +00:00

35 lines
705 B
Makefile

# retoor <retoor@molodetz.nl>
CC = gcc
CFLAGS = -Wall -Wextra -Werror -pedantic -std=c99 -O3 -march=native -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE
LDFLAGS = -static
SRCDIR = src
INCDIR = include
OBJDIR = obj
SOURCES = $(wildcard $(SRCDIR)/*.c)
OBJECTS = $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
TARGET = rtop
.PHONY: all clean debug
all: $(TARGET)
debug: CFLAGS += -g -DDEBUG
debug: $(TARGET)
$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) -o $@ $(LDFLAGS) 2>/dev/null || $(CC) $(OBJECTS) -o $@
$(OBJDIR)/%.o: $(SRCDIR)/%.c | $(OBJDIR)
$(CC) $(CFLAGS) -I$(INCDIR) -c $< -o $@
$(OBJDIR):
mkdir -p $(OBJDIR)
clean:
rm -rf $(OBJDIR) $(TARGET)
install: $(TARGET)
install -m 755 $(TARGET) /usr/local/bin/