-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (28 loc) · 692 Bytes
/
Makefile
File metadata and controls
41 lines (28 loc) · 692 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
CC := gcc
CFLAGS := -Wall -Wextra -std=c99 -O2 -g
LDFLAGS := -lncurses
# Installation setup
PREFIX ?= /usr/local
BINDIR := $(PREFIX)/bin
TARGET := prcsmgr
# Source management
SRCS := main.c process_list.c ui.c
OBJS := $(SRCS:.c=.o)
# --- Build Rules ---
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(OBJS) -o $(TARGET) $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
# --- Utility Tasks ---
clean:
rm -f $(OBJS) $(TARGET)
run: $(TARGET)
./$(TARGET)
# --- Installation ---
install: $(TARGET)
mkdir -p $(DESTDIR)$(BINDIR)
install -m 755 $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET)
uninstall:
rm -f $(DESTDIR)$(BINDIR)/$(TARGET)
.PHONY: all clean run install uninstall